Skip to content

Commit 228b2f3

Browse files
committed
Don't use static slots for now
1 parent 7ba1efe commit 228b2f3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/FrameInfo.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ public PBytecodeRootNode getRootNode() {
5959
return rootNode;
6060
}
6161

62-
public int bciToLine(int bci) {
63-
return rootNode.bciToLine(bci);
64-
}
65-
6662
public int getBci(Frame frame) {
67-
return frame.getIntStatic(rootNode.bcioffset);
63+
if (frame.isInt(rootNode.bcioffset)) {
64+
return frame.getInt(rootNode.bcioffset);
65+
} else {
66+
return -1;
67+
}
6868
}
6969

7070
public Object getYieldFrom(Frame generatorFrame, int bci, int stackTop) {
@@ -76,10 +76,6 @@ public Object getYieldFrom(Frame generatorFrame, int bci, int stackTop) {
7676
return null;
7777
}
7878

79-
public int getLineno(Frame frame) {
80-
return bciToLine(getBci(frame));
81-
}
82-
8379
public int getVariableCount() {
8480
CodeUnit code = rootNode.getCodeUnit();
8581
return code.varnames.length + code.cellvars.length + code.freevars.length;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ private static FrameDescriptor makeFrameDescriptor(CodeUnit co, FrameInfo info)
539539
// stack
540540
newBuilder.addSlots(co.stacksize, FrameSlotKind.Illegal);
541541
// BCI filled when unwinding the stack or when pausing generators
542-
newBuilder.addSlot(FrameSlotKind.Static, null, null);
542+
// TODO we should use a static slot when GR-40849 and GR-40742 are fixed
543+
newBuilder.addSlot(FrameSlotKind.Int, null, null);
543544
if (co.isGeneratorOrCoroutine()) {
544545
// stackTop saved when pausing a generator
545546
newBuilder.addSlot(FrameSlotKind.Int, null, null);
@@ -2380,7 +2381,7 @@ private void unboxVariables(Frame localFrame) {
23802381
}
23812382

23822383
private static void setCurrentBci(VirtualFrame virtualFrame, int bciSlot, int bci) {
2383-
virtualFrame.setIntStatic(bciSlot, bci);
2384+
virtualFrame.setInt(bciSlot, bci);
23842385
}
23852386

23862387
private boolean bytecodePopCondition(VirtualFrame virtualFrame, int stackTop, Node[] localNodes, int bci, boolean useCachedNodes) {

0 commit comments

Comments
 (0)