diff options
author | Takashi Kokubun <[email protected]> | 2025-03-07 12:55:47 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:59 +0900 |
commit | 33a052486baa54ab858bd0a06033e90a3c66d2ac (patch) | |
tree | d2f0602755e3e1df114be2c882dc4071128d362d /zjit/src/state.rs | |
parent | d2115562b92e70bea71cfaca175f59587c6a77da (diff) |
Assert everything is compiled in test_zjit (https://github.com/Shopify/zjit/pull/40)
* Assert everything is compiled in test_zjit
* Update a comment on rb_zjit_assert_compiles
Co-authored-by: Maxime Chevalier-Boisvert <[email protected]>
* Add a comment about assert_compiles
* Actually use pipe_fd
---------
Co-authored-by: Maxime Chevalier-Boisvert <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'zjit/src/state.rs')
-rw-r--r-- | zjit/src/state.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/zjit/src/state.rs b/zjit/src/state.rs index 92efc3a48e..c176d58b20 100644 --- a/zjit/src/state.rs +++ b/zjit/src/state.rs @@ -12,6 +12,9 @@ pub struct ZJITState { /// Assumptions that require invalidation invariants: Invariants, + + /// Assert successful compilation if set to true + assert_compiles: bool, } /// Private singleton instance of the codegen globals @@ -64,6 +67,7 @@ impl ZJITState { code_block: cb, options, invariants: Invariants::default(), + assert_compiles: false, }; unsafe { ZJIT_STATE = Some(zjit_state); } } @@ -92,4 +96,15 @@ impl ZJITState { pub fn get_invariants() -> &'static mut Invariants { &mut ZJITState::get_instance().invariants } + + /// Return true if successful compilation should be asserted + pub fn assert_compiles_enabled() -> bool { + ZJITState::get_instance().assert_compiles + } + + /// Start asserting successful compilation + pub fn enable_assert_compiles() { + let instance = ZJITState::get_instance(); + instance.assert_compiles = true; + } } |