Skip to content

Commit d7369f0

Browse files
rwstaunerXrXr
authored andcommitted
ZJIT: Add individual tests for complex arg pass counters
Make it easier to see what happens when one is changed.
1 parent 6fabca8 commit d7369f0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

zjit/src/hir/opt_tests.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,56 @@ mod hir_opt_tests {
28402840
");
28412841
}
28422842

2843+
#[test]
2844+
fn dont_specialize_call_to_iseq_with_param_kw() {
2845+
eval("
2846+
def foo(int: 1) = int + 1
2847+
def test = foo
2848+
test
2849+
test
2850+
");
2851+
assert_snapshot!(hir_string("test"), @r"
2852+
fn test@<compiled>:3:
2853+
bb0():
2854+
EntryPoint interpreter
2855+
v1:BasicObject = LoadSelf
2856+
Jump bb2(v1)
2857+
bb1(v4:BasicObject):
2858+
EntryPoint JIT(0)
2859+
Jump bb2(v4)
2860+
bb2(v6:BasicObject):
2861+
IncrCounter complex_arg_pass_param_kw
2862+
v11:BasicObject = SendWithoutBlock v6, :foo
2863+
CheckInterrupts
2864+
Return v11
2865+
");
2866+
}
2867+
2868+
#[test]
2869+
fn dont_specialize_call_to_iseq_with_param_kwrest() {
2870+
eval("
2871+
def foo(**kwargs) = kwargs.keys
2872+
def test = foo
2873+
test
2874+
test
2875+
");
2876+
assert_snapshot!(hir_string("test"), @r"
2877+
fn test@<compiled>:3:
2878+
bb0():
2879+
EntryPoint interpreter
2880+
v1:BasicObject = LoadSelf
2881+
Jump bb2(v1)
2882+
bb1(v4:BasicObject):
2883+
EntryPoint JIT(0)
2884+
Jump bb2(v4)
2885+
bb2(v6:BasicObject):
2886+
IncrCounter complex_arg_pass_param_kwrest
2887+
v11:BasicObject = SendWithoutBlock v6, :foo
2888+
CheckInterrupts
2889+
Return v11
2890+
");
2891+
}
2892+
28432893
#[test]
28442894
fn dont_replace_get_constant_path_with_empty_ic() {
28452895
eval("

0 commit comments

Comments
 (0)