From 13df05acfa02aeccac89e93f8789933b23004113 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 21 Oct 2018 14:23:24 +0000 Subject: mjit.c: copy call cache values to MJIT worker same as r65275 but for call cache. === Optcarrot Benchmark === $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-21 trunk 65277) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-21 trunk 65277) +JIT [x86_64-linux] last_commit=mjit.c: copy call cache values to MJIT worker Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.372 85.359 fps Comparison: Optcarrot Lan_Master.nes before: 85.4 fps after: 85.4 fps - 1.00x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit_compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mjit_compile.c') diff --git a/mjit_compile.c b/mjit_compile.c index 7cf3a47267..07e417e75b 100644 --- a/mjit_compile.c +++ b/mjit_compile.c @@ -34,8 +34,9 @@ struct compile_status { /* If TRUE, JIT-ed code will use local variables to store pushed values instead of using VM's stack and moving stack pointer. */ int local_stack_p; - /* Safely-accessible is_entries copied from main thread. */ + /* Safely-accessible cache entries copied from main thread. */ union iseq_inline_storage_entry *is_entries; + struct rb_call_cache *cc_entries; }; /* Storage to keep data which is consistent in each conditional branch. @@ -197,7 +198,7 @@ compile_cancel_handler(FILE *f, const struct rb_iseq_constant_body *body, struct /* Compile ISeq to C code in F. It returns 1 if it succeeds to compile. */ int -mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *funcname, union iseq_inline_storage_entry *is_entries) +mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *funcname, struct rb_call_cache *cc_entries, union iseq_inline_storage_entry *is_entries) { struct compile_status status; status.success = TRUE; @@ -206,6 +207,7 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func if (status.stack_size_for_pos == NULL) return FALSE; memset(status.stack_size_for_pos, NOT_COMPILED_STACK_SIZE, sizeof(int) * body->iseq_size); + status.cc_entries = cc_entries; status.is_entries = is_entries; /* For performance, we verify stack size only on compilation time (mjit_compile.inc.erb) without --jit-debug */ -- cgit v1.2.3