diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2021-09-21 16:09:16 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:41 -0400 |
commit | f1eb48cb23c949ce8163c6b6d2042cecd0d79ea9 (patch) | |
tree | 7b15b82badaf93910f55d75af0fcc4eb7d64a05b /yjit_core.c | |
parent | c55d4cafc241706d1255d8609d3d7c6f04d0706a (diff) |
Step 2 to remove the global cb/ocb objects.
Diffstat (limited to 'yjit_core.c')
-rw-r--r-- | yjit_core.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/yjit_core.c b/yjit_core.c index 6c2e1b0ae0..8090cdd80a 100644 --- a/yjit_core.c +++ b/yjit_core.c @@ -871,7 +871,7 @@ uint8_t* get_branch_target( } void gen_branch( - block_t* block, + jitstate_t* jit, const ctx_t* src_ctx, blockid_t target0, const ctx_t* ctx0, @@ -882,7 +882,7 @@ void gen_branch( { RUBY_ASSERT(target0.iseq != NULL); - branch_t* branch = make_branch_entry(block, src_ctx, gen_fn); + branch_t* branch = make_branch_entry(jit->block, src_ctx, gen_fn); branch->targets[0] = target0; branch->targets[1] = target1; branch->target_ctxs[0] = *ctx0; @@ -917,14 +917,14 @@ gen_jump_branch(codeblock_t* cb, uint8_t* target0, uint8_t* target1, uint8_t sha } void gen_direct_jump( - block_t* block, + jitstate_t* jit, const ctx_t* ctx, blockid_t target0 ) { RUBY_ASSERT(target0.iseq != NULL); - branch_t* branch = make_branch_entry(block, ctx, gen_jump_branch); + branch_t* branch = make_branch_entry(jit->block, ctx, gen_jump_branch); branch->targets[0] = target0; branch->target_ctxs[0] = *ctx; @@ -955,8 +955,7 @@ void gen_direct_jump( // Create a stub to force the code up to this point to be executed void defer_compilation( - block_t* block, - uint32_t insn_idx, + jitstate_t* jit, ctx_t* cur_ctx ) { @@ -974,14 +973,15 @@ void defer_compilation( next_ctx.chain_depth += 1; - branch_t* branch = make_branch_entry(block, cur_ctx, gen_jump_branch); + branch_t* branch = make_branch_entry(jit->block, cur_ctx, gen_jump_branch); // Get the branch targets or stubs branch->target_ctxs[0] = next_ctx; - branch->targets[0] = (blockid_t){ block->blockid.iseq, insn_idx }; + branch->targets[0] = (blockid_t){ jit->block->blockid.iseq, jit->insn_idx }; branch->dst_addrs[0] = get_branch_target(branch->targets[0], &next_ctx, branch, 0); // Call the branch generation function + codeblock_t* cb = jit->cb; branch->start_pos = cb->write_pos; gen_jump_branch(cb, branch->dst_addrs[0], NULL, SHAPE_DEFAULT); branch->end_pos = cb->write_pos; |