aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-03-10 00:19:19 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2020-03-10 00:53:35 -0700
commit4bcd5981e80d3e1852c8723741a0069779464128 (patch)
treebf513a58b4e8f0aef99d4549538407382fa8d263 /mjit.c
parent4015f27a4d032c163411e0fa0caa3a1507769040 (diff)
downloadruby-4bcd5981e80d3e1852c8723741a0069779464128.tar.gz
Capture inlined iseq's cc entries in root iseq's
jit_unit to avoid marking wrong cc entries when inlined iseq is compiled multiple times, resolving the TODO added by daf7c48d88. This obviates pseudo jit_unit in inlined iseq introduced by 7ec2359374 and fixes memory leak of the adhoc unit.
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/mjit.c b/mjit.c
index a5461414d3..514d04f085 100644
--- a/mjit.c
+++ b/mjit.c
@@ -26,7 +26,6 @@
#include "internal/warnings.h"
#include "mjit_worker.c"
-#include "vm_callinfo.h"
// Copy ISeq's states so that race condition does not happen on compilation.
static void
@@ -53,18 +52,6 @@ mjit_copy_job_handler(void *data)
}
const struct rb_iseq_constant_body *body = job->iseq->body;
- const unsigned int ci_size = body->ci_size;
- if (ci_size > 0) {
- VM_ASSERT(body->jit_unit != NULL);
- VM_ASSERT(body->jit_unit->cc_entries != NULL);
-
- const struct rb_callcache **cc_entries = body->jit_unit->cc_entries;
-
- for (unsigned int i=0; i<ci_size; i++) {
- cc_entries[i] = body->call_data[i].cc;
- }
- }
-
if (job->is_entries) {
memcpy(job->is_entries, body->is_entries, sizeof(union iseq_inline_storage_entry) * body->is_size);
}
@@ -293,9 +280,6 @@ create_unit(const rb_iseq_t *iseq)
unit->id = current_unit_num++;
unit->iseq = (rb_iseq_t *)iseq;
- if (iseq->body->ci_size > 0) {
- unit->cc_entries = ZALLOC_N(const struct rb_callcache *, iseq->body->ci_size);
- }
iseq->body->jit_unit = unit;
}