diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-10 01:28:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-10 01:28:51 +0000 |
commit | 0e1a5ece622a3a7967914e43cb4ad6b68000136d (patch) | |
tree | fe1f3c47e531a0bb357da41736f314f4fe1daf65 /tool/ruby_vm | |
parent | 9da6b8dfdd14e2afe66ffeed86e5456469b1fb19 (diff) | |
download | ruby-0e1a5ece622a3a7967914e43cb4ad6b68000136d.tar.gz |
mjit_compile.c: original_body_iseq
* mjit_compile.c (mjit_compile): name the original iseq pointer to
eliminate magic numbers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_insn.erb | 4 | ||||
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_insn.erb b/tool/ruby_vm/views/_mjit_compile_insn.erb index 1a8129eb9f..46c585ca52 100644 --- a/tool/ruby_vm/views/_mjit_compile_insn.erb +++ b/tool/ruby_vm/views/_mjit_compile_insn.erb @@ -50,10 +50,10 @@ % % # JIT: move sp and pc if necessary % if insn.handles_frame? - fprintf(f, " reg_cfp->pc = (VALUE *)0x%"PRIxVALUE";\n", (VALUE)(body->iseq_encoded + next_pos)); /* ADD_PC(INSN_ATTR(width)); */ + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */ fprintf(f, " reg_cfp->sp = reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */ % else - fprintf(f, " reg_cfp->pc = (VALUE *)0x%"PRIxVALUE";\n", (VALUE)(body->iseq_encoded + pos)); + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); fprintf(f, " reg_cfp->sp = reg_cfp->bp + %d;\n", b->stack_size + 1); % end % diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index 6624cfe7db..fd133ae159 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -23,12 +23,12 @@ int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */ % # JIT: move sp and pc if necessary - fprintf(f, " reg_cfp->pc = (VALUE *)0x%"PRIxVALUE";\n", (VALUE)(body->iseq_encoded + next_pos)); /* ADD_PC(INSN_ATTR(width)); */ + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */ fprintf(f, " reg_cfp->sp = reg_cfp->bp + %d;\n", b->stack_size + 1 - <%= insn.pops.size %>); /* POPN(INSN_ATTR(popn)); */ % # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things. fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %llu || RCLASS_SERIAL(CLASS_OF(stack[%d])) != %llu)) {\n", cc->method_state, b->stack_size - 1 - argc, cc->class_serial); - fprintf(f, " reg_cfp->pc = (VALUE *)0x%"PRIxVALUE";\n", (VALUE)(body->iseq_encoded + pos)); + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); fprintf(f, " return Qundef; /* cancel JIT */\n"); fprintf(f, " }\n"); |