@@ -643,9 +643,9 @@ public boolean isSequence(@CachedLibrary("this") PythonObjectLibrary plib,
643
643
644
644
@ ExportMessage
645
645
public int lengthWithState (ThreadState state ,
646
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile gotState ,
647
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile hasLen ,
648
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile ltZero ,
646
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
647
+ @ Exclusive @ Cached ConditionProfile hasLen ,
648
+ @ Exclusive @ Cached ConditionProfile ltZero ,
649
649
@ Exclusive @ Cached LookupInheritedAttributeNode .Dynamic getLenNode ,
650
650
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
651
651
@ Exclusive @ Cached PRaiseNode raiseNode ,
@@ -737,9 +737,9 @@ public final boolean isCallable(@Exclusive @Cached LookupInheritedAttributeNode.
737
737
738
738
@ ExportMessage
739
739
public boolean isTrueWithState (ThreadState state ,
740
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile gotState ,
741
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile hasBool ,
742
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile hasLen ,
740
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
741
+ @ Exclusive @ Cached ConditionProfile hasBool ,
742
+ @ Exclusive @ Cached ConditionProfile hasLen ,
743
743
@ Exclusive @ Cached LookupInheritedAttributeNode .Dynamic lookupAttrs ,
744
744
@ Exclusive @ Cached CastToJavaBooleanNode castToBoolean ,
745
745
@ Exclusive @ Cached PRaiseNode raiseNode ,
@@ -788,7 +788,7 @@ public final boolean isHashable(@Exclusive @Cached LookupInheritedAttributeNode.
788
788
789
789
@ ExportMessage
790
790
public long hashWithState (ThreadState state ,
791
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile gotState ,
791
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
792
792
@ Exclusive @ Cached LookupInheritedAttributeNode .Dynamic lookupHashAttributeNode ,
793
793
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
794
794
@ Exclusive @ Cached PRaiseNode raise ,
@@ -819,7 +819,7 @@ public boolean isSame(Object other,
819
819
@ ExportMessage
820
820
public int equalsInternal (Object other , ThreadState state ,
821
821
@ CachedLibrary (limit = "3" ) PythonObjectLibrary lib ,
822
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile gotState ,
822
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
823
823
@ Shared ("isNode" ) @ Cached IsNode isNode ,
824
824
@ Exclusive @ Cached CallBinaryMethodNode callNode ,
825
825
@ Exclusive @ Cached LookupInheritedAttributeNode .Dynamic lookupEqAttrNode ) {
@@ -869,7 +869,7 @@ public Object asIndexWithState(ThreadState state,
869
869
@ Shared ("asIndexLookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookupIndex ,
870
870
@ Exclusive @ Cached ("createBinaryProfile()" ) ConditionProfile noIndex ,
871
871
@ Exclusive @ Cached ("createBinaryProfile()" ) ConditionProfile resultProfile ,
872
- @ Exclusive @ Cached ( "createBinaryProfile()" ) ConditionProfile gotState ) {
872
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ) {
873
873
// n.b.: the CPython shortcut "if (PyLong_Check(item)) return item;" is
874
874
// implemented in the specific Java classes PInt, PythonNativeVoidPtr,
875
875
// and PythonAbstractNativeObject and dispatched polymorphically
@@ -897,7 +897,7 @@ public String asPathWithState(ThreadState state,
897
897
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
898
898
@ Exclusive @ Cached PRaiseNode raise ,
899
899
@ Cached CastToJavaStringNode castToJavaStringNode ,
900
- @ Exclusive @ Cached ConditionProfile gotState ) {
900
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ) {
901
901
Object func = lookup .execute (this , __FSPATH__ );
902
902
if (func == PNone .NO_VALUE ) {
903
903
throw raise .raise (PythonBuiltinClassType .TypeError , ErrorMessages .EXPECTED_STR_BYTE_OSPATHLIKE_OBJ , this );
@@ -922,7 +922,7 @@ public Object asPStringWithState(ThreadState state,
922
922
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
923
923
@ Exclusive @ Cached IsSubtypeNode isSubtypeNode ,
924
924
@ Exclusive @ Cached PRaiseNode raise ,
925
- @ Exclusive @ Cached ConditionProfile gotState ) {
925
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ) {
926
926
return asPString (this , lookup , gotState , state , callNode , isSubtypeNode , lib , raise );
927
927
}
928
928
@@ -952,7 +952,7 @@ public int asFileDescriptorWithState(ThreadState state,
952
952
@ Exclusive @ Cached PRaiseNode raiseNode ,
953
953
@ Exclusive @ Cached BranchProfile noFilenoMethodProfile ,
954
954
@ Exclusive @ Cached IsBuiltinClassProfile isIntProfile ,
955
- @ Exclusive @ Cached ConditionProfile gotState ,
955
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
956
956
@ Exclusive @ Cached CastToJavaIntExactNode castToJavaIntNode ,
957
957
@ Exclusive @ Cached IsBuiltinClassProfile isAttrError ) {
958
958
@@ -1037,10 +1037,10 @@ public static Object lookupAttributeImpl(Object receiver, String name, boolean i
1037
1037
1038
1038
@ ExportMessage
1039
1039
public Object callFunctionWithState (ThreadState state , Object [] arguments ,
1040
- @ Exclusive @ Cached ConditionProfile hasStateProfile ,
1040
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
1041
1041
@ Exclusive @ Cached CallNode callNode ) {
1042
1042
VirtualFrame frame = null ;
1043
- if (hasStateProfile .profile (state != null )) {
1043
+ if (gotState .profile (state != null )) {
1044
1044
frame = PArguments .frameForCall (state );
1045
1045
}
1046
1046
return callNode .execute (frame , this , arguments );
@@ -1065,12 +1065,12 @@ public abstract static class CallUnboundMethodNode extends Node {
1065
1065
@ Specialization (limit = "3" )
1066
1066
Object getAndCall (ThreadState state , Object method , boolean ignoreGetException , Object receiver , Object [] arguments ,
1067
1067
@ CachedLibrary ("receiver" ) PythonObjectLibrary plib ,
1068
- @ Cached ConditionProfile hasStateProfile ,
1068
+ @ Cached ConditionProfile gotState ,
1069
1069
@ Cached LookupInheritedAttributeNode .Dynamic lookupGet ,
1070
1070
@ Cached CallNode callGet ,
1071
1071
@ Cached CallNode callMethod ) {
1072
1072
VirtualFrame frame = null ;
1073
- if (hasStateProfile .profile (state != null )) {
1073
+ if (gotState .profile (state != null )) {
1074
1074
frame = PArguments .frameForCall (state );
1075
1075
}
1076
1076
Object get = lookupGet .execute (method , __GET__ );
@@ -1115,7 +1115,7 @@ public Object asPIntWithState(ThreadState state,
1115
1115
@ Shared ("asPIntLookupAttr" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
1116
1116
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
1117
1117
@ Exclusive @ Cached PRaiseNode raise ,
1118
- @ Exclusive @ Cached ConditionProfile gotState ,
1118
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
1119
1119
@ CachedLibrary ("this" ) PythonObjectLibrary lib ,
1120
1120
@ Exclusive @ Cached ConditionProfile hasIndexFunc ,
1121
1121
@ Exclusive @ Cached ConditionProfile hasIntFunc ) {
@@ -1186,7 +1186,7 @@ public double asJavaDoubleWithState(ThreadState state,
1186
1186
@ Exclusive @ Cached () ConditionProfile hasIndexFunc ,
1187
1187
@ Shared ("asJavaLookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
1188
1188
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
1189
- @ Exclusive @ Cached ConditionProfile gotState ,
1189
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
1190
1190
@ Exclusive @ Cached CastToJavaDoubleNode castToDouble ,
1191
1191
@ Exclusive @ Cached () ConditionProfile hasFloatFunc ,
1192
1192
@ Exclusive @ Cached PRaiseNode raise ) {
@@ -1227,7 +1227,7 @@ public boolean canBeJavaLong(
1227
1227
public long asJavaLongWithState (ThreadState state ,
1228
1228
@ Shared ("asJavaLongLookup" ) @ Cached LookupInheritedAttributeNode .Dynamic lookup ,
1229
1229
@ Exclusive @ Cached CallUnaryMethodNode callNode ,
1230
- @ Exclusive @ Cached ConditionProfile gotState ,
1230
+ @ Shared ( "gotState" ) @ Cached ConditionProfile gotState ,
1231
1231
@ Exclusive @ Cached CastToJavaLongExactNode castToLong ,
1232
1232
@ Exclusive @ Cached PRaiseNode raise ) {
1233
1233
0 commit comments