Skip to content

Commit 0f79c70

Browse files
committed
Remove updateLocationIfMissing argument
1 parent b1848b0 commit 0f79c70

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/frame/MaterializeFrameNode.java

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,35 +84,25 @@ public final PFrame execute(boolean markAsEscaped, boolean forceSync, Frame fram
8484
PFrame.Reference info = PArguments.getCurrentFrameInfo(frameToMaterialize);
8585
assert info != null && info.getCallNode() != null : "cannot materialize a frame without location information";
8686
Node callNode = info.getCallNode();
87-
return execute(callNode, markAsEscaped, forceSync, false, frameToMaterialize);
87+
return execute(callNode, markAsEscaped, forceSync, frameToMaterialize);
8888
}
8989

9090
public final PFrame execute(Frame frame, boolean markAsEscaped) {
9191
return execute(markAsEscaped, frame);
9292
}
9393

9494
public final PFrame execute(Frame frame, Node location, boolean markAsEscaped, boolean forceSync) {
95-
return execute(frame, location, markAsEscaped, forceSync, false);
95+
return execute(location, markAsEscaped, forceSync, frame);
9696
}
9797

98-
public final PFrame execute(Frame frame, Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing) {
99-
return execute(location, markAsEscaped, forceSync, updateLocationIfMissing, frame);
100-
}
101-
102-
public final PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
103-
return execute(location, markAsEscaped, forceSync, false, frameToMaterialize);
104-
}
105-
106-
// TODO remove frame? remove location? remove updateLocationIfMissing?
107-
public abstract PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing, Frame frameToMaterialize);
98+
public abstract PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize);
10899

109100
@Specialization(guards = {
110101
"cachedFD == frameToMaterialize.getFrameDescriptor()", //
111102
"getPFrame(frameToMaterialize) == null", //
112103
"!hasGeneratorFrame(frameToMaterialize)", //
113104
"!hasCustomLocals(frameToMaterialize)"}, limit = "1")
114-
static PFrame freshPFrameCachedFD(Node location, boolean markAsEscaped, boolean forceSync,
115-
@SuppressWarnings("unused") boolean updateLocationIfMissing, Frame frameToMaterialize,
105+
static PFrame freshPFrameCachedFD(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize,
116106
@Cached(value = "frameToMaterialize.getFrameDescriptor()") FrameDescriptor cachedFD,
117107
@Shared("factory") @Cached PythonObjectFactory factory,
118108
@Shared("syncValuesNode") @Cached SyncFrameValuesNode syncValuesNode) {
@@ -122,7 +112,7 @@ static PFrame freshPFrameCachedFD(Node location, boolean markAsEscaped, boolean
122112
}
123113

124114
@Specialization(guards = {"getPFrame(frameToMaterialize) == null", "!hasGeneratorFrame(frameToMaterialize)", "!hasCustomLocals(frameToMaterialize)"}, replaces = "freshPFrameCachedFD")
125-
static PFrame freshPFrame(Node location, boolean markAsEscaped, boolean forceSync, @SuppressWarnings("unused") boolean updateLocationIfMissing, Frame frameToMaterialize,
115+
static PFrame freshPFrame(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize,
126116
@Shared("factory") @Cached PythonObjectFactory factory,
127117
@Shared("syncValuesNode") @Cached SyncFrameValuesNode syncValuesNode) {
128118
MaterializedFrame locals = createLocalsFrame(frameToMaterialize.getFrameDescriptor());
@@ -131,7 +121,7 @@ static PFrame freshPFrame(Node location, boolean markAsEscaped, boolean forceSyn
131121
}
132122

133123
@Specialization(guards = {"getPFrame(frameToMaterialize) == null", "!hasGeneratorFrame(frameToMaterialize)", "hasCustomLocals(frameToMaterialize)"})
134-
static PFrame freshPFrameCusstomLocals(Node location, boolean markAsEscaped, @SuppressWarnings("unused") boolean forceSync, @SuppressWarnings("unused") boolean updateLocationIfMissing,
124+
static PFrame freshPFrameCusstomLocals(Node location, boolean markAsEscaped, @SuppressWarnings("unused") boolean forceSync,
135125
Frame frameToMaterialize,
136126
@Shared("factory") @Cached PythonObjectFactory factory) {
137127
PFrame escapedFrame = factory.createPFrame(PArguments.getCurrentFrameInfo(frameToMaterialize), location, null);
@@ -140,8 +130,7 @@ static PFrame freshPFrameCusstomLocals(Node location, boolean markAsEscaped, @Su
140130
}
141131

142132
@Specialization(guards = {"getPFrame(frameToMaterialize) == null", "hasGeneratorFrame(frameToMaterialize)"})
143-
static PFrame freshPFrameForGenerator(Node location, @SuppressWarnings("unused") boolean markAsEscaped, @SuppressWarnings("unused") boolean forceSync,
144-
@SuppressWarnings("unused") boolean updateLocationIfMissing, Frame frameToMaterialize,
133+
static PFrame freshPFrameForGenerator(Node location, @SuppressWarnings("unused") boolean markAsEscaped, @SuppressWarnings("unused") boolean forceSync, Frame frameToMaterialize,
145134
@Shared("factory") @Cached PythonObjectFactory factory) {
146135
MaterializedFrame generatorFrame = PArguments.getGeneratorFrame(frameToMaterialize);
147136
PFrame.Reference frameRef = PArguments.getCurrentFrameInfo(frameToMaterialize);
@@ -151,7 +140,7 @@ static PFrame freshPFrameForGenerator(Node location, @SuppressWarnings("unused")
151140
}
152141

153142
@Specialization(guards = "getPFrame(frameToMaterialize) != null")
154-
static PFrame alreadyEscapedFrame(Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing, Frame frameToMaterialize,
143+
static PFrame alreadyEscapedFrame(@SuppressWarnings("unused") Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize,
155144
@Shared("syncValuesNode") @Cached SyncFrameValuesNode syncValuesNode,
156145
@Cached ConditionProfile syncProfile) {
157146
PFrame pyFrame = getPFrame(frameToMaterialize);
@@ -161,10 +150,6 @@ static PFrame alreadyEscapedFrame(Node location, boolean markAsEscaped, boolean
161150
if (markAsEscaped) {
162151
pyFrame.getRef().markAsEscaped();
163152
}
164-
if (!updateLocationIfMissing || pyFrame.getLocation() == null) {
165-
// update the location so the line number is correct
166-
pyFrame.setLocation(location);
167-
}
168153
processBytecodeFrame(frameToMaterialize, pyFrame);
169154
return pyFrame;
170155
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/ExecutionContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void exit(VirtualFrame frame, PRootNode node) {
260260
}
261261

262262
// force the frame so that it can be accessed later
263-
ensureMaterializeNode().execute(frame, node, false, true, true);
263+
ensureMaterializeNode().execute(frame, node, false, true);
264264
// if this frame escaped we must ensure that also f_back does
265265
callerInfo.markAsEscaped();
266266
info.setBackref(callerInfo);

0 commit comments

Comments
 (0)