Skip to content

Commit 1bde687

Browse files
committed
ZJIT: Parse opt_and into HIR
1 parent 2c5a2ab commit 1bde687

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
@@ -2346,6 +2346,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
23462346
YARVINSN_opt_aref |
23472347
YARVINSN_opt_empty_p |
23482348
YARVINSN_opt_succ |
2349+
YARVINSN_opt_and |
23492350
YARVINSN_opt_send_without_block => {
23502351
let cd: *const rb_call_data = get_arg(pc, 0).as_ptr();
23512352
let call_info = unsafe { rb_get_call_data_ci(cd) };
@@ -3775,6 +3776,19 @@ mod tests {
37753776
Return v4
37763777
"#]]);
37773778
}
3779+
3780+
#[test]
3781+
fn opt_and() {
3782+
eval("
3783+
def test(x, y) = x & y
3784+
");
3785+
assert_method_hir_with_opcode("test", YARVINSN_opt_and, expect![[r#"
3786+
fn test:
3787+
bb0(v0:BasicObject, v1:BasicObject, v2:BasicObject):
3788+
v5:BasicObject = SendWithoutBlock v1, :&, v2
3789+
Return v5
3790+
"#]]);
3791+
}
37783792
#[test]
37793793
fn test_branchnil() {
37803794
eval("

0 commit comments

Comments
 (0)