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

Please add luajit2.1 bytecode #47

Open
baby0o01999 opened this issue May 11, 2022 · 0 comments
Open

Please add luajit2.1 bytecode #47

baby0o01999 opened this issue May 11, 2022 · 0 comments

Comments

@baby0o01999
Copy link

baby0o01999 commented May 11, 2022

luajit2.1 enable GC64
lj_arch.h
#define LJ_FR2 1

The bytecode changes are as follows.
Bold is the changing bytecode

test code

local ffi = require("ffi") local a = "12345" local b = "test" print(a,b)

luajit-lang-toolkit

'''lua
luajit run.lua -bl 1.lua
-- BYTECODE -- 1.lua:0-9
0001 GGET 0 0 ; "require"
0002 KSTR 1 1 ; "ffi"
0003 CALL 0 2 2
0004 KSTR 1 2 ; "12345"
0005 KSTR 2 3 ; "test"
0006 GGET 3 4 ; "print"
0007 MOV 4 1
0008 MOV 5 2

0009 CALL 3 1 3
0010 RET0 0 1
'''

luajit
'''lua
luajit -bl 1.lua
-- BYTECODE -- 1.lua:0-9
0001 GGET 0 0 ; "require"
0002 KSTR 2 1 ; "ffi"
0003 CALL 0 2 2
0004 KSTR 1 2 ; "12345"
0005 KSTR 2 3 ; "test"
0006 GGET 3 4 ; "print"
0007 MOV 5 1
0008 MOV 6 2

0009 CALL 3 1 3
0010 RET0 0 1




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

1 participant