From 818d6d33368a396d9cd3d1a34a84015a9e76c5c8 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 30 Apr 2020 23:58:50 -0700 Subject: Deduplicate functions in compacted JIT code to improve code locality. Using benchmark-driver/sinatra with 100 methods JIT-ed, [Before] 12149.97 rps 1.3M /tmp/_ruby_mjit_p31171u145.so [After] 12818.83 rps 260K /tmp/_ruby_mjit_p32155u145.so (VM is 13714.89 rps) --- mjit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 59e58f3f70..2c2af0a2a6 100644 --- a/mjit.c +++ b/mjit.c @@ -191,7 +191,7 @@ free_list(struct rb_mjit_unit_list *list, bool close_handle_p) if (unit->handle && dlclose(unit->handle)) { mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror()); } - clean_object_files(unit); + clean_temp_files(unit); free(unit); } else { @@ -889,7 +889,7 @@ skip_cleaning_object_files(struct rb_mjit_unit_list *list) // No mutex for list, assuming MJIT worker does not exist yet since it's immediately after fork. list_for_each_safe(&list->head, unit, next, unode) { #ifndef _MSC_VER // Actually mswin does not reach here since it doesn't have fork - if (unit->o_file) unit->o_file_inherited_p = true; + if (unit->c_file) unit->c_file_inherited_p = true; #endif #if defined(_WIN32) // mswin doesn't reach here either. This is for MinGW. -- cgit v1.2.3