summaryrefslogtreecommitdiff
path: root/yjit_core.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-03-23 15:19:48 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-03-24 10:03:51 -0400
commit5f10bd634fb6ae8f74a4ea730176233b0ca96954 (patch)
tree170c1c81ea63184290c9e021cc45bffbfc3f4f41 /yjit_core.c
parent04591e1be7618f64bd3bed8c53c0fcde5fcbddb8 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5698
Diffstat (limited to 'yjit_core.c')
-rw-r--r--yjit_core.c10
1 files changed, 5 insertions, 5 deletions
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