summaryrefslogtreecommitdiff
path: root/tool/ruby_vm
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 03:38:38 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 03:38:38 +0000
commitb4b012c529d4c5ca71e6bcd3e543652001ab6903 (patch)
treedd7312cd9af9748bbab240bf8e6fdecacd183172 /tool/ruby_vm
parent6dfaccf20da5deefe66221df8b4d95c68dfbe233 (diff)
_mjit_compile_send.erb: refactor to share vm_call_iseq_setup_normal
implementation. This had no major performance impact by effort to keep them inlined. vm_insnhelper.c: ditto mjit_compile.c: just update the comment about opt_pc=0 assumption git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb19
1 files changed, 7 insertions, 12 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 0a01ea2f86..1da6eddf08 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -37,23 +37,18 @@
% # JIT: Print insn body in insns.def
fprintf(f, " {\n");
- fprintf(f, " struct rb_calling_info calling;\n");
+ fprintf(f, " VALUE block_handler = VM_BLOCK_HANDLER_NONE;\n");
% if insn.name == 'send'
+ fprintf(f, " struct rb_calling_info calling;\n");
fprintf(f, " vm_caller_setup_arg_block(ec, reg_cfp, &calling, (CALL_INFO)0x%"PRIxVALUE", (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n", operands[0], operands[2]);
-% else
- fprintf(f, " calling.block_handler = VM_BLOCK_HANDLER_NONE;\n");
+ fprintf(f, " block_handler = calling.block_handler;\n");
% end
- fprintf(f, " calling.argc = %d;\n", ci->orig_argc);
- fprintf(f, " calling.recv = stack[%d];\n", b->stack_size - 1 - argc);
-
-% # JIT: Special CALL_METHOD. Inline vm_call_iseq_setup_normal for vm_call_iseq_setup_func FASTPATH. TODO: modify VM to share code with here
+% # JIT: Special CALL_METHOD. Inline vm_call_iseq_setup_normal for vm_call_iseq_setup_func FASTPATH.
fprintf(f, " {\n");
fprintf(f, " VALUE v;\n");
- fprintf(f, " VALUE *argv = reg_cfp->sp - calling.argc;\n");
- fprintf(f, " reg_cfp->sp = argv - 1;\n"); /* recv */
- fprintf(f, " vm_push_frame(ec, (const rb_iseq_t *)0x%"PRIxVALUE", VM_FRAME_MAGIC_METHOD | VM_ENV_FLAG_LOCAL, calling.recv, "
- "calling.block_handler, 0x%"PRIxVALUE", (const VALUE *)0x%"PRIxVALUE", argv + %d, %d, %d);\n",
- (VALUE)iseq, (VALUE)cc->me, (VALUE)iseq->body->iseq_encoded, param_size, iseq->body->local_table_size - param_size, iseq->body->stack_max);
+ fprintf(f, " const rb_callable_method_entry_t *me = 0x%"PRIxVALUE";\n", (VALUE)cc->me);
+ fprintf(f, " vm_call_iseq_setup_normal_internal(ec, reg_cfp, %d, stack[%d], block_handler, me, (const rb_iseq_t *)0x%"PRIxVALUE", (const VALUE *)0x%"PRIxVALUE", %d, %d, %d);\n",
+ argc, b->stack_size - 1 - argc, (VALUE)iseq, (VALUE)iseq->body->iseq_encoded, param_size, iseq->body->local_table_size, iseq->body->stack_max);
if (iseq->body->catch_except_p) {
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
fprintf(f, " v = vm_exec(ec, TRUE);\n");