From 53babf35ef5b643774636550ea23851e2607e076 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 16 Dec 2020 06:24:07 -0800 Subject: Inline getconstant on JIT (#3906) * Inline getconstant on JIT * Support USE_MJIT=0 --- mjit.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 2b6ceba2d3..65284172e7 100644 --- a/mjit.c +++ b/mjit.c @@ -82,6 +82,24 @@ mjit_gc_exit_hook(void) CRITICAL_SECTION_FINISH(4, "mjit_gc_exit_hook"); } +// Lock setinlinecache +void +rb_mjit_before_vm_ic_update(void) +{ + if (!mjit_enabled) + return; + CRITICAL_SECTION_START(3, "before vm_ic_update"); +} + +// Unlock setinlinecache +void +rb_mjit_after_vm_ic_update(void) +{ + if (!mjit_enabled) + return; + CRITICAL_SECTION_FINISH(3, "after vm_ic_update"); +} + // Deal with ISeq movement from compactor void mjit_update_references(const rb_iseq_t *iseq) @@ -378,6 +396,14 @@ rb_mjit_recompile_inlining(const rb_iseq_t *iseq) mjit_recompile(iseq); } +// Recompile iseq, disabling getconstant inlining +void +rb_mjit_recompile_const(const rb_iseq_t *iseq) +{ + rb_mjit_iseq_compile_info(iseq->body)->disable_const_cache = true; + mjit_recompile(iseq); +} + extern VALUE ruby_archlibdir_path, ruby_prefix_path; // Initialize header_file, pch_file, libruby_pathflag. Return true on success. -- cgit v1.2.3