diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-20 02:40:41 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-20 02:40:41 +0000 |
commit | c784da17448c40e55cdd231724bfe4bf53da35a1 (patch) | |
tree | a769a02c7051c534b79f5dcc168d00fdf6a40440 /mjit.c | |
parent | 6c4fd432d0242647149906f7433a9f5025819d07 (diff) | |
download | bundler-c784da17448c40e55cdd231724bfe4bf53da35a1.tar.gz |
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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |