Skip to content

Commit 12a3a15

Browse files
committed
[GR-10526] Bump imports and fix deprecations
PullRequest: graalpython/125
2 parents 9df90b1 + 6f0c030 commit 12a3a15

File tree

4 files changed

+20
-28
lines changed

4 files changed

+20
-28
lines changed

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

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,58 +84,50 @@ protected final Object getObject(Frame frame) {
8484
return FrameUtil.getObjectSafe(frame, frameSlot);
8585
}
8686

87-
@SuppressWarnings("unused")
8887
protected final boolean isNotIllegal(Frame frame) {
89-
return frameSlot.getKind() != FrameSlotKind.Illegal;
88+
return frame.getFrameDescriptor().getFrameSlotKind(frameSlot) != FrameSlotKind.Illegal;
9089
}
9190

92-
@SuppressWarnings("unused")
9391
protected final boolean isBooleanKind(Frame frame) {
94-
return isKind(FrameSlotKind.Boolean);
92+
return isKind(frame, FrameSlotKind.Boolean);
9593
}
9694

97-
@SuppressWarnings("unused")
9895
protected final boolean isIntegerKind(Frame frame) {
99-
return isKind(FrameSlotKind.Int);
96+
return isKind(frame, FrameSlotKind.Int);
10097
}
10198

102-
@SuppressWarnings("unused")
10399
protected final boolean isLongKind(Frame frame) {
104-
return isKind(FrameSlotKind.Long);
100+
return isKind(frame, FrameSlotKind.Long);
105101
}
106102

107-
@SuppressWarnings("unused")
108103
protected final boolean isDoubleKind(Frame frame) {
109-
return isKind(FrameSlotKind.Double);
104+
return isKind(frame, FrameSlotKind.Double);
110105
}
111106

112-
@SuppressWarnings("unused")
113107
protected final boolean isIntOrObjectKind(Frame frame) {
114-
return isKind(FrameSlotKind.Int) || isKind(FrameSlotKind.Object);
108+
return isKind(frame, FrameSlotKind.Int) || isKind(frame, FrameSlotKind.Object);
115109
}
116110

117-
@SuppressWarnings("unused")
118111
protected final boolean isLongOrObjectKind(Frame frame) {
119-
return isKind(FrameSlotKind.Long) || isKind(FrameSlotKind.Object);
112+
return isKind(frame, FrameSlotKind.Long) || isKind(frame, FrameSlotKind.Object);
120113
}
121114

122-
@SuppressWarnings("unused")
123115
protected final boolean isObjectKind(Frame frame) {
124-
if (frameSlot.getKind() != FrameSlotKind.Object) {
116+
if (frame.getFrameDescriptor().getFrameSlotKind(frameSlot) != FrameSlotKind.Object) {
125117
CompilerDirectives.transferToInterpreter();
126-
frameSlot.setKind(FrameSlotKind.Object);
118+
frame.getFrameDescriptor().setFrameSlotKind(frameSlot, FrameSlotKind.Object);
127119
}
128120
return true;
129121
}
130122

131-
private boolean isKind(FrameSlotKind kind) {
132-
return frameSlot.getKind() == kind || initialSetKind(kind);
123+
private boolean isKind(Frame frame, FrameSlotKind kind) {
124+
return frame.getFrameDescriptor().getFrameSlotKind(frameSlot) == kind || initialSetKind(frame, kind);
133125
}
134126

135-
private boolean initialSetKind(FrameSlotKind kind) {
136-
if (frameSlot.getKind() == FrameSlotKind.Illegal) {
127+
private boolean initialSetKind(Frame frame, FrameSlotKind kind) {
128+
if (frame.getFrameDescriptor().getFrameSlotKind(frameSlot) == FrameSlotKind.Illegal) {
137129
CompilerDirectives.transferToInterpreter();
138-
frameSlot.setKind(kind);
130+
frame.getFrameDescriptor().setFrameSlotKind(frameSlot, kind);
139131
return true;
140132
}
141133
return false;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ public int write(VirtualFrame frame, int value) {
116116

117117
@Specialization(guards = {"isLongOrObjectKind(frame)", "isPrimitiveInt(value)"}, rewriteOn = ArithmeticException.class)
118118
public PInt writePIntAsLong(VirtualFrame frame, PInt value) {
119+
frame.getFrameDescriptor().setFrameSlotKind(frameSlot, FrameSlotKind.Long);
119120
frame.setLong(frameSlot, value.longValueExact());
120-
frameSlot.setKind(FrameSlotKind.Long);
121121
return value;
122122
}
123123

124124
@Specialization(guards = "isLongOrObjectKind(frame)")
125125
public PInt writePIntAsObject(VirtualFrame frame, PInt value) {
126-
frameSlot.setKind(FrameSlotKind.Object);
126+
frame.getFrameDescriptor().setFrameSlotKind(frameSlot, FrameSlotKind.Object);
127127
frame.setObject(frameSlot, value);
128128
return value;
129129
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/generator/WriteGeneratorFrameVariableNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ public int write(VirtualFrame frame, int value) {
121121
@Specialization(guards = {"isLongOrObjectKind(frame)", "isPrimitiveInt(value)"}, rewriteOn = ArithmeticException.class)
122122
public PInt writePIntAsLong(VirtualFrame frame, PInt value) {
123123
Frame generatorFrame = PArguments.getGeneratorFrame(frame);
124-
frameSlot.setKind(FrameSlotKind.Long);
124+
generatorFrame.getFrameDescriptor().setFrameSlotKind(frameSlot, FrameSlotKind.Long);
125125
generatorFrame.setLong(frameSlot, value.longValueExact());
126126
return value;
127127
}
128128

129129
@Specialization(guards = "isLongOrObjectKind(frame)")
130130
public PInt writePIntAsObject(VirtualFrame frame, PInt value) {
131131
Frame generatorFrame = PArguments.getGeneratorFrame(frame);
132-
frameSlot.setKind(FrameSlotKind.Object);
132+
generatorFrame.getFrameDescriptor().setFrameSlotKind(frameSlot, FrameSlotKind.Object);
133133
generatorFrame.setObject(frameSlot, value);
134134
return value;
135135
}

mx.graalpython/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
},
2626
{
2727
"name": "sulong",
28-
"version": "128139f4b55c15cc090f9cb26a7eb775c44e3f3f",
28+
"version": "eb3cf4bc0abb0c98c53ae7a93dc75b01d1846d83",
2929
"urls": [
3030
{"url": "https://github.com/graalvm/sulong", "kind": "git"},
3131
]
3232
},
3333
{
3434
"name": "regex",
35-
"version": "b849b28aadc29a9efa0247a40bf88898978f0ceb",
35+
"version": "337a2747a1d750693853cc7c8f6ec2aaa2afc4ba",
3636
"subdir": True,
3737
"urls": [
3838
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)