Skip to content

Commit 4f0adb3

Browse files
author
Adam Hrbac
committed
Adopt the new Inlining DSL
1 parent fa5dd4e commit 4f0adb3

File tree

5 files changed

+90
-10
lines changed

5 files changed

+90
-10
lines changed

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

Lines changed: 4 additions & 6 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
@@ -51,14 +51,12 @@
5151
import com.oracle.graal.python.nodes.call.special.CallUnaryMethodNode;
5252
import com.oracle.graal.python.nodes.call.special.LookupSpecialMethodSlotNode;
5353
import com.oracle.graal.python.nodes.object.GetClassNode;
54-
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
5554
import com.oracle.truffle.api.dsl.Cached;
5655
import com.oracle.truffle.api.dsl.GenerateUncached;
5756
import com.oracle.truffle.api.dsl.ImportStatic;
5857
import com.oracle.truffle.api.dsl.Specialization;
5958
import com.oracle.truffle.api.frame.Frame;
6059
import com.oracle.truffle.api.nodes.Node;
61-
import com.oracle.truffle.api.profiles.ConditionProfile;
6260

6361
@GenerateUncached
6462
@ImportStatic(SpecialMethodSlot.class)
@@ -67,7 +65,7 @@ public abstract class GetAwaitableNode extends Node {
6765

6866
@Specialization
6967
public Object doGenerator(PGenerator generator,
70-
@Cached PRaiseNode raise) {
68+
@Cached.Shared("notInAwait") @Cached PRaiseNode raise) {
7169
if (generator.isCoroutine()) {
7270
return generator;
7371
} else {
@@ -77,8 +75,8 @@ public Object doGenerator(PGenerator generator,
7775

7876
@Specialization
7977
public Object doGeneric(Frame frame, Object awaitable,
80-
@Cached PRaiseNode raiseNoAwait,
81-
@Cached PRaiseNode raiseNotIter,
78+
@Cached.Shared("notInAwait") @Cached PRaiseNode raiseNoAwait,
79+
@Cached.Exclusive @Cached PRaiseNode raiseNotIter,
8280
@Cached(parameters = "Await") LookupSpecialMethodSlotNode findAwait,
8381
@Cached TypeNodes.GetNameNode getName,
8482
@Cached GetClassNode getAwaitableType,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2023, 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+
*/
41+
@SuppressPackageWarnings({"truffle-inlining", "truffle-sharing", "truffle-limit", "deprecated", "truffle-static-method"})
42+
package com.oracle.graal.python.builtins.objects.asyncio;
43+
44+
import com.oracle.truffle.api.dsl.SuppressPackageWarnings;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/code/PCode.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 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
@@ -62,8 +62,6 @@
6262
import com.oracle.graal.python.compiler.CodeUnit;
6363
import com.oracle.graal.python.compiler.OpCodes;
6464
import com.oracle.graal.python.nodes.PRootNode;
65-
import com.oracle.graal.python.nodes.argument.ReadVarArgsNode;
66-
import com.oracle.graal.python.nodes.argument.ReadVarKeywordsNode;
6765
import com.oracle.graal.python.nodes.bytecode.PBytecodeGeneratorFunctionRootNode;
6866
import com.oracle.graal.python.nodes.bytecode.PBytecodeGeneratorRootNode;
6967
import com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 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/nodes/bytecode/GetYieldFromIterNode.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.nodes.bytecode;
242

343
import com.oracle.graal.python.builtins.PythonBuiltinClassType;

0 commit comments

Comments
 (0)