Skip to content

Commit d6a258a

Browse files
committed
ZJIT: Parse opt_regexpmatch2 into HIR
1 parent 560c86f commit d6a258a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

zjit/src/hir.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,6 +2349,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
23492349
YARVINSN_opt_and |
23502350
YARVINSN_opt_or |
23512351
YARVINSN_opt_not |
2352+
YARVINSN_opt_regexpmatch2 |
23522353
YARVINSN_opt_send_without_block => {
23532354
let cd: *const rb_call_data = get_arg(pc, 0).as_ptr();
23542355
let call_info = unsafe { rb_get_call_data_ci(cd) };
@@ -3817,6 +3818,20 @@ mod tests {
38173818
Return v4
38183819
"#]]);
38193820
}
3821+
3822+
#[test]
3823+
fn opt_regexpmatch2() {
3824+
eval("
3825+
def test(regexp, matchee) = regexp =~ matchee
3826+
");
3827+
assert_method_hir_with_opcode("test", YARVINSN_opt_regexpmatch2, expect![[r#"
3828+
fn test:
3829+
bb0(v0:BasicObject, v1:BasicObject, v2:BasicObject):
3830+
v5:BasicObject = SendWithoutBlock v1, :=~, v2
3831+
Return v5
3832+
"#]]);
3833+
}
3834+
38203835
#[test]
38213836
fn test_branchnil() {
38223837
eval("

0 commit comments

Comments
 (0)