From 5f10bd634fb6ae8f74a4ea730176233b0ca96954 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 23 Mar 2022 15:19:48 -0400 Subject: Add ISEQ_BODY macro Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using this macro will make it easier for us to change the allocation strategy of rb_iseq_constant_body when using Variable Width Allocation. --- yjit_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'yjit_core.c') diff --git a/yjit_core.c b/yjit_core.c index b70abcafb2..eee2c52d7f 100644 --- a/yjit_core.c +++ b/yjit_core.c @@ -524,7 +524,7 @@ ctx_diff(const ctx_t *src, const ctx_t *dst) static rb_yjit_block_array_t yjit_get_version_array(const rb_iseq_t *iseq, unsigned idx) { - struct rb_iseq_constant_body *body = iseq->body; + struct rb_iseq_constant_body *body = ISEQ_BODY(iseq); if (rb_darray_size(body->yjit_blocks) == 0) { return NULL; @@ -546,7 +546,7 @@ add_block_version(block_t *block) { const blockid_t blockid = block->blockid; const rb_iseq_t *iseq = blockid.iseq; - struct rb_iseq_constant_body *body = iseq->body; + struct rb_iseq_constant_body *body = ISEQ_BODY(iseq); // Function entry blocks must have stack size 0 RUBY_ASSERT(!(block->blockid.idx == 0 && block->ctx.stack_size > 0)); @@ -834,7 +834,7 @@ gen_entry_point(const rb_iseq_t *iseq, uint32_t insn_idx, rb_execution_context_t { // If we aren't at PC 0, don't generate code // See yjit_pc_guard - if (iseq->body->iseq_encoded != ec->cfp->pc) { + if (ISEQ_BODY(iseq)->iseq_encoded != ec->cfp->pc) { return NULL; } @@ -1219,7 +1219,7 @@ verify_blockid(const blockid_t blockid) { const rb_iseq_t *const iseq = blockid.iseq; RUBY_ASSERT_ALWAYS(IMEMO_TYPE_P(iseq, imemo_iseq)); - RUBY_ASSERT_ALWAYS(blockid.idx < iseq->body->iseq_size); + RUBY_ASSERT_ALWAYS(blockid.idx < ISEQ_BODY(iseq)->iseq_size); } // Invalidate one specific block version @@ -1336,7 +1336,7 @@ invalidate_block_version(block_t *block) // change this in the future when we support optional parameters because // they enter the function with a non-zero PC if (block->blockid.idx == 0) { - iseq->body->jit_func = 0; + ISEQ_BODY(iseq)->jit_func = 0; } #endif -- cgit v1.2.3