141
141
import com .oracle .truffle .api .CompilerAsserts ;
142
142
import com .oracle .truffle .api .CompilerDirectives ;
143
143
import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
144
+ import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
144
145
import com .oracle .truffle .api .TruffleLanguage .ContextReference ;
145
146
import com .oracle .truffle .api .TruffleLogger ;
146
147
import com .oracle .truffle .api .dsl .Cached ;
@@ -3034,8 +3035,9 @@ static void doPrimitiveNativeWrapper(@SuppressWarnings("unused") Object delegate
3034
3035
@ Cached ("createCountingProfile()" ) ConditionProfile hasHandleValidAssumptionProfile ,
3035
3036
@ Shared ("contextRef" ) @ CachedContext (PythonLanguage .class ) ContextReference <PythonContext > contextRef ) {
3036
3037
assert !isSmallIntegerWrapperSingleton (contextRef , nativeWrapper ) : "clearing primitive native wrapper singleton of small integer" ;
3037
- if (hasHandleValidAssumptionProfile .profile (nativeWrapper .getHandleValidAssumption () != null )) {
3038
- nativeWrapper .getHandleValidAssumption ().invalidate ("releasing handle for native wrapper" );
3038
+ Assumption handleValidAssumption = nativeWrapper .getHandleValidAssumption ();
3039
+ if (hasHandleValidAssumptionProfile .profile (handleValidAssumption != null )) {
3040
+ invalidate (handleValidAssumption );
3039
3041
}
3040
3042
}
3041
3043
@@ -3056,6 +3058,11 @@ static void doOther(@SuppressWarnings("unused") Object delegate, @SuppressWarnin
3056
3058
// ignore
3057
3059
}
3058
3060
3061
+ @ TruffleBoundary
3062
+ private static void invalidate (Assumption assumption ) {
3063
+ assumption .invalidate ("releasing handle for native wrapper" );
3064
+ }
3065
+
3059
3066
static boolean isPrimitiveNativeWrapper (PythonNativeWrapper nativeWrapper ) {
3060
3067
return nativeWrapper instanceof PrimitiveNativeWrapper ;
3061
3068
}
0 commit comments