diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-23 16:20:45 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-23 16:20:45 +0000 |
commit | f84efbaa0fc3d0c04530e04455ec3d9cb65e5d08 (patch) | |
tree | b63b64518faf9afd004485910010c42af93cd66e /tool/ruby_vm/views | |
parent | 4cae5353c03009beb1e0a1619422072773580609 (diff) |
revert r63212
except test_jit.rb.
In some situations, this generates a wrong code. I'll add a test for it
later but let me revert this to make it work for now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm/views')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 24 | ||||
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send_guard.erb | 14 |
2 files changed, 7 insertions, 31 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index f5ac1f3e6c..d26224c084 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -29,12 +29,16 @@ fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size); } -% # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things. -<%= render 'mjit_compile_send_guard' -%> - % # JIT: move sp and pc if necessary <%= render 'mjit_compile_pc_and_sp', locals: { insn: insn } -%> +% # 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() != %"PRI_SERIALT_PREFIX"u ||\n", cc->method_state); + fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc->class_serial); + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); + fprintf(f, " goto cancel;\n"); + fprintf(f, " }\n"); + % # JIT: Print insn body in insns.def fprintf(f, " {\n"); fprintf(f, " struct rb_calling_info calling;\n"); @@ -84,19 +88,5 @@ fprintf(f, "}\n"); break; } -% if insn.name == 'opt_send_without_block' - else if (cc->me->def->type == VM_METHOD_TYPE_IVAR) { -% # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things. -<%= render 'mjit_compile_send_guard' -%> - -% # JIT: vm_call_ivar without sp motion - fprintf(f, " stack[%d] = vm_getivar(stack[%d], (ID)0x%"PRIxVALUE", NULL, (CALL_CACHE)0x%"PRIxVALUE", 1);\n", - b->stack_size - argc - 1, b->stack_size - argc - 1, cc->me->def->body.attr.id, (VALUE)cc); - -% # compiler: Move JIT compiler's internal stack pointer - b->stack_size += <%= insn.call_attribute('sp_inc') %>; - break; - } -% end } } diff --git a/tool/ruby_vm/views/_mjit_compile_send_guard.erb b/tool/ruby_vm/views/_mjit_compile_send_guard.erb deleted file mode 100644 index 7bdb2a3ebf..0000000000 --- a/tool/ruby_vm/views/_mjit_compile_send_guard.erb +++ /dev/null @@ -1,14 +0,0 @@ -% # Copyright (c) 2018 Takashi Kokubun. All rights reserved. -% # -% # This file is a part of the programming language Ruby. Permission is hereby -% # granted, to either redistribute and/or modify this file, provided that the -% # conditions mentioned in the file COPYING are met. Consult the file for -% # details. -% -% # 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() != %"PRI_SERIALT_PREFIX"u ||\n", cc->method_state); - fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc->class_serial); - fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); - fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + 1); - fprintf(f, " goto cancel;\n"); - fprintf(f, " }\n"); |