Skip to content

Commit 560c86f

Browse files
committed
ZJIT: Parse opt_not into HIR
1 parent cfeea68 commit 560c86f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

zjit/src/hir.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
23482348
YARVINSN_opt_succ |
23492349
YARVINSN_opt_and |
23502350
YARVINSN_opt_or |
2351+
YARVINSN_opt_not |
23512352
YARVINSN_opt_send_without_block => {
23522353
let cd: *const rb_call_data = get_arg(pc, 0).as_ptr();
23532354
let call_info = unsafe { rb_get_call_data_ci(cd) };
@@ -3803,6 +3804,19 @@ mod tests {
38033804
Return v5
38043805
"#]]);
38053806
}
3807+
3808+
#[test]
3809+
fn opt_not() {
3810+
eval("
3811+
def test(x) = !x
3812+
");
3813+
assert_method_hir_with_opcode("test", YARVINSN_opt_not, expect![[r#"
3814+
fn test:
3815+
bb0(v0:BasicObject, v1:BasicObject):
3816+
v4:BasicObject = SendWithoutBlock v1, :!
3817+
Return v4
3818+
"#]]);
3819+
}
38063820
#[test]
38073821
fn test_branchnil() {
38083822
eval("

0 commit comments

Comments
 (0)