File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -652,13 +652,6 @@ def entry = jit_frame1 # 3
652652 } , call_threshold : 2
653653 end
654654
655- # We need to support either setconstant or defineclass insns to support ConstBase's
656- # test case, like
657- #
658- # ```
659- # Foo = 1
660- # class Module::Bar; end
661- # ```
662655 def test_putspecialobject_vm_core_and_cbase
663656 assert_compiles '10' , %q{
664657 def test
@@ -671,6 +664,21 @@ def test
671664 } , insns : [ :putspecialobject ]
672665 end
673666
667+ # We need to warm up constant cache by calling test before ZJIT compilation
668+ # This makes sure that the GetConstantPath instruction is not included in the
669+ # ZJIT code by the optimization pass, which's codegen is still not implemented.
670+ def test_putspecialobject_const_base
671+ assert_compiles '1' , %q{
672+ Foo = 1
673+
674+ def test = Foo
675+
676+ # Warm up the constant cache by calling test before ZJIT compilation
677+ test
678+ test
679+ } , call_threshold : 3
680+ end
681+
674682 # tool/ruby_vm/views/*.erb relies on the zjit instructions a) being contiguous and
675683 # b) being reliably ordered after all the other instructions.
676684 def test_instruction_order
You can’t perform that action at this time.
0 commit comments