Skip to content

Commit c86d4b3

Browse files
committed
Share raise nodes
1 parent ad28986 commit c86d4b3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public int lengthWithState(ThreadState state,
647647
@Exclusive @Cached ConditionProfile ltZero,
648648
@Exclusive @Cached LookupInheritedAttributeNode.Dynamic getLenNode,
649649
@Exclusive @Cached CallUnaryMethodNode callNode,
650-
@Exclusive @Cached PRaiseNode raiseNode,
650+
@Shared("raise") @Cached PRaiseNode raiseNode,
651651
@Exclusive @CachedLibrary(limit = "1") PythonObjectLibrary lib) {
652652
Object lenFunc = getLenNode.execute(this, __LEN__);
653653
if (hasLen.profile(lenFunc != PNone.NO_VALUE)) {
@@ -731,7 +731,7 @@ public boolean isTrueWithState(ThreadState state,
731731
@Exclusive @Cached ConditionProfile hasBool,
732732
@Exclusive @Cached ConditionProfile hasLen,
733733
@Exclusive @Cached CastToJavaBooleanNode castToBoolean,
734-
@Exclusive @Cached PRaiseNode raiseNode) {
734+
@Shared("raise") @Cached PRaiseNode raiseNode) {
735735
// n.b.: CPython's early returns for PyTrue/PyFalse/PyNone are handled
736736
// in the message impls in PNone and PInt
737737
Object boolMethod = lib.lookupAttributeOnType(this, __BOOL__);
@@ -771,7 +771,7 @@ public final boolean isHashable(@CachedLibrary("this") PythonObjectLibrary lib,
771771
public long hashWithState(ThreadState state,
772772
@CachedLibrary("this") PythonObjectLibrary lib,
773773
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
774-
@Exclusive @Cached PRaiseNode raise,
774+
@Shared("raise") @Cached PRaiseNode raise,
775775
@Exclusive @Cached CastToJavaLongExactNode castToLong) {
776776
Object hashMethod = lib.lookupAttributeOnType(this, __HASH__);
777777
if (!methodLib.isCallable(hashMethod)) {
@@ -824,7 +824,7 @@ public Object asIndexWithState(ThreadState state,
824824
@CachedLibrary("this") PythonObjectLibrary lib,
825825
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
826826
@CachedLibrary(limit = "5") PythonObjectLibrary resultLib,
827-
@Exclusive @Cached PRaiseNode raise,
827+
@Shared("raise") @Cached PRaiseNode raise,
828828
@Exclusive @Cached IsSubtypeNode isSubtype,
829829
@Exclusive @Cached ConditionProfile noIndex,
830830
@Exclusive @Cached ConditionProfile resultProfile) {
@@ -848,7 +848,7 @@ public Object asIndexWithState(ThreadState state,
848848
public String asPathWithState(ThreadState state,
849849
@CachedLibrary("this") PythonObjectLibrary lib,
850850
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
851-
@Exclusive @Cached PRaiseNode raise,
851+
@Shared("raise") @Cached PRaiseNode raise,
852852
@Cached CastToJavaStringNode castToJavaStringNode) {
853853
Object func = lib.lookupAttributeOnType(this, __FSPATH__);
854854
if (func == PNone.NO_VALUE) {
@@ -867,7 +867,7 @@ public Object asPStringWithState(ThreadState state,
867867
@CachedLibrary("this") PythonObjectLibrary lib,
868868
@CachedLibrary(limit = "1") PythonObjectLibrary resultLib,
869869
@Exclusive @Cached IsSubtypeNode isSubtypeNode,
870-
@Exclusive @Cached PRaiseNode raise) {
870+
@Shared("raise") @Cached PRaiseNode raise) {
871871
return asPString(lib, this, state, isSubtypeNode, resultLib, raise);
872872
}
873873

@@ -887,7 +887,7 @@ public int asFileDescriptorWithState(ThreadState state,
887887
@CachedLibrary("this") PythonObjectLibrary lib,
888888
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
889889
@CachedLibrary(limit = "1") PythonObjectLibrary libResult,
890-
@Exclusive @Cached PRaiseNode raiseNode,
890+
@Shared("raise") @Cached PRaiseNode raiseNode,
891891
@Exclusive @Cached BranchProfile noFilenoMethodProfile,
892892
@Exclusive @Cached IsBuiltinClassProfile isIntProfile,
893893
@Exclusive @Cached CastToJavaIntExactNode castToJavaIntNode,
@@ -1058,7 +1058,7 @@ public Object lookupAndCallRegularMethodWithState(ThreadState state, String meth
10581058
public Object asPIntWithState(ThreadState state,
10591059
@CachedLibrary("this") PythonObjectLibrary lib,
10601060
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
1061-
@Exclusive @Cached PRaiseNode raise,
1061+
@Shared("raise") @Cached PRaiseNode raise,
10621062
@Exclusive @Cached ConditionProfile hasIndexFunc,
10631063
@Exclusive @Cached ConditionProfile hasIntFunc) {
10641064
Object result = PNone.NO_VALUE;
@@ -1085,7 +1085,7 @@ public int asSizeWithState(Object type, ThreadState state,
10851085
@CachedLibrary("this") PythonObjectLibrary lib,
10861086
@Exclusive @Cached BranchProfile overflow,
10871087
@Exclusive @Cached ConditionProfile ignoreOverflow,
1088-
@Exclusive @Cached PRaiseNode raise,
1088+
@Shared("raise") @Cached PRaiseNode raise,
10891089
@Exclusive @Cached CastToJavaLongLossyNode castToLong) {
10901090
Object result = lib.asIndexWithState(this, state);
10911091
long longResult;
@@ -1119,7 +1119,7 @@ public double asJavaDoubleWithState(ThreadState state,
11191119
@Exclusive @Cached ConditionProfile hasIndexFunc,
11201120
@Exclusive @Cached CastToJavaDoubleNode castToDouble,
11211121
@Exclusive @Cached ConditionProfile hasFloatFunc,
1122-
@Exclusive @Cached PRaiseNode raise) {
1122+
@Shared("raise") @Cached PRaiseNode raise) {
11231123

11241124
assert !MathGuards.isNumber(this) : this.getClass().getSimpleName();
11251125

@@ -1147,7 +1147,7 @@ public long asJavaLongWithState(ThreadState state,
11471147
@CachedLibrary("this") PythonObjectLibrary lib,
11481148
@Shared("methodLib") @CachedLibrary(limit = "2") PythonObjectLibrary methodLib,
11491149
@Exclusive @Cached CastToJavaLongExactNode castToLong,
1150-
@Exclusive @Cached PRaiseNode raise) {
1150+
@Shared("raise") @Cached PRaiseNode raise) {
11511151

11521152
assert !MathGuards.isNumber(this) : this.getClass().getSimpleName();
11531153

0 commit comments

Comments
 (0)