summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 13:29:44 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 13:29:44 +0000
commit2751b5366dd506bdb77a1f1a03b9c108f64eddba (patch)
tree550b93f0f9482d2325e5f17ec15f3b01ef9c3a68 /mjit_worker.c
parent69c59f4fd07c41b478d33ff92fb95b8fd0046dc1 (diff)
mjit.c: avoid running copy job handler after ISeq GC
like this http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1471633 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index b23d18d..4b70c0b 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1121,7 +1121,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit, struct rb_call_cache *cc_entries
}
struct mjit_copy_job {
- const struct rb_iseq_constant_body *body;
+ struct rb_mjit_unit *unit;
struct rb_call_cache *cc_entries;
union iseq_inline_storage_entry *is_entries;
int finish_p;
@@ -1197,14 +1197,15 @@ mjit_worker(void)
if (unit) {
mjit_func_t func;
+ const struct rb_iseq_constant_body *body = unit->iseq->body;
- job.body = unit->iseq->body;
+ job.unit = unit;
job.cc_entries = NULL;
- if (job.body->ci_size > 0 || job.body->ci_kw_size > 0)
- job.cc_entries = alloca(sizeof(struct rb_call_cache) * (job.body->ci_size + job.body->ci_kw_size));
+ if (body->ci_size > 0 || body->ci_kw_size > 0)
+ job.cc_entries = alloca(sizeof(struct rb_call_cache) * (body->ci_size + body->ci_kw_size));
job.is_entries = NULL;
- if (job.body->is_size > 0)
- job.is_entries = alloca(sizeof(union iseq_inline_storage_entry) * job.body->is_size);
+ if (body->is_size > 0)
+ job.is_entries = alloca(sizeof(union iseq_inline_storage_entry) * body->is_size);
/* Copy ISeq's inline caches values to avoid race condition. */
if (job.cc_entries != NULL || job.is_entries != NULL) {