summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 02:40:41 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 02:40:41 +0000
commitc784da17448c40e55cdd231724bfe4bf53da35a1 (patch)
treea769a02c7051c534b79f5dcc168d00fdf6a40440 /mjit.c
parent6c4fd432d0242647149906f7433a9f5025819d07 (diff)
Update MJIT references
ISeq can move, so we need to tell MJIT where the new location is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mjit.c b/mjit.c
index bd5dd46b19..3eb2ee8a50 100644
--- a/mjit.c
+++ b/mjit.c
@@ -110,6 +110,19 @@ mjit_gc_finish_hook(void)
CRITICAL_SECTION_FINISH(4, "mjit_gc_finish_hook");
}
+// Deal with ISeq movement from compactor
+void
+mjit_update_references(const rb_iseq_t *iseq)
+{
+ if (!mjit_enabled)
+ return;
+ CRITICAL_SECTION_START(4, "mjit_free_iseq");
+ if (iseq->body->jit_unit) {
+ iseq->body->jit_unit->iseq = (rb_iseq_t *)rb_gc_new_location(iseq->body->jit_unit->iseq);
+ }
+ CRITICAL_SECTION_FINISH(4, "mjit_free_iseq");
+}
+
// Iseqs can be garbage collected. This function should call when it
// happens. It removes iseq from the unit.
void