Skip to content

[luajit] Fix G-finding heuristic on aarch64#236

Merged
umanwizard merged 1 commit into
mainfrom
lj-g
Mar 11, 2026
Merged

[luajit] Fix G-finding heuristic on aarch64#236
umanwizard merged 1 commit into
mainfrom
lj-g

Conversation

@umanwizard
Copy link
Copy Markdown
Collaborator

I can't figure out why at some point we thought that r7 holds the dispatch table on ARM, but as far as I can tell, that's not the case.

What is, however, the case, is that r22 holds G; see here:

https://github.com/LuaJIT/LuaJIT/blob/659a61693aa3b87661864ad0f12eee14c865cd7f/src/lj_target_arm64.h#L41

And this is the register we load g from, e.g. when entering lj_gc_step_jit.

I can't figure out why at some point we thought that r7 holds the
dispatch table on ARM, but as far as I can tell, that's not the case.

What is, however, the case, is that r22 holds G; see here:

https://github.com/LuaJIT/LuaJIT/blob/659a61693aa3b87661864ad0f12eee14c865cd7f/src/lj_target_arm64.h#L41

And this is the register we load `g` from, e.g. when entering `lj_gc_step_jit`.
@umanwizard umanwizard merged commit d8b5dc8 into main Mar 11, 2026
49 of 51 checks passed
umanwizard added a commit that referenced this pull request Apr 28, 2026
I can't figure out why at some point we thought that r7 holds the
dispatch table on ARM, but as far as I can tell, that's not the case.

What is, however, the case, is that r22 holds G; see here:

https://github.com/LuaJIT/LuaJIT/blob/659a61693aa3b87661864ad0f12eee14c865cd7f/src/lj_target_arm64.h#L41

And this is the register we load `g` from, e.g. when entering `lj_gc_step_jit`.
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

Successfully merging this pull request may close these issues.

2 participants