summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 12:25:23 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 12:25:23 +0000
commit12225347198344590af4a4a55ac1f90591a21dac (patch)
treec7ef2076b6037cc5d266c39f1290a95f14a5cec9
parent04ac63fe57d3643dac0c0779d32f0b89ec9e2f15 (diff)
Share optimization cancel handlers
$ benchmark-driver benchmark.yml --rbenv='before --jit;after --jit' -v --output=all --repeat-count=12 before --jit: ruby 2.7.0dev (2019-04-14 trunk 67549) +JIT [x86_64-linux] after --jit: ruby 2.7.0dev (2019-04-14 trunk 67549) +JIT [x86_64-linux] last_commit=Share optimization cancel handlers Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 69.55360655447375 74.15329176797863 fps 73.74545038318978 79.60903046141544 75.85637357897092 82.00930075612054 77.10594124022951 82.56228187301674 78.67350527368366 83.37512204205953 79.97235230767613 83.41521927993719 81.03050342478066 84.20227901852776 81.61308297895094 84.73733526226468 82.06805141753206 85.27884867863791 82.46493179193394 85.36558922650367 83.85259832896313 85.39993587223481 84.02325292922997 85.63649355214602 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--mjit_compile.c13
-rw-r--r--tool/ruby_vm/views/_mjit_compile_ivar.erb4
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb5
3 files changed, 15 insertions, 7 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index 0db1f15..1062fd8 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -190,6 +190,19 @@ static void
compile_cancel_handler(FILE *f, const struct rb_iseq_constant_body *body, struct compile_status *status)
{
unsigned int i;
+
+ fprintf(f, "\nsend_cancel:\n");
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_send_inline);\n");
+ fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_send_cache = true;\n");
+ fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
+ fprintf(f, " goto cancel;\n");
+
+ fprintf(f, "\nivar_cancel:\n");
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_ivar_inline);\n");
+ fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_ivar_cache = true;\n");
+ fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
+ fprintf(f, " goto cancel;\n");
+
fprintf(f, "\ncancel:\n");
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel);\n");
if (status->local_stack_p) {
diff --git a/tool/ruby_vm/views/_mjit_compile_ivar.erb b/tool/ruby_vm/views/_mjit_compile_ivar.erb
index eef3d7e..cf00269 100644
--- a/tool/ruby_vm/views/_mjit_compile_ivar.erb
+++ b/tool/ruby_vm/views/_mjit_compile_ivar.erb
@@ -43,9 +43,7 @@
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_ivar);\n");
- fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_ivar_cache = true;\n");
- fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
- fprintf(f, " goto cancel;\n");
+ fprintf(f, " goto ivar_cancel;\n");
fprintf(f, " }\n");
% # compiler: Move JIT compiler's internal stack pointer
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 90b9a07..e2d24bd 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -38,10 +38,7 @@
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
- fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_send_inline);\n");
- fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_send_cache = true;\n");
- fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
- fprintf(f, " goto cancel;\n");
+ fprintf(f, " goto send_cancel;\n");
fprintf(f, " }\n");
% # JIT: move sp and pc if necessary