4747import com .oracle .graal .python .nodes .PRootNode ;
4848import com .oracle .graal .python .nodes .bytecode .BytecodeFrameInfo ;
4949import com .oracle .graal .python .nodes .bytecode .FrameInfo ;
50- import com .oracle .graal .python .nodes .bytecode_dsl .BytecodeDSLFrameInfo ;
5150import com .oracle .graal .python .nodes .bytecode_dsl .PBytecodeDSLRootNode ;
5251import com .oracle .graal .python .runtime .PythonOptions ;
5352import com .oracle .graal .python .runtime .object .PFactory ;
@@ -195,7 +194,7 @@ static PFrame alreadyEscapedFrame(@SuppressWarnings("unused") Node location, boo
195194 @ Cached InlinedConditionProfile syncProfile ) {
196195 PFrame pyFrame = getPFrame (frameToMaterialize );
197196 if (syncProfile .profile (inliningTarget , forceSync && !PGenerator .isGeneratorFrame (frameToMaterialize ))) {
198- syncValuesNode .execute (pyFrame , frameToMaterialize );
197+ syncValuesNode .execute (pyFrame , frameToMaterialize , location );
199198 }
200199 if (markAsEscaped ) {
201200 pyFrame .getRef ().markAsEscaped ();
@@ -248,7 +247,7 @@ private static PFrame doEscapeFrame(Frame frameToMaterialize, PFrame escapedFram
248247 // on a freshly created PFrame, we do always sync the arguments
249248 PArguments .synchronizeArgs (frameToMaterialize , escapedFrame );
250249 if (forceSync ) {
251- syncValuesNode .execute (escapedFrame , frameToMaterialize );
250+ syncValuesNode .execute (escapedFrame , frameToMaterialize , location );
252251 }
253252 if (markAsEscaped ) {
254253 topFrameRef .markAsEscaped ();
@@ -275,10 +274,10 @@ protected static PFrame getPFrame(Frame frame) {
275274 @ GenerateUncached
276275 public abstract static class SyncFrameValuesNode extends Node {
277276
278- public abstract void execute (PFrame pyFrame , Frame frameToSync );
277+ public abstract void execute (PFrame pyFrame , Frame frameToSync , Node location );
279278
280279 @ Specialization (guards = "!pyFrame.hasCustomLocals()" )
281- static void doSync (PFrame pyFrame , Frame frameToSync ,
280+ static void doSync (PFrame pyFrame , Frame frameToSync , Node location ,
282281 @ Bind Node inliningTarget ,
283282 @ Cached (inline = false ) ValueProfile frameDescriptorProfile ,
284283 @ Cached InlinedIntValueProfile slotCountProfile ) {
@@ -288,10 +287,10 @@ static void doSync(PFrame pyFrame, Frame frameToSync,
288287 int slotCount = slotCountProfile .profile (inliningTarget , variableSlotCount (cachedFd ));
289288
290289 if (PythonOptions .ENABLE_BYTECODE_DSL_INTERPRETER ) {
291- FrameInfo info = ( FrameInfo ) cachedFd . getInfo ( );
292- if ( info instanceof BytecodeDSLFrameInfo bytecodeDSLFrameInfo ) {
293- PBytecodeDSLRootNode rootNode = bytecodeDSLFrameInfo . getRootNode ();
294- rootNode . getBytecodeNode () .copyLocalValues (0 , frameToSync , target , 0 , slotCount );
290+ CompilerAsserts . partialEvaluationConstant ( location );
291+ BytecodeNode bytecodeNode = BytecodeNode . get ( location );
292+ if ( bytecodeNode != null ) {
293+ bytecodeNode .copyLocalValues (0 , frameToSync , target , 0 , slotCount );
295294 }
296295 } else {
297296 frameToSync .copyTo (0 , target , 0 , slotCount );
@@ -300,7 +299,7 @@ static void doSync(PFrame pyFrame, Frame frameToSync,
300299
301300 @ Specialization (guards = "pyFrame.hasCustomLocals()" )
302301 @ SuppressWarnings ("unused" )
303- static void doCustomLocals (PFrame pyFrame , Frame frameToSync ) {
302+ static void doCustomLocals (PFrame pyFrame , Frame frameToSync , Node location ) {
304303 // nothing to do
305304 }
306305
0 commit comments