Skip to content

Commit 00f35be

Browse files
author
Adam Hrbac
committed
Fix style
1 parent fea3c87 commit 00f35be

File tree

15 files changed

+118
-44
lines changed

15 files changed

+118
-44
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@
202202
import com.oracle.graal.python.nodes.builtins.ListNodes;
203203
import com.oracle.graal.python.nodes.builtins.ListNodes.ConstructListNode;
204204
import com.oracle.graal.python.nodes.bytecode.GetAIterNode;
205-
import com.oracle.graal.python.nodes.bytecode.GetANextNode;
206205
import com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode;
207206
import com.oracle.graal.python.nodes.call.CallDispatchNode;
208207
import com.oracle.graal.python.nodes.call.CallNode;
@@ -2590,15 +2589,15 @@ class InitializeBuildClass {
25902589

25912590
@Builtin(name = "anext", minNumOfPositionalArgs = 1)
25922591
@GenerateNodeFactory
2593-
public static abstract class ANext extends PythonUnaryBuiltinNode {
2592+
public abstract static class ANext extends PythonUnaryBuiltinNode {
25942593
@Specialization
25952594
public Object doGeneric(VirtualFrame frame, Object asyncIter,
2596-
@Bind("this") Node inliningTarget,
2597-
@Cached(parameters = "ANext") LookupSpecialMethodSlotNode getANext,
2598-
@Cached InlinedGetClassNode getAsyncIterType,
2599-
@Cached PRaiseNode raiseNoANext,
2600-
@Cached CallUnaryMethodNode callANext,
2601-
@Cached TypeNodes.GetNameNode getName) {
2595+
@Bind("this") Node inliningTarget,
2596+
@Cached(parameters = "ANext") LookupSpecialMethodSlotNode getANext,
2597+
@Cached InlinedGetClassNode getAsyncIterType,
2598+
@Cached PRaiseNode raiseNoANext,
2599+
@Cached CallUnaryMethodNode callANext,
2600+
@Cached TypeNodes.GetNameNode getName) {
26022601
// TODO: two argument anext
26032602
Object type = getAsyncIterType.execute(inliningTarget, asyncIter);
26042603
Object getter = getANext.execute(frame, type, asyncIter);
@@ -2611,10 +2610,10 @@ public Object doGeneric(VirtualFrame frame, Object asyncIter,
26112610

26122611
@Builtin(name = "aiter", minNumOfPositionalArgs = 1)
26132612
@GenerateNodeFactory
2614-
public static abstract class AIter extends PythonUnaryBuiltinNode {
2613+
public abstract static class AIter extends PythonUnaryBuiltinNode {
26152614
@Specialization
26162615
public Object doGeneric(VirtualFrame frame, Object arg,
2617-
@Cached GetAIterNode aiter) {
2616+
@Cached(neverDefault = true) GetAIterNode aiter) {
26182617
return aiter.execute(frame, arg);
26192618
}
26202619
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/AsyncGenSendBuiltins.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
7979

8080
@Builtin(name = J___AWAIT__, minNumOfPositionalArgs = 1, declaresExplicitSelf = true)
8181
@GenerateNodeFactory
82-
public static abstract class Await extends PythonUnaryBuiltinNode {
82+
public abstract static class Await extends PythonUnaryBuiltinNode {
8383
@Specialization
8484
public Object doAwait(PAsyncGenASend self) {
8585
return self;
@@ -88,7 +88,7 @@ public Object doAwait(PAsyncGenASend self) {
8888

8989
@Builtin(name = J___NEXT__, minNumOfPositionalArgs = 1, declaresExplicitSelf = true)
9090
@GenerateNodeFactory
91-
public static abstract class Next extends PythonUnaryBuiltinNode {
91+
public abstract static class Next extends PythonUnaryBuiltinNode {
9292
@Specialization
9393
public Object next(VirtualFrame frame, PAsyncGenASend self,
9494
@Cached Send send) {
@@ -98,7 +98,7 @@ public Object next(VirtualFrame frame, PAsyncGenASend self,
9898

9999
@Builtin(name = "send", minNumOfPositionalArgs = 2, declaresExplicitSelf = true)
100100
@GenerateNodeFactory
101-
public static abstract class Send extends PythonBinaryBuiltinNode {
101+
public abstract static class Send extends PythonBinaryBuiltinNode {
102102
@Specialization
103103
public Object send(VirtualFrame frame, PAsyncGenASend self, Object sent,
104104
@Bind("this") Node inliningTarget,
@@ -146,9 +146,9 @@ public Object send(VirtualFrame frame, PAsyncGenASend self, Object sent,
146146
*/
147147

148148
static PException handleAGError(PAsyncGen self, PException exception,
149-
Node inliningTarget,
150-
BuiltinClassProfiles.IsBuiltinObjectProfile isStopAsyncIteration,
151-
BuiltinClassProfiles.IsBuiltinObjectProfile isGeneratorExit) {
149+
Node inliningTarget,
150+
BuiltinClassProfiles.IsBuiltinObjectProfile isStopAsyncIteration,
151+
BuiltinClassProfiles.IsBuiltinObjectProfile isGeneratorExit) {
152152
if (isStopAsyncIteration.profileException(inliningTarget, exception, PythonBuiltinClassType.StopAsyncIteration) ||
153153
isGeneratorExit.profileException(inliningTarget, exception, PythonBuiltinClassType.GeneratorExit)) {
154154
self.markClosed();
@@ -171,7 +171,7 @@ static Object unwrapAGYield(PAsyncGen self, Object result,
171171

172172
@Builtin(name = "throw", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 4, declaresExplicitSelf = true)
173173
@GenerateNodeFactory
174-
public static abstract class Throw extends PythonBuiltinNode {
174+
public abstract static class Throw extends PythonBuiltinNode {
175175
public abstract Object execute(VirtualFrame frame, PAsyncGenASend self, Object arg1, Object arg2, Object arg3);
176176

177177
@Specialization
@@ -206,7 +206,7 @@ public Object doThrow(VirtualFrame frame, PAsyncGenASend self, Object arg1, Obje
206206

207207
@Builtin(name = J___ITER__, minNumOfPositionalArgs = 1, declaresExplicitSelf = true)
208208
@GenerateNodeFactory
209-
public static abstract class Iter extends PythonUnaryBuiltinNode {
209+
public abstract static class Iter extends PythonUnaryBuiltinNode {
210210
@Specialization
211211
public Object iter(PAsyncGenASend self) {
212212
return self;
@@ -215,7 +215,7 @@ public Object iter(PAsyncGenASend self) {
215215

216216
@Builtin(name = "close", minNumOfPositionalArgs = 1, declaresExplicitSelf = true)
217217
@GenerateNodeFactory
218-
public static abstract class Close extends PythonUnaryBuiltinNode {
218+
public abstract static class Close extends PythonUnaryBuiltinNode {
219219
@Specialization
220220
public Object close(PAsyncGenASend self) {
221221
self.setState(AwaitableState.CLOSED);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/AsyncGenThrowBuiltins.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
141
package com.oracle.graal.python.builtins.objects.asyncio;
242

343
import static com.oracle.graal.python.builtins.objects.asyncio.PAsyncGenASend.AwaitableState;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/CoroutineWrapperBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -109,7 +109,7 @@ public Object doThrow(VirtualFrame frame, PCoroutineWrapper self, Object typ, Ob
109109
public abstract static class CloseNode extends PythonBuiltinNode {
110110
@Specialization
111111
public Object doThrow(VirtualFrame frame, PCoroutineWrapper self,
112-
@Cached CommonGeneratorBuiltins.CloseNode closeNode) {
112+
@Cached CommonGeneratorBuiltins.CloseNode closeNode) {
113113
return closeNode.execute(frame, self.coroutine);
114114
}
115115
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/GetAwaitableNode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import com.oracle.graal.python.nodes.object.InlinedGetClassNode;
5454
import com.oracle.truffle.api.dsl.Bind;
5555
import com.oracle.truffle.api.dsl.Cached;
56-
import com.oracle.truffle.api.dsl.Cached.Shared;
5756
import com.oracle.truffle.api.dsl.GenerateUncached;
5857
import com.oracle.truffle.api.dsl.ImportStatic;
5958
import com.oracle.truffle.api.dsl.Specialization;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/PAsyncGenASend.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import com.oracle.graal.python.PythonLanguage;
4444
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
45-
import com.oracle.graal.python.builtins.objects.generator.PGenerator;
4645
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
4746
import com.oracle.graal.python.runtime.PAsyncGen;
4847

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/PAsyncGenAThrow.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,13 @@
4040
*/
4141
package com.oracle.graal.python.builtins.objects.asyncio;
4242

43+
import static com.oracle.graal.python.builtins.objects.asyncio.PAsyncGenASend.AwaitableState;
44+
4345
import com.oracle.graal.python.PythonLanguage;
4446
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
45-
import com.oracle.graal.python.builtins.objects.generator.PGenerator;
4647
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
4748
import com.oracle.graal.python.runtime.PAsyncGen;
4849

49-
import static com.oracle.graal.python.builtins.objects.asyncio.PAsyncGenASend.AwaitableState;
50-
5150
public final class PAsyncGenAThrow extends PythonBuiltinObject {
5251
public final PAsyncGen receiver;
5352

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/asyncio/PAsyncGenWrappedValue.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242

4343
import com.oracle.graal.python.PythonLanguage;
4444
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
45-
import com.oracle.graal.python.builtins.objects.generator.PGenerator;
4645
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
47-
import com.oracle.truffle.api.object.Shape;
4846

4947
public class PAsyncGenWrappedValue extends PythonBuiltinObject {
5048
// TODO: consider whether a freelist makes sense

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator/CoroutineBuiltins.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ public class CoroutineBuiltins extends PythonBuiltins {
6464
protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFactories() {
6565
return CoroutineBuiltinsFactory.getFactories();
6666
}
67+
6768
@Builtin(name = "cr_code", isGetter = true, minNumOfPositionalArgs = 1)
6869
@GenerateNodeFactory
6970
public abstract static class GetCode extends PythonUnaryBuiltinNode {
7071
@Specialization
7172
public Object getCode(PGenerator self,
72-
@Bind("this") Node inliningTarget,
73-
@Cached InlinedConditionProfile hasCodeProfile) {
73+
@Bind("this") Node inliningTarget,
74+
@Cached InlinedConditionProfile hasCodeProfile) {
7475
return self.getOrCreateCode(inliningTarget, hasCodeProfile, factory());
7576
}
7677
}
@@ -90,7 +91,7 @@ public Object getAwait(PGenerator self) {
9091
public abstract static class GetFrame extends PythonUnaryBuiltinNode {
9192
@Specialization
9293
public Object getFrame(VirtualFrame frame, PGenerator self,
93-
@Cached GeneratorBuiltins.GetFrameNode getFrame) {
94+
@Cached GeneratorBuiltins.GetFrameNode getFrame) {
9495
return getFrame.execute(frame, self);
9596
}
9697
}

0 commit comments

Comments
 (0)