summaryrefslogtreecommitdiff
path: root/ujit_iface.c
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2021-01-13 14:14:16 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:27 -0400
commit2cf32e5505d8da85f31df3a0bff7b0fd38054503 (patch)
treeb54bfa4a291214bbcac05c40fa66422388e2dca3 /ujit_iface.c
parentef08af93769982047e59356d76c7e72a67970335 (diff)
Refactor ujit logic for generating iseq entry points
Diffstat (limited to 'ujit_iface.c')
-rw-r--r--ujit_iface.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ujit_iface.c b/ujit_iface.c
index 46d4bc4864..85be128057 100644
--- a/ujit_iface.c
+++ b/ujit_iface.c
@@ -237,10 +237,14 @@ rb_ujit_compile_iseq(const rb_iseq_t *iseq)
VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
// Compile a block version starting at the first instruction
- uint8_t* native_code_ptr = ujit_compile_entry(iseq, 0);
+ uint8_t* code_ptr = gen_entry_point(iseq, 0);
- if (native_code_ptr) {
- encoded[0] = (VALUE)native_code_ptr;
+ if (code_ptr)
+ {
+ // Map the code address to the corresponding opcode
+ int first_opcode = opcode_at_pc(iseq, &encoded[0]);
+ map_addr2insn(code_ptr, first_opcode);
+ encoded[0] = (VALUE)code_ptr;
}
RB_VM_LOCK_LEAVE();