Skip to content

Commit b1848b0

Browse files
committed
Remove virtual frame argument from MaterializeFrameNode
1 parent 20660bc commit b1848b0

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public ExecutableNode parse(InlineParsingRequest request) {
596596
public Object execute(VirtualFrame frame) {
597597
Object[] arguments = PArguments.create();
598598
// escape?
599-
PFrame pFrame = materializeFrameNode.execute(frame, this, false, true, frame);
599+
PFrame pFrame = materializeFrameNode.execute(this, false, true, frame);
600600
Object locals = getFrameLocalsNode.execute(frame, pFrame);
601601
PArguments.setSpecialArgument(arguments, locals);
602602
PArguments.setGlobals(arguments, PArguments.getGlobals(frame));

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ PFrame counted(VirtualFrame frame, int num,
832832
private static PFrame escapeFrame(VirtualFrame frame, int num, ReadCallerFrameNode readCallerNode) {
833833
Reference currentFrameInfo = PArguments.getCurrentFrameInfo(frame);
834834
currentFrameInfo.markAsEscaped();
835-
return readCallerNode.executeWith(frame, currentFrameInfo, num);
835+
return readCallerNode.executeWith(currentFrameInfo, num);
836836
}
837837

838838
private PException raiseCallStackDepth() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame/FrameBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Object getUpdating(VirtualFrame frame, PFrame self,
229229
// frame. If 'self' represents another frame on the stack, the values are already
230230
// refreshed.
231231
if (profile.profile(frame != null && PArguments.getCurrentFrameInfo(frame) == self.getRef())) {
232-
PFrame pyFrame = materializeNode.execute(frame, false, true, frame);
232+
PFrame pyFrame = materializeNode.execute(false, true, frame);
233233
assert pyFrame == self;
234234
}
235235
return getFrameLocalsNode.execute(frame, self);
@@ -259,7 +259,7 @@ Object getBackref(VirtualFrame frame, PFrame self,
259259
// a) self is still on the stack and the caller isn't filled in
260260
// b) this frame has returned, but not (yet) to a Python caller
261261
// c) this frame has no caller (it is/was a top frame)
262-
callerFrame = readCallerFrame.executeWith(frame, cur.getRef(), FrameSelector.ALL_PYTHON_FRAMES, 0);
262+
callerFrame = readCallerFrame.executeWith(cur.getRef(), FrameSelector.ALL_PYTHON_FRAMES, 0);
263263

264264
// We don't need to mark the caller frame as 'escaped' because if 'self' is
265265
// escaped, the caller frame will be escaped when leaving the current function.

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/traceback/TracebackBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private static PFrame materializeFrame(TruffleStackTraceElement element, Materia
147147
location = rootNode;
148148
}
149149
// create the PFrame and refresh frame values
150-
return materializeFrameNode.execute(null, location, false, true, element.getFrame());
150+
return materializeFrameNode.execute(location, false, true, element.getFrame());
151151
}
152152
}
153153

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,35 @@ public static MaterializeFrameNode getUncached() {
7676
return MaterializeFrameNodeGen.getUncached();
7777
}
7878

79-
public final PFrame execute(Frame frame, boolean markAsEscaped, Frame frameToMaterialize) {
80-
return execute(frame, markAsEscaped, false, frameToMaterialize);
79+
public final PFrame execute(boolean markAsEscaped, Frame frameToMaterialize) {
80+
return execute(markAsEscaped, false, frameToMaterialize);
8181
}
8282

83-
public final PFrame execute(Frame frame, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
83+
public final PFrame execute(boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
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(frame, callNode, markAsEscaped, forceSync, false, frameToMaterialize);
87+
return execute(callNode, markAsEscaped, forceSync, false, frameToMaterialize);
8888
}
8989

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

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

9898
public final PFrame execute(Frame frame, Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing) {
99-
return execute(frame, location, markAsEscaped, forceSync, updateLocationIfMissing, frame);
99+
return execute(location, markAsEscaped, forceSync, updateLocationIfMissing, frame);
100100
}
101101

102-
public final PFrame execute(Frame frame, Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
103-
return execute(frame, location, markAsEscaped, forceSync, false, frameToMaterialize);
102+
public final PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, Frame frameToMaterialize) {
103+
return execute(location, markAsEscaped, forceSync, false, frameToMaterialize);
104104
}
105105

106106
// TODO remove frame? remove location? remove updateLocationIfMissing?
107-
public abstract PFrame execute(Frame frame, Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing, Frame frameToMaterialize);
107+
public abstract PFrame execute(Node location, boolean markAsEscaped, boolean forceSync, boolean updateLocationIfMissing, Frame frameToMaterialize);
108108

109109
@Specialization(guards = {
110110
"cachedFD == frameToMaterialize.getFrameDescriptor()", //

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,31 +110,31 @@ public static ReadCallerFrameNode create() {
110110
return new ReadCallerFrameNode();
111111
}
112112

113-
public final PFrame executeWith(VirtualFrame frame, int level) {
114-
return executeWith(frame, PArguments.getCurrentFrameInfo(frame), FrameSelector.SKIP_PYTHON_INTERNAL, level);
113+
public PFrame executeWith(VirtualFrame frame, int level) {
114+
return executeWith(PArguments.getCurrentFrameInfo(frame), FrameSelector.SKIP_PYTHON_INTERNAL, level);
115115
}
116116

117-
public final PFrame executeWith(VirtualFrame frame, FrameSelector selector, int level) {
118-
return executeWith(frame, PArguments.getCurrentFrameInfo(frame), selector, level);
117+
public PFrame executeWith(VirtualFrame frame, FrameSelector selector, int level) {
118+
return executeWith(PArguments.getCurrentFrameInfo(frame), selector, level);
119119
}
120120

121-
public final PFrame executeWith(VirtualFrame frame, Frame startFrame, int level) {
122-
return executeWith(frame, PArguments.getCurrentFrameInfo(startFrame), FrameSelector.SKIP_PYTHON_INTERNAL, level);
121+
public PFrame executeWith(Frame startFrame, int level) {
122+
return executeWith(PArguments.getCurrentFrameInfo(startFrame), FrameSelector.SKIP_PYTHON_INTERNAL, level);
123123
}
124124

125-
public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, int level) {
126-
return executeWith(frame, startFrameInfo, FrameSelector.SKIP_PYTHON_INTERNAL, level);
125+
public PFrame executeWith(PFrame.Reference startFrameInfo, int level) {
126+
return executeWith(startFrameInfo, FrameSelector.SKIP_PYTHON_INTERNAL, level);
127127
}
128128

129-
public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, int level) {
130-
return executeWith(frame, startFrameInfo, frameAccess, FrameSelector.SKIP_PYTHON_INTERNAL, level);
129+
public PFrame executeWith(PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, int level) {
130+
return executeWith(startFrameInfo, frameAccess, FrameSelector.SKIP_PYTHON_INTERNAL, level);
131131
}
132132

133-
public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, FrameSelector selector, int level) {
134-
return executeWith(frame, startFrameInfo, FrameInstance.FrameAccess.READ_ONLY, selector, level);
133+
public PFrame executeWith(PFrame.Reference startFrameInfo, FrameSelector selector, int level) {
134+
return executeWith(startFrameInfo, FrameInstance.FrameAccess.READ_ONLY, selector, level);
135135
}
136136

137-
public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, FrameSelector selector, int level) {
137+
public PFrame executeWith(PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, FrameSelector selector, int level) {
138138
PFrame.Reference curFrameInfo = startFrameInfo;
139139
if (cachedCallerFrameProfile == null) {
140140
CompilerDirectives.transferToInterpreterAndInvalidate();
@@ -145,7 +145,7 @@ public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, F
145145
if (callerInfo == null) {
146146
Frame callerFrame = getCallerFrame(startFrameInfo, frameAccess, selector, level);
147147
if (callerFrame != null) {
148-
return ensureMaterializeNode().execute(frame, false, true, callerFrame);
148+
return ensureMaterializeNode().execute(false, true, callerFrame);
149149
}
150150
return null;
151151
} else if (!selector.skip(callerInfo)) {
@@ -154,12 +154,12 @@ public PFrame executeWith(VirtualFrame frame, PFrame.Reference startFrameInfo, F
154154
curFrameInfo = callerInfo;
155155
}
156156
} else {
157-
curFrameInfo = walkLevels(frame, curFrameInfo, frameAccess, selector, level);
157+
curFrameInfo = walkLevels(curFrameInfo, frameAccess, selector, level);
158158
}
159159
return curFrameInfo.getPyFrame();
160160
}
161161

162-
private PFrame.Reference walkLevels(VirtualFrame frame, PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, FrameSelector selector, int level) {
162+
private PFrame.Reference walkLevels(PFrame.Reference startFrameInfo, FrameInstance.FrameAccess frameAccess, FrameSelector selector, int level) {
163163
PFrame.Reference currentFrame = startFrameInfo;
164164
for (int i = 0; i <= level;) {
165165
PFrame.Reference callerInfo = currentFrame.getCallerInfo();
@@ -169,7 +169,7 @@ private PFrame.Reference walkLevels(VirtualFrame frame, PFrame.Reference startFr
169169
// At this point, we must 'materialize' the frame. Actually, the Truffle frame
170170
// is never materialized but we ensure that a corresponding PFrame is created
171171
// and that the locals and arguments are synced.
172-
ensureMaterializeNode().execute(frame, false, true, callerFrame);
172+
ensureMaterializeNode().execute(false, true, callerFrame);
173173
return PArguments.getCurrentFrameInfo(callerFrame);
174174
}
175175
return PFrame.Reference.EMPTY;

0 commit comments

Comments
 (0)