From 8076928003ff0fe6541c6f06da18f365c1e79b44 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 12 Aug 2018 00:30:04 +0000 Subject: [PATCH] vm_insnhelper.c: revert r64280 This commit caused test-all failure with --jit-wait. I don't know the reason yet, but let me revert it to normalize CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/views/_mjit_compile_send.erb | 19 +++++++++----- vm_insnhelper.c | 30 ++++++++--------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index 08fb8a9b10..3f6f6f106f 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -37,16 +37,23 @@ % # JIT: Print insn body in insns.def fprintf(f, " {\n"); - fprintf(f, " VALUE block_handler = VM_BLOCK_HANDLER_NONE;\n"); + fprintf(f, " struct rb_calling_info calling;\n"); % if insn.name == 'send' - fprintf(f, " block_handler = vm_caller_setup_arg_block(ec, reg_cfp, (CALL_INFO)0x%"PRIxVALUE", (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n", operands[0], operands[2]); + fprintf(f, " calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, (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"); % end -% # JIT: Special CALL_METHOD. Inline vm_call_iseq_setup_normal for vm_call_iseq_setup_func FASTPATH. + 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 fprintf(f, " {\n"); fprintf(f, " VALUE v;\n"); - 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); + 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); 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"); diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 04c1dba918..9dd8abf520 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1657,32 +1657,22 @@ vm_call_iseq_setup_2(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct } } -/* Used in JIT to ensure intended me is used and to reduce memory access by inlining values. */ -ALWAYS_INLINE(static VALUE vm_call_iseq_setup_normal_internal(rb_execution_context_t *ec, rb_control_frame_t *cfp, int argc, VALUE recv, VALUE block_handler, const rb_callable_method_entry_t *me, const rb_iseq_t *iseq, const VALUE *pc, int param_size, int local_size, int stack_max)); -static inline VALUE -vm_call_iseq_setup_normal_internal(rb_execution_context_t *ec, rb_control_frame_t *cfp, int argc, VALUE recv, VALUE block_handler, const rb_callable_method_entry_t *me, - const rb_iseq_t *iseq, const VALUE *pc, int param_size, int local_size, int stack_max) -{ - VALUE *argv = cfp->sp - argc; - VALUE *sp = argv + param_size; - cfp->sp = argv - 1 /* recv */; - - vm_push_frame(ec, iseq, VM_FRAME_MAGIC_METHOD | VM_ENV_FLAG_LOCAL, recv, - block_handler, (VALUE)me, - pc, sp, - local_size - param_size, - stack_max); - return Qundef; -} - static inline VALUE vm_call_iseq_setup_normal(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, int opt_pc, int param_size, int local_size) { const rb_callable_method_entry_t *me = cc->me; const rb_iseq_t *iseq = def_iseq_ptr(me->def); - return vm_call_iseq_setup_normal_internal(ec, cfp, calling->argc, calling->recv, calling->block_handler, me, iseq, - iseq->body->iseq_encoded + opt_pc, param_size, local_size, iseq->body->stack_max); + VALUE *argv = cfp->sp - calling->argc; + VALUE *sp = argv + param_size; + cfp->sp = argv - 1 /* recv */; + + vm_push_frame(ec, iseq, VM_FRAME_MAGIC_METHOD | VM_ENV_FLAG_LOCAL, calling->recv, + calling->block_handler, (VALUE)me, + iseq->body->iseq_encoded + opt_pc, sp, + local_size - param_size, + iseq->body->stack_max); + return Qundef; } static inline VALUE