summaryrefslogtreecommitdiff
path: root/zjit/src
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2025-06-06 22:00:17 +0900
committerAlan Wu <[email protected]>2025-06-09 22:36:53 +0900
commit1c43f7e9668b841f8976b32c60c3ce6b2aeffc23 (patch)
tree9e6d078dac6e08c0f70017c224e00762d800a615 /zjit/src
parent4a2480e79a6c1932a06d56035a8e2eb0ba5defca (diff)
ZJIT: Parse opt_and into HIR
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13549
Diffstat (limited to 'zjit/src')
-rw-r--r--zjit/src/hir.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index afdbcea0ab..2c32c83aa6 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -2377,6 +2377,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
YARVINSN_opt_aref |
YARVINSN_opt_empty_p |
YARVINSN_opt_succ |
+ YARVINSN_opt_and |
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) };
@@ -3837,6 +3838,19 @@ mod tests {
Return v4
"#]]);
}
+
+ #[test]
+ fn opt_and() {
+ eval("
+ def test(x, y) = x & y
+ ");
+ assert_method_hir_with_opcode("test", YARVINSN_opt_and, expect![[r#"
+ fn test:
+ bb0(v0:BasicObject, v1:BasicObject, v2:BasicObject):
+ v5:BasicObject = SendWithoutBlock v1, :&, v2
+ Return v5
+ "#]]);
+ }
#[test]
fn test_branchnil() {
eval("