Skip to content

Commit cf6800c

Browse files
committed
Resolve more Truffle DSL warnings
1 parent d3e38fb commit cf6800c

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

Diff for: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/GetSendValueNode.java

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.oracle.truffle.api.dsl.Fallback;
4848
import com.oracle.truffle.api.dsl.GenerateInline;
4949
import com.oracle.truffle.api.dsl.GenerateUncached;
50+
import com.oracle.truffle.api.dsl.NeverDefault;
5051
import com.oracle.truffle.api.dsl.Specialization;
5152

5253
@GenerateUncached
@@ -69,6 +70,7 @@ Object doSend(Object obj) {
6970
return obj;
7071
}
7172

73+
@NeverDefault
7274
public static GetSendValueNode create() {
7375
return GetSendValueNodeGen.create();
7476
}

Diff for: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/GetTPFlagsNode.java

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.oracle.truffle.api.dsl.Cached;
4848
import com.oracle.truffle.api.dsl.GenerateInline;
4949
import com.oracle.truffle.api.dsl.GenerateUncached;
50+
import com.oracle.truffle.api.dsl.NeverDefault;
5051
import com.oracle.truffle.api.dsl.Specialization;
5152
import com.oracle.truffle.api.nodes.Node;
5253

@@ -63,6 +64,7 @@ long get(Object object,
6364
return getTypeFlagsNode.execute(getClassNode.execute(inliningTarget, object));
6465
}
6566

67+
@NeverDefault
6668
public static GetTPFlagsNode create() {
6769
return GetTPFlagsNodeGen.create();
6870
}

Diff for: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode_dsl/PBytecodeDSLRootNode.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,7 @@ public static void doUnpackIterable(VirtualFrame virtualFrame, Object collection
18631863

18641864
@Operation
18651865
@ImportStatic({PGuards.class})
1866+
@SuppressWarnings("truffle-interpreted-performance")
18661867
public static final class UnpackStarredToLocals {
18671868
@Specialization(guards = {"cannotBeOverridden(sequence, inliningTarget, getClassNode)", "!isPString(sequence)"}, limit = "1")
18681869
public static void doUnpackSequence(VirtualFrame localFrame, PSequence sequence, int starIndex,
@@ -2949,7 +2950,7 @@ public static void doEnter(VirtualFrame frame, Object contextManager,
29492950
public static final class ContextManagerExit {
29502951
@Specialization
29512952
public static void doRegular(VirtualFrame frame, PNone none, Object exit, Object contextManager,
2952-
@Cached CallQuaternaryMethodNode callExit) {
2953+
@Shared @Cached CallQuaternaryMethodNode callExit) {
29532954
callExit.execute(frame, exit, contextManager, PNone.NONE, PNone.NONE, PNone.NONE);
29542955
}
29552956

@@ -2959,7 +2960,7 @@ public static void doExceptional(VirtualFrame frame,
29592960
Object exception, Object exit, Object contextManager,
29602961
@Bind("this") Node inliningTarget,
29612962
@Bind("$root") PBytecodeDSLRootNode rootNode,
2962-
@Cached CallQuaternaryMethodNode callExit,
2963+
@Shared @Cached CallQuaternaryMethodNode callExit,
29632964
@Cached GetClassNode getClass,
29642965
@Cached ExceptionNodes.GetTracebackNode getTraceback,
29652966
@Cached PyObjectIsTrueNode isTrue,
@@ -3023,7 +3024,7 @@ public static final class AsyncContextManagerCallExit {
30233024
@Specialization
30243025
public static Object doRegular(VirtualFrame frame,
30253026
PNone none, Object exit, Object contextManager,
3026-
@Cached CallQuaternaryMethodNode callExit) {
3027+
@Shared @Cached CallQuaternaryMethodNode callExit) {
30273028
return callExit.execute(frame, exit, contextManager, PNone.NONE, PNone.NONE, PNone.NONE);
30283029
}
30293030

@@ -3033,7 +3034,7 @@ public static Object doExceptional(VirtualFrame frame,
30333034
Object exception, Object exit, Object contextManager,
30343035
@Bind("this") Node inliningTarget,
30353036
@Bind("$root") PBytecodeDSLRootNode rootNode,
3036-
@Cached CallQuaternaryMethodNode callExit,
3037+
@Shared @Cached CallQuaternaryMethodNode callExit,
30373038
@Cached GetClassNode getClass,
30383039
@Cached ExceptionNodes.GetTracebackNode getTraceback,
30393040
@Cached PyObjectIsTrueNode isTrue,
@@ -3056,9 +3057,10 @@ public static Object doExceptional(VirtualFrame frame,
30563057

30573058
@Operation
30583059
public static final class AsyncContextManagerExit {
3059-
// NB: There is nothing to do after awaiting __exit__(None, None, None), so this
3060-
// operation is only used for the case where the context manager exits due to an
3061-
// exception.
3060+
/**
3061+
* NB: There is nothing to do after awaiting __exit__(None, None, None), so this operation
3062+
* is only emitted for the case where the context manager exits due to an exception.
3063+
*/
30623064
@Specialization
30633065
@InliningCutoff
30643066
public static void doExceptional(VirtualFrame frame,
@@ -3268,6 +3270,7 @@ public static Object doObject(VirtualFrame frame, Object sendValue,
32683270
}
32693271

32703272
@Operation
3273+
@SuppressWarnings("truffle-interpreted-performance")
32713274
public static final class YieldFromSend {
32723275
private static final TruffleString T_SEND = tsLiteral("send");
32733276

@@ -3336,6 +3339,7 @@ private static void handleException(VirtualFrame frame, PException e, Node inlin
33363339
}
33373340

33383341
@Operation
3342+
@SuppressWarnings("turffle-interpreted-performance")
33393343
public static final class YieldFromThrow {
33403344

33413345
private static final TruffleString T_CLOSE = tsLiteral("close");

Diff for: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/UnaryArithmetic.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public static double pos(double arg) {
176176

177177
@Specialization
178178
public static Object doGeneric(VirtualFrame frame, Object arg,
179-
@Cached(value = "createCallNode(T___POS__, NOT_IMPLEMENTED)", inline = false) LookupAndCallUnaryNode callNode) {
179+
@Cached(value = "createCallNode(T___POS__, NOT_IMPLEMENTED)") LookupAndCallUnaryNode callNode) {
180180
return callNode.executeObject(frame, arg);
181181
}
182182

@@ -215,7 +215,7 @@ public static double neg(double arg) {
215215

216216
@Specialization
217217
public static Object doGeneric(VirtualFrame frame, Object arg,
218-
@Cached(value = "createCallNode(T___NEG__, NOT_IMPLEMENTED)", inline = false) LookupAndCallUnaryNode callNode) {
218+
@Cached(value = "createCallNode(T___NEG__, NOT_IMPLEMENTED)") LookupAndCallUnaryNode callNode) {
219219
return callNode.executeObject(frame, arg);
220220
}
221221

@@ -249,7 +249,7 @@ public static long invert(long arg) {
249249

250250
@Specialization
251251
public static Object doGeneric(VirtualFrame frame, Object arg,
252-
@Cached(value = "createCallNode(T___INVERT__, NOT_IMPLEMENTED)", inline = false) LookupAndCallUnaryNode callNode) {
252+
@Cached(value = "createCallNode(T___INVERT__, NOT_IMPLEMENTED)") LookupAndCallUnaryNode callNode) {
253253
return callNode.executeObject(frame, arg);
254254
}
255255

0 commit comments

Comments
 (0)