Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace native LuaJIT bytecode compiler? #40

Open
lukego opened this issue Apr 7, 2019 · 4 comments
Open

Replace native LuaJIT bytecode compiler? #40

lukego opened this issue Apr 7, 2019 · 4 comments

Comments

@lukego
Copy link

lukego commented Apr 7, 2019

I'm really happy to discover this cool project!

Has anybody looked into "dropping in" this bytecode compiler to replace the C implementation in LuaJIT? This is something we have been discussing over at raptorjit/raptorjit#248 but we weren't aware of this project until now.

@franko
Copy link
Owner

franko commented Apr 7, 2019

Hi,

as far as I know, no, nobody did the drop in you are talking about.

To me it make some sense and it should be feasible without big difficulties. You could have then a luajitvm that only run the bytecode and a luajit-frontend written in Lua that does the parsing if required and invokes luajitvm appropriately.

I would say that the only technical things that should be done on the luajit lang toolkit is to fix its bytecode generation so that it always generate identical bytecode to what luajit does. Currently this is mostly true except for conditional expression like

local a = expr1 and expr2 or expr3

Generating identical bytecode is desirable to be sure that no bugs are introduced from the language toolkit side.

To this purpose the language toolkit has extensive tests that compares the bytecode byte-by-byte but currently they are not required to match.

@franko
Copy link
Owner

franko commented Apr 7, 2019

Oh, I forgot to add that support for 2.1 bytecode should be added. Currently only 2.0 is supported.

@fsfod
Copy link

fsfod commented Apr 7, 2019

One changes needed for 2.1 bytecode is calls on GC64 builds need an extra stack slot for the two slot call frames.

@gotzmann
Copy link

Oh, I forgot to add that support for 2.1 bytecode should be added. Currently only 2.0 is supported.

Are there plans for 2.1 support in this toolkit ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants