diff options
author | Alan Wu <[email protected]> | 2025-06-06 22:00:51 +0900 |
---|---|---|
committer | Alan Wu <[email protected]> | 2025-06-09 22:36:53 +0900 |
commit | ec1244cfd2f115485bffa78fc9d887c1b5c43dbe (patch) | |
tree | 5bc3c1f3acb0ab00c2676ba0268f5f05c85b7c97 /zjit/src | |
parent | 038087adf7243366cabb6db32c9034de032397f7 (diff) |
ZJIT: Parse opt_not into HIR
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
Diffstat (limited to 'zjit/src')
-rw-r--r-- | zjit/src/hir.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index d6d7cd7a12..f988b629d9 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -2379,6 +2379,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> { YARVINSN_opt_succ | YARVINSN_opt_and | YARVINSN_opt_or | + YARVINSN_opt_not | YARVINSN_opt_send_without_block => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); let call_info = unsafe { rb_get_call_data_ci(cd) }; @@ -3865,6 +3866,19 @@ mod tests { Return v5 "#]]); } + + #[test] + fn opt_not() { + eval(" + def test(x) = !x + "); + assert_method_hir_with_opcode("test", YARVINSN_opt_not, expect![[r#" + fn test: + bb0(v0:BasicObject, v1:BasicObject): + v4:BasicObject = SendWithoutBlock v1, :! + Return v4 + "#]]); + } #[test] fn test_branchnil() { eval(" |