Skip to content

Commit 969b4a3

Browse files
author
Adam Hrbac
committed
Cleaup code
1 parent 9cf572b commit 969b4a3

File tree

4 files changed

+5
-76
lines changed

4 files changed

+5
-76
lines changed

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

Lines changed: 0 additions & 66 deletions
This file was deleted.

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
4444
import com.oracle.graal.python.builtins.objects.PNone;
4545
import com.oracle.graal.python.nodes.PNodeWithContext;
46-
import com.oracle.graal.python.nodes.PRaiseNode;
4746
import com.oracle.graal.python.nodes.object.IsBuiltinClassProfile;
4847
import com.oracle.graal.python.runtime.exception.PException;
4948
import com.oracle.truffle.api.CompilerDirectives;
@@ -74,10 +73,9 @@ public void doPException(PException exception, boolean rootNodeVisible,
7473
}
7574
}
7675

77-
@Specialization
76+
@Specialization(replaces = "doPException")
7877
public void doGeneric(Object exception, boolean rootNodeVisible,
79-
@Cached @Cached.Shared("IsStopAsyncIteration") IsBuiltinClassProfile isStopAsyncIteration,
80-
@Cached PRaiseNode raiseNode) {
78+
@Cached @Cached.Shared("IsStopAsyncIteration") IsBuiltinClassProfile isStopAsyncIteration) {
8179
if (exception == PNone.NONE) {
8280
return;
8381
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ Object doGeneric(Frame frame, Object receiver,
8888
Object getter = getAIter.execute(frame, type, receiver);
8989
if (getter == PNone.NO_VALUE) {
9090
errorProfile.enter(this);
91-
raiseNoAIter.raise(PythonBuiltinClassType.TypeError, ASYNC_FOR_NO_AITER, getName.execute(type));
91+
throw raiseNoAIter.raise(PythonBuiltinClassType.TypeError, ASYNC_FOR_NO_AITER, getName.execute(type));
9292
}
9393
Object asyncIterator = callAIter.executeObject(frame, getter, receiver);
9494
Object anext = lookupANext.execute(asyncIterator, T___ANEXT__);
9595
if (anext == PNone.NO_VALUE) {
9696
errorProfile.enter(this);
97-
raiseNoAIter.raise(PythonBuiltinClassType.TypeError, ASYNC_FOR_NO_ANEXT_INITIAL, getName.execute(type));
97+
throw raiseNoAIter.raise(PythonBuiltinClassType.TypeError, ASYNC_FOR_NO_ANEXT_INITIAL, getName.execute(type));
9898
}
9999
return asyncIterator;
100100
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ public final class PBytecodeRootNode extends PRootNode implements BytecodeOSRNod
317317
private static final NodeSupplier<GetANextNode> NODE_GET_ANEXT = GetANextNode::create;
318318
private static final EndAsyncForNode UNCACHED_END_ASYNC_FOR = EndAsyncForNode.getUncached();
319319
private static final NodeSupplier<EndAsyncForNode> NODE_END_ASYNC_FOR = EndAsyncForNode::create;
320-
private static final AsyncGenWrapNode UNCACHED_ASYNC_GEN_WRAP = AsyncGenWrapNode.getUncached();
321-
private static final NodeSupplier<AsyncGenWrapNode> NODE_ASYNC_GEN_WRAP = AsyncGenWrapNode::create;
322320
private static final NodeSupplier<ExitAWithNode> NODE_EXIT_AWITH = ExitAWithNode::create;
323321
private static final ImportFromNode UNCACHED_IMPORT_FROM = ImportFromNode.getUncached();
324322
private static final NodeSupplier<ImportFromNode> NODE_IMPORT_FROM = ImportFromNode::create;
@@ -2365,8 +2363,7 @@ private Object bytecodeLoop(VirtualFrame virtualFrame, Frame localFrame, Bytecod
23652363

23662364
@BytecodeInterpreterSwitch
23672365
private void bytecodeAsyncGenWrap(VirtualFrame virtualFrame, boolean useCachedNodes, int stackTop, Node[] localNodes, int beginBci) {
2368-
AsyncGenWrapNode node = insertChildNode(localNodes, beginBci, UNCACHED_ASYNC_GEN_WRAP, AsyncGenWrapNodeGen.class, NODE_ASYNC_GEN_WRAP, useCachedNodes);
2369-
virtualFrame.setObject(stackTop, node.execute(virtualFrame.getObject(stackTop)));
2366+
virtualFrame.setObject(stackTop, factory.createAsyncGeneratorWrappedValue(virtualFrame.getObject(stackTop)));
23702367
}
23712368

23722369
@BytecodeInterpreterSwitch

0 commit comments

Comments
 (0)