@@ -142,9 +142,10 @@ static PFrame incompleteFrame(VirtualFrame frame, Node location, boolean markAsE
142
142
143
143
@ Specialization (guards = {"getPFrame(frameToMaterialize) != null" , "getPFrame(frameToMaterialize).hasFrame()" }, replaces = "freshPFrame" )
144
144
static PFrame alreadyEscapedFrame (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
145
- @ Shared ("syncValuesNode" ) @ Cached SyncFrameValuesNode syncValuesNode ) {
145
+ @ Shared ("syncValuesNode" ) @ Cached SyncFrameValuesNode syncValuesNode ,
146
+ @ Cached ("createBinaryProfile()" ) ConditionProfile syncProfile ) {
146
147
PFrame pyFrame = getPFrame (frameToMaterialize );
147
- if (forceSync && !inClassBody (frameToMaterialize ) && !inModuleRoot (location )) {
148
+ if (syncProfile . profile ( forceSync && !inClassBody (frameToMaterialize ) && !inModuleRoot (location ) )) {
148
149
syncValuesNode .execute (frame , pyFrame , frameToMaterialize );
149
150
}
150
151
if (markAsEscaped ) {
@@ -158,9 +159,10 @@ static PFrame alreadyEscapedFrame(VirtualFrame frame, Node location, boolean mar
158
159
@ Specialization (replaces = {"freshPFrame" , "alreadyEscapedFrame" })
159
160
static PFrame notInClassBody (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
160
161
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ,
161
- @ Shared ("syncValuesNode" ) @ Cached SyncFrameValuesNode syncValuesNode ) {
162
+ @ Shared ("syncValuesNode" ) @ Cached SyncFrameValuesNode syncValuesNode ,
163
+ @ Cached ("createBinaryProfile()" ) ConditionProfile syncProfile ) {
162
164
if (getPFrame (frameToMaterialize ) != null ) {
163
- return alreadyEscapedFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , syncValuesNode );
165
+ return alreadyEscapedFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , syncValuesNode , syncProfile );
164
166
} else {
165
167
if (inClassBody (frameToMaterialize )) {
166
168
return freshPFrameInClassBody (frame , location , markAsEscaped , forceSync , frameToMaterialize , factory , syncValuesNode );
0 commit comments