summaryrefslogtreecommitdiff
path: root/mjit_compile.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-03-30 22:27:01 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2020-03-30 23:16:35 -0700
commitb736ea63bd4ce4e2fc81dfa73938b39fa70f659c (patch)
tree987c83978ab5699b2013808929966ff4df9cd481 /mjit_compile.c
parente5db3da9d34f0a7595208863301c044b612adbed (diff)
Optimize exivar access on JIT-ed getivar
JIT support of dd723771c11. $ benchmark-driver -v --rbenv 'before;before --jit;after --jit' benchmark/mjit_exivar.yml --repeat-count=4 before: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) [x86_64-linux] before --jit: ruby 2.8.0dev (2020-03-30T12:32:26Z master e5db3da9d3) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-03-31T05:57:24Z mjit-exivar 128625baec) +JIT [x86_64-linux] Calculating ------------------------------------- before before --jit after --jit mjit_exivar 57.944M 53.579M 54.471M i/s - 200.000M times in 3.451588s 3.732772s 3.671687s Comparison: mjit_exivar before: 57944345.1 i/s after --jit: 54470876.7 i/s - 1.06x slower before --jit: 53579483.4 i/s - 1.08x slower
Diffstat (limited to 'mjit_compile.c')
-rw-r--r--mjit_compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index cfaa672a2d..5ac5f4cb66 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -279,6 +279,12 @@ compile_cancel_handler(FILE *f, const struct rb_iseq_constant_body *body, struct
fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
fprintf(f, " goto cancel;\n");
+ fprintf(f, "\nexivar_cancel:\n");
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_exivar_inline);\n");
+ fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_exivar_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) {