@@ -1622,9 +1622,8 @@ def testfunc(n):
16221622 self .assertEqual (uops .count ("_PUSH_FRAME" ), 2 )
16231623 # Type version propagation: one guard covers both method lookups
16241624 self .assertEqual (uops .count ("_GUARD_TYPE_VERSION" ), 1 )
1625- # Function checks eliminated (type info resolves the callable)
1626- self .assertNotIn ("_CHECK_FUNCTION_VERSION" , uops )
1627- self .assertNotIn ("_CHECK_FUNCTION_EXACT_ARGS" , uops )
1625+ # Function checks cannot be eliminated for safety reasons.
1626+ self .assertIn ("_CHECK_FUNCTION_VERSION" , uops )
16281627
16291628 def test_method_chain_guard_elimination (self ):
16301629 """
@@ -1669,10 +1668,7 @@ def testfunc(n):
16691668 self .assertIsNotNone (ex )
16701669 uops = get_opnames (ex )
16711670 self .assertIn ("_PUSH_FRAME" , uops )
1672- # Both should be not present, as this is a call
1673- # to a simple function with a known function version.
1674- self .assertNotIn ("_CHECK_FUNCTION_VERSION_INLINE" , uops )
1675- self .assertNotIn ("_CHECK_FUNCTION_VERSION" , uops )
1671+ self .assertIn ("_CHECK_FUNCTION_VERSION" , uops )
16761672 # Removed guard
16771673 self .assertNotIn ("_CHECK_FUNCTION_EXACT_ARGS" , uops )
16781674
@@ -5178,28 +5174,6 @@ def g():
51785174 PYTHON_JIT = "1" , PYTHON_JIT_STRESS = "1" )
51795175 self .assertEqual (result [0 ].rc , 0 , result )
51805176
5181- def test_func_version_watched_and_invalidated (self ):
5182- def testfunc (n ):
5183- for i in range (n ):
5184- # Only works on functions promoted to constants
5185- global_identity_code_will_be_modified (i )
5186-
5187- testfunc (TIER2_THRESHOLD )
5188-
5189- ex = get_first_executor (testfunc )
5190- self .assertIsNotNone (ex )
5191- uops = get_opnames (ex )
5192- self .assertIn ("_PUSH_FRAME" , uops )
5193- # Both should be not present, as this is a call
5194- # to a simple function with a known function version.
5195- self .assertNotIn ("_CHECK_FUNCTION_VERSION_INLINE" , uops )
5196- self .assertNotIn ("_CHECK_FUNCTION_VERSION" , uops )
5197-
5198- global_identity_code_will_be_modified .__code__ = (lambda a :a ).__code__
5199- ex = get_first_executor (testfunc )
5200- # Invalidated and removed.
5201- self .assertIsNone (ex )
5202-
52035177 def test_call_super (self ):
52045178 class A :
52055179 def method1 (self ):
0 commit comments