diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-14 14:00:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 17:00:10 -0400 |
commit | 4501fb8b467cd40da5e160b82db7ea1a10d9e7ca (patch) | |
tree | da36a1703c584d45de5286d8a94cb985743e5341 /yjit/src/invariants.rs | |
parent | d83e59e6b8b52002cc46a14d7d4dc69416379029 (diff) | |
download | ruby-4501fb8b467cd40da5e160b82db7ea1a10d9e7ca.tar.gz |
YJIT: Introduce Target::SideExit (#7712)
* YJIT: Introduce Target::SideExit
* YJIT: Obviate Insn::SideExitContext
* YJIT: Avoid cloning a Context for each insn
Diffstat (limited to 'yjit/src/invariants.rs')
-rw-r--r-- | yjit/src/invariants.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/yjit/src/invariants.rs b/yjit/src/invariants.rs index c93213b484..854ef6cf14 100644 --- a/yjit/src/invariants.rs +++ b/yjit/src/invariants.rs @@ -2,6 +2,7 @@ //! generated code if and when these assumptions are invalidated. use crate::asm::OutlinedCb; +use crate::backend::ir::Assembler; use crate::codegen::*; use crate::core::*; use crate::cruby::*; @@ -82,12 +83,13 @@ impl Invariants { #[must_use] pub fn assume_bop_not_redefined( jit: &mut JITState, + asm: &mut Assembler, ocb: &mut OutlinedCb, klass: RedefinitionFlag, bop: ruby_basic_operators, ) -> bool { if unsafe { BASIC_OP_UNREDEFINED_P(bop, klass) } { - jit_ensure_block_entry_exit(jit, ocb); + jit_ensure_block_entry_exit(jit, asm, ocb); jit.bop_assumptions.push((klass, bop)); return true; @@ -131,13 +133,14 @@ pub fn track_method_lookup_stability_assumption( // default behavior. pub fn assume_method_basic_definition( jit: &mut JITState, + asm: &mut Assembler, ocb: &mut OutlinedCb, klass: VALUE, mid: ID ) -> bool { if unsafe { rb_method_basic_definition_p(klass, mid) } != 0 { let cme = unsafe { rb_callable_method_entry(klass, mid) }; - jit.assume_method_lookup_stable(ocb, cme); + jit.assume_method_lookup_stable(asm, ocb, cme); true } else { false @@ -146,11 +149,11 @@ pub fn assume_method_basic_definition( /// Tracks that a block is assuming it is operating in single-ractor mode. #[must_use] -pub fn assume_single_ractor_mode(jit: &mut JITState, ocb: &mut OutlinedCb) -> bool { +pub fn assume_single_ractor_mode(jit: &mut JITState, asm: &mut Assembler, ocb: &mut OutlinedCb) -> bool { if unsafe { rb_yjit_multi_ractor_p() } { false } else { - jit_ensure_block_entry_exit(jit, ocb); + jit_ensure_block_entry_exit(jit, asm, ocb); jit.block_assumes_single_ractor = true; true @@ -524,7 +527,7 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() { cb.set_write_ptr(patch.inline_patch_pos); cb.set_dropped_bytes(false); - asm.compile(cb); + asm.compile(cb, None); last_patch_end = cb.get_write_ptr().raw_ptr(); } cb.set_pos(old_pos); |