Skip to content

Commit a5fcc1b

Browse files
committed
[GR-21590] Update imports
PullRequest: graalpython/2403
2 parents c00d7ba + cea4aa8 commit a5fcc1b

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "17edbb52412c55f5a3903eededc75bf33371bd49" }
1+
{ "overlay": "3574d704e1a0beb8d217ea2dbde16158ead449d3" }

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ public static void main(String[] args) {
104104

105105
boolean useASTInterpreter = false;
106106

107+
private String toolInstrumentWarning = null;
108+
107109
protected static void setStartupTime() {
108110
if (GraalPythonMain.startupNanoTime == -1) {
109111
GraalPythonMain.startupNanoTime = System.nanoTime();
@@ -124,7 +126,6 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
124126
List<String> subprocessArgs = new ArrayList<>();
125127
programArgs = new ArrayList<>();
126128
boolean posixBackendSpecified = false;
127-
boolean toolInstrumentWarning = true;
128129
for (Iterator<String> argumentIterator = arguments.iterator(); argumentIterator.hasNext();) {
129130
String arg = argumentIterator.next();
130131
if (arg.startsWith("-")) {
@@ -203,10 +204,7 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
203204
if (argStartsWith(arg, "--agentscript", "--coverage", "--cpusampler", "--cputracer", "--dap",
204205
"--heap.", "--heapmonitor", "--insight", "--inspect", "--lsp", "--memtracer", "--sandbox.")) {
205206
useASTInterpreter = true;
206-
if (toolInstrumentWarning) {
207-
toolInstrumentWarning = false;
208-
System.out.println("WARNING: Switching to AST interpreter due to instruments option " + arg);
209-
}
207+
toolInstrumentWarning = "WARNING: Switching to AST interpreter due to instruments option " + arg;
210208
} else if (arg.startsWith("--llvm.") ||
211209
matchesPythonOption(arg, "CoreHome") ||
212210
matchesPythonOption(arg, "StdLibHome") ||
@@ -620,6 +618,10 @@ protected void launch(Builder contextBuilder) {
620618
contextBuilder.option("python.PyCachePrefix", "/dev/null");
621619
contextBuilder.option("python.EnableBytecodeInterpreter", "false");
622620
contextBuilder.option("python.DisableFrozenModules", "true");
621+
if (toolInstrumentWarning != null) {
622+
System.out.println(toolInstrumentWarning);
623+
toolInstrumentWarning = null;
624+
}
623625
} else {
624626
contextBuilder.option("python.DontWriteBytecodeFlag", Boolean.toString(dontWriteBytecode));
625627
if (cachePrefix != null) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/PythonBuiltinClassType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import com.oracle.graal.python.builtins.objects.function.BuiltinMethodDescriptor;
6363
import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
6464
import com.oracle.graal.python.runtime.PythonContext;
65-
import com.oracle.graal.python.util.PythonUtils;
6665
import com.oracle.truffle.api.CompilerAsserts;
6766
import com.oracle.truffle.api.CompilerDirectives;
6867
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
@@ -732,7 +731,9 @@ public final Shape getInstanceShape(PythonLanguage lang) {
732731

733732
Empty.base = Exception;
734733

735-
HashSet<String> set = PythonUtils.ASSERTIONS_ENABLED ? new HashSet<>() : null;
734+
boolean assertionsEnabled = false;
735+
assert (assertionsEnabled = true) == true;
736+
HashSet<String> set = assertionsEnabled ? new HashSet<>() : null;
736737
for (PythonBuiltinClassType type : VALUES) {
737738
// check uniqueness
738739
assert set.add("" + type.moduleName + "." + type.name) : type.name();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/ObjectHashMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ private void compact() {
768768
if (collision) {
769769
markCollision(i);
770770
}
771-
} else if (PythonUtils.ASSERTIONS_ENABLED && index == DUMMY_INDEX) {
771+
} else if (index == DUMMY_INDEX) {
772772
dummyCount--;
773773
}
774774
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,11 +1223,6 @@ public byte[] getHashSecret() {
12231223
}
12241224

12251225
public boolean isInitialized() {
1226-
if (PythonUtils.ASSERTIONS_ENABLED && isInitializedNonCompilationFinal != isInitialized) {
1227-
// We cannot use normal assertion, because those are removed in compilation
1228-
CompilerDirectives.transferToInterpreterAndInvalidate();
1229-
throw CompilerDirectives.shouldNotReachHere(String.format("%b != %b", isInitializedNonCompilationFinal, isInitialized));
1230-
}
12311226
return isInitialized;
12321227
}
12331228

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/util/PythonUtils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ public final class PythonUtils {
9999
public static final PCell[] NO_CLOSURE = new PCell[0];
100100
public static final ByteArraySupport arrayAccessor;
101101
public static final ConditionProfile[] DISABLED = new ConditionProfile[]{ConditionProfile.getUncached()};
102-
public static final boolean ASSERTIONS_ENABLED;
103102

104103
static {
105104
if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
106105
arrayAccessor = ByteArraySupport.bigEndian();
107106
} else {
108107
arrayAccessor = ByteArraySupport.littleEndian();
109108
}
110-
boolean ae = false;
111-
assert (ae = true) == true;
112-
ASSERTIONS_ENABLED = ae;
113109
}
114110

115111
private PythonUtils() {

mx.graalpython/suite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@
4444
},
4545
{
4646
"name": "tools",
47-
"version": "410584369e346f9000b59475c381dec882acfb70",
47+
"version": "027c48a30c9f18a8753c0b959d1a0e5b5f64c0af",
4848
"subdir": True,
4949
"urls": [
5050
{"url": "https://github.com/oracle/graal", "kind": "git"},
5151
],
5252
},
5353
{
5454
"name": "sulong",
55-
"version": "410584369e346f9000b59475c381dec882acfb70",
55+
"version": "027c48a30c9f18a8753c0b959d1a0e5b5f64c0af",
5656
"subdir": True,
5757
"urls": [
5858
{"url": "https://github.com/oracle/graal", "kind": "git"},
5959
]
6060
},
6161
{
6262
"name": "regex",
63-
"version": "410584369e346f9000b59475c381dec882acfb70",
63+
"version": "027c48a30c9f18a8753c0b959d1a0e5b5f64c0af",
6464
"subdir": True,
6565
"urls": [
6666
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)