Skip to content

Commit 8d87fda

Browse files
committed
[GR-35958] Remove PythonLanguage#singleContextAssumption.
PullRequest: graalpython/2133
2 parents beb474c + 475b34d commit 8d87fda

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
183183

184184
private static final LanguageReference<PythonLanguage> REFERENCE = LanguageReference.create(PythonLanguage.class);
185185

186-
public final Assumption singleContextAssumption = Truffle.getRuntime().createAssumption("Only a single context is active");
187-
188186
@CompilationFinal private boolean singleContext = true;
189187

190188
public boolean isSingleContext() {
@@ -732,7 +730,6 @@ private static Source newSource(PythonContext ctxt, SourceBuilder srcBuilder) th
732730
@Override
733731
protected void initializeMultipleContexts() {
734732
super.initializeMultipleContexts();
735-
singleContextAssumption.invalidate();
736733
singleContext = false;
737734
}
738735

@@ -795,7 +792,7 @@ public Shape getEmptyShape() {
795792
}
796793

797794
public Shape getShapeForClass(PythonAbstractClass klass) {
798-
if (singleContextAssumption.isValid()) {
795+
if (isSingleContext()) {
799796
return Shape.newBuilder(getEmptyShape()).addConstantProperty(HiddenAttributes.CLASS, klass, 0).build();
800797
} else {
801798
return getEmptyShape();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PNodeWithContext.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, 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
@@ -45,8 +45,6 @@
4545
import com.oracle.graal.python.runtime.PythonContext;
4646
import com.oracle.graal.python.runtime.PythonOptions;
4747
import com.oracle.graal.python.runtime.exception.ExceptionUtils;
48-
import com.oracle.truffle.api.Assumption;
49-
import com.oracle.truffle.api.CompilerAsserts;
5048
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
5149
import com.oracle.truffle.api.dsl.ImportStatic;
5250
import com.oracle.truffle.api.nodes.Node;
@@ -55,11 +53,6 @@
5553
@ImportStatic({PGuards.class, PythonOptions.class, SpecialMethodNames.class, SpecialAttributeNames.class, SpecialMethodSlot.class, BuiltinNames.class})
5654
public abstract class PNodeWithContext extends Node {
5755

58-
protected static Assumption singleContextAssumption() {
59-
CompilerAsserts.neverPartOfCompilation("the singleContextAssumption should only be retrieved in the interpreter");
60-
return PythonLanguage.get(null).singleContextAssumption;
61-
}
62-
6356
/**
6457
* @return {@code true} if this node can be shared statically.
6558
*/

0 commit comments

Comments
 (0)