Skip to content

Commit d756bc9

Browse files
committed
[GR-21590] Update imports.
PullRequest: graalpython/2647
2 parents 0e414e5 + fc4c608 commit d756bc9

37 files changed

+509
-206
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "f43588af9b5811c0c72177d07093606797b2e34e" }
1+
{ "overlay": "ca33e3ab48baa95653f7e675fc0b89cf7f0d03df" }

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_compileall.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsNoSourceEpoch.test_regexp
2525
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsNoSourceEpoch.test_silent
2626
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsNoSourceEpoch.test_symlink_loop
27-
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsNoSourceEpoch.test_workers
28-
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsNoSourceEpoch.test_workers_available_cores
2927
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_compiles_as_much_as_possible
3028
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_d_compile_error
3129
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_d_runtime_error
@@ -52,8 +50,6 @@
5250
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_regexp
5351
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_silent
5452
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_symlink_loop
55-
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_workers
56-
*graalpython.lib-python.3.test.test_compileall.CommandLineTestsWithSourceEpoch.test_workers_available_cores
5753
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_compiles_as_much_as_possible
5854
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_d_compile_error
5955
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_d_runtime_error
@@ -76,7 +72,6 @@
7672
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_recursion_limit
7773
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_regexp
7874
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_silent
79-
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsNoSourceEpoch.test_workers_available_cores
8075
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_compiles_as_much_as_possible
8176
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_d_compile_error
8277
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_d_runtime_error
@@ -99,7 +94,6 @@
9994
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_recursion_limit
10095
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_regexp
10196
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_silent
102-
*graalpython.lib-python.3.test.test_compileall.CommmandLineTestsWithSourceEpoch.test_workers_available_cores
10397
*graalpython.lib-python.3.test.test_compileall.CompileallTestsWithSourceEpoch.test_compile_dir_maxlevels
10498
*graalpython.lib-python.3.test.test_compileall.CompileallTestsWithSourceEpoch.test_compile_dir_pathlike
10599
*graalpython.lib-python.3.test.test_compileall.CompileallTestsWithSourceEpoch.test_compile_file_encoding_fallback

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
import com.oracle.truffle.api.TruffleLanguage;
105105
import com.oracle.truffle.api.TruffleLogger;
106106
import com.oracle.truffle.api.debug.DebuggerTags;
107+
import com.oracle.truffle.api.dsl.Idempotent;
107108
import com.oracle.truffle.api.frame.VirtualFrame;
108109
import com.oracle.truffle.api.instrumentation.ProvidedTags;
109110
import com.oracle.truffle.api.instrumentation.StandardTags;
@@ -229,6 +230,7 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
229230

230231
@CompilationFinal private boolean singleContext = true;
231232

233+
@Idempotent
232234
public boolean isSingleContext() {
233235
return singleContext;
234236
}
@@ -366,6 +368,7 @@ protected PythonContext createContext(Env env) {
366368
return context;
367369
}
368370

371+
@Idempotent
369372
public <T> T getEngineOption(OptionKey<T> key) {
370373
assert engineOptions != null;
371374
if (CompilerDirectives.inInterpreter()) {
@@ -681,6 +684,7 @@ public String getHome() {
681684
/**
682685
* If this object can be cached in the AST.
683686
*/
687+
@Idempotent
684688
public static boolean canCache(Object value) {
685689
CompilerAsserts.neverPartOfCompilation();
686690
// We cache strings with at most 16 characters. This corresponds to byte length of 64 for

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
import com.oracle.truffle.api.dsl.GenerateCached;
269269
import com.oracle.truffle.api.dsl.GenerateInline;
270270
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
271+
import com.oracle.truffle.api.dsl.Idempotent;
271272
import com.oracle.truffle.api.dsl.ImportStatic;
272273
import com.oracle.truffle.api.dsl.NeverDefault;
273274
import com.oracle.truffle.api.dsl.ReportPolymorphism;
@@ -1410,6 +1411,7 @@ protected RecursiveBinaryCheckBaseNode createRecursive(@SuppressWarnings("unused
14101411
throw new AbstractMethodError(); // Cannot be really abstract b/c Truffle DSL...
14111412
}
14121413

1414+
@Idempotent
14131415
protected int getMaxExplodeLoop() {
14141416
return MAX_EXPLODE_LOOP >> depth;
14151417
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/lzma/LZMANodes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
import com.oracle.truffle.api.dsl.GenerateInline;
135135
import com.oracle.truffle.api.dsl.ImportStatic;
136136
import com.oracle.truffle.api.dsl.NeverDefault;
137+
import com.oracle.truffle.api.dsl.NonIdempotent;
137138
import com.oracle.truffle.api.dsl.Specialization;
138139
import com.oracle.truffle.api.frame.Frame;
139140
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -1201,6 +1202,7 @@ public abstract static class IsCheckSupported extends PNodeWithRaise {
12011202

12021203
public abstract boolean execute(int checkId);
12031204

1205+
@NonIdempotent
12041206
protected boolean useNativeContext() {
12051207
return PythonContext.get(this).getNFILZMASupport().isAvailable();
12061208
}
@@ -1227,6 +1229,7 @@ public abstract static class EncodeFilterProperties extends PNodeWithRaise {
12271229

12281230
public abstract byte[] execute(VirtualFrame frame, Object filter);
12291231

1232+
@NonIdempotent
12301233
protected boolean useNativeContext() {
12311234
return PythonContext.get(this).getNFILZMASupport().isAvailable();
12321235
}
@@ -1268,6 +1271,7 @@ public abstract static class DecodeFilterProperties extends PNodeWithRaise {
12681271

12691272
public abstract void execute(VirtualFrame frame, long id, byte[] encoded, PDict dict);
12701273

1274+
@NonIdempotent
12711275
protected boolean useNativeContext() {
12721276
return PythonContext.get(this).getNFILZMASupport().isAvailable();
12731277
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/zlib/ZLibModuleBuiltins.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
import com.oracle.truffle.api.dsl.ImportStatic;
101101
import com.oracle.truffle.api.dsl.NeverDefault;
102102
import com.oracle.truffle.api.dsl.NodeFactory;
103+
import com.oracle.truffle.api.dsl.NonIdempotent;
103104
import com.oracle.truffle.api.dsl.Specialization;
104105
import com.oracle.truffle.api.dsl.TypeSystemReference;
105106
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -326,6 +327,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
326327
return ZLibModuleBuiltinsClinicProviders.Crc32NodeClinicProviderGen.INSTANCE;
327328
}
328329

330+
@NonIdempotent
329331
protected boolean useNative() {
330332
return PythonContext.get(this).getNFIZlibSupport().isAvailable();
331333
}
@@ -403,6 +405,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
403405
return ZLibModuleBuiltinsClinicProviders.Adler32NodeClinicProviderGen.INSTANCE;
404406
}
405407

408+
@NonIdempotent
406409
protected boolean useNative() {
407410
return getContext().getNFIZlibSupport().isAvailable();
408411
}
@@ -489,6 +492,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
489492
return ZLibModuleBuiltinsClinicProviders.CompressNodeClinicProviderGen.INSTANCE;
490493
}
491494

495+
@NonIdempotent
492496
protected boolean useNative() {
493497
return getContext().getNFIZlibSupport().isAvailable();
494498
}
@@ -560,6 +564,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
560564
return ZLibModuleBuiltinsClinicProviders.DecompressNodeClinicProviderGen.INSTANCE;
561565
}
562566

567+
@NonIdempotent
563568
protected boolean useNative() {
564569
return PythonContext.get(this).getNFIZlibSupport().isAvailable();
565570
}
@@ -647,6 +652,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
647652
return ZLibModuleBuiltinsClinicProviders.CompressObjNodeClinicProviderGen.INSTANCE;
648653
}
649654

655+
@NonIdempotent
650656
protected boolean useNative() {
651657
return PythonContext.get(this).getNFIZlibSupport().isAvailable();
652658
}
@@ -720,6 +726,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
720726
return ZLibModuleBuiltinsClinicProviders.DecompressObjNodeClinicProviderGen.INSTANCE;
721727
}
722728

729+
@NonIdempotent
723730
protected boolean useNative() {
724731
return PythonContext.get(this).getNFIZlibSupport().isAvailable();
725732
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CExtNodes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
import com.oracle.truffle.api.dsl.Cached.Shared;
188188
import com.oracle.truffle.api.dsl.Fallback;
189189
import com.oracle.truffle.api.dsl.GenerateUncached;
190+
import com.oracle.truffle.api.dsl.Idempotent;
190191
import com.oracle.truffle.api.dsl.ImportStatic;
191192
import com.oracle.truffle.api.dsl.NeverDefault;
192193
import com.oracle.truffle.api.dsl.Specialization;
@@ -1186,6 +1187,7 @@ static Object[] uncached(Object[] args, int offset,
11861187
return output;
11871188
}
11881189

1190+
@Idempotent
11891191
static int effectiveLen(int len, int offset) {
11901192
return len - offset;
11911193
}
@@ -1238,6 +1240,7 @@ static Object[] uncached(Object[] args, int offset,
12381240
return output;
12391241
}
12401242

1243+
@Idempotent
12411244
static int effectiveLen(int len, int offset) {
12421245
return len - offset;
12431246
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/DynamicObjectNativeWrapper.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
import com.oracle.truffle.api.dsl.Cached.Shared;
215215
import com.oracle.truffle.api.dsl.Fallback;
216216
import com.oracle.truffle.api.dsl.GenerateUncached;
217+
import com.oracle.truffle.api.dsl.Idempotent;
217218
import com.oracle.truffle.api.dsl.ImportStatic;
218219
import com.oracle.truffle.api.dsl.Specialization;
219220
import com.oracle.truffle.api.dsl.TypeSystemReference;
@@ -329,10 +330,12 @@ static Object execute(DynamicObjectNativeWrapper object, String key,
329330
}
330331
}
331332

333+
@Idempotent
332334
protected static boolean isObBase(String key) {
333335
return OB_BASE.getMemberNameJavaString().equals(key);
334336
}
335337

338+
@Idempotent
336339
protected static boolean isObRefcnt(String key) {
337340
return OB_REFCNT.getMemberNameJavaString().equals(key);
338341
}
@@ -2163,14 +2166,17 @@ static Object execute(PrimitiveNativeWrapper object, String key,
21632166
}
21642167
}
21652168

2169+
@Idempotent
21662170
protected static boolean isObBase(String key) {
21672171
return OB_BASE.getMemberNameJavaString().equals(key);
21682172
}
21692173

2174+
@Idempotent
21702175
protected static boolean isObRefcnt(String key) {
21712176
return OB_REFCNT.getMemberNameJavaString().equals(key);
21722177
}
21732178

2179+
@Idempotent
21742180
protected static boolean isObType(String key) {
21752181
return OB_TYPE.getMemberNameJavaString().equals(key);
21762182
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/NativeMember.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.oracle.graal.python.nodes.StringLiterals;
5050
import com.oracle.truffle.api.CompilerDirectives;
5151
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
52+
import com.oracle.truffle.api.dsl.Idempotent;
5253
import com.oracle.truffle.api.strings.TruffleString;
5354

5455
public enum NativeMember {
@@ -355,6 +356,7 @@ public static NativeMember byName(String name) {
355356
return null;
356357
}
357358

359+
@Idempotent
358360
public static boolean isValid(String name) {
359361
return byName(name) != null;
360362
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PyLongDigitsWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 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
@@ -53,6 +53,7 @@
5353
import com.oracle.truffle.api.dsl.Cached;
5454
import com.oracle.truffle.api.dsl.Cached.Exclusive;
5555
import com.oracle.truffle.api.dsl.Cached.Shared;
56+
import com.oracle.truffle.api.dsl.Idempotent;
5657
import com.oracle.truffle.api.dsl.Specialization;
5758
import com.oracle.truffle.api.interop.InteropLibrary;
5859
import com.oracle.truffle.api.interop.InvalidArrayIndexException;
@@ -251,6 +252,7 @@ static Object doByteArrayMultiCtx(@SuppressWarnings("unused") PyLongDigitsWrappe
251252
return callGetTypeIDNode.call(FUN_GET_UINT32_T_ARRAY_TYPE_ID, 0);
252253
}
253254

255+
@Idempotent
254256
protected static boolean isSingleContext() {
255257
CompilerAsserts.neverPartOfCompilation();
256258
return PythonLanguage.get(null).isSingleContext();

0 commit comments

Comments
 (0)