Skip to content

Commit cfeea68

Browse files
committed
ZJIT: Parse opt_or into HIR
1 parent 1bde687 commit cfeea68

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
@@ -2347,6 +2347,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
23472347
YARVINSN_opt_empty_p |
23482348
YARVINSN_opt_succ |
23492349
YARVINSN_opt_and |
2350+
YARVINSN_opt_or |
23502351
YARVINSN_opt_send_without_block => {
23512352
let cd: *const rb_call_data = get_arg(pc, 0).as_ptr();
23522353
let call_info = unsafe { rb_get_call_data_ci(cd) };
@@ -3789,6 +3790,19 @@ mod tests {
37893790
Return v5
37903791
"#]]);
37913792
}
3793+
3794+
#[test]
3795+
fn opt_or() {
3796+
eval("
3797+
def test(x, y) = x | y
3798+
");
3799+
assert_method_hir_with_opcode("test", YARVINSN_opt_or, expect![[r#"
3800+
fn test:
3801+
bb0(v0:BasicObject, v1:BasicObject, v2:BasicObject):
3802+
v5:BasicObject = SendWithoutBlock v1, :|, v2
3803+
Return v5
3804+
"#]]);
3805+
}
37923806
#[test]
37933807
fn test_branchnil() {
37943808
eval("

0 commit comments

Comments
 (0)