File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1565,8 +1565,8 @@ def fn(a):
15651565 def test_init_resolves_callable (self ):
15661566 """
15671567 _CHECK_AND_ALLOCATE_OBJECT should resolve __init__ to a constant,
1568- enabling the optimizer to trace into the init frame and eliminate
1569- redundant function version and arg count checks.
1568+ enabling the optimizer to propagate type information through the frame
1569+ and eliminate redundant function version and arg count checks.
15701570 """
15711571 class MyPoint :
15721572 def __init__ (self , x , y ):
Original file line number Diff line number Diff line change @@ -2721,6 +2721,11 @@ dummy_func(
27212721 }
27222722
27232723 op (_GUARD_TYPE_VERSION_LOCKED , (type_version /2 , owner -- owner )) {
2724+ // Guard that type version matches expected value. Object is assumed to be
2725+ // locked on entry. If version matches, lock is retained for subsequent
2726+ // operations. If mismatch, unlock and exit (deopt). This allows the JIT
2727+ // optimizer to eliminate this guard entirely if type version is proven,
2728+ // in which case the lock is held for the entire trace duration.
27242729 PyObject * owner_o = PyStackRef_AsPyObjectBorrow (owner );
27252730 assert (type_version != 0 );
27262731 PyTypeObject * tp = Py_TYPE (owner_o );
You can’t perform that action at this time.
0 commit comments