208
208
import com .oracle .graal .python .nodes .util .CastToJavaStringNodeGen ;
209
209
import com .oracle .graal .python .nodes .util .SplitArgsNode ;
210
210
import com .oracle .graal .python .runtime .ExecutionContext .ForeignCallContext ;
211
- import com .oracle .graal .python .runtime .ExecutionContext .IndirectCallContext ;
212
211
import com .oracle .graal .python .runtime .PythonContext ;
213
212
import com .oracle .graal .python .runtime .PythonCore ;
214
213
import com .oracle .graal .python .runtime .exception .PException ;
@@ -2879,18 +2878,12 @@ Object methodBuiltin(@SuppressWarnings("unused") Object cls, PBuiltinFunction fu
2879
2878
}
2880
2879
2881
2880
@ Specialization
2882
- Object methodGeneric (VirtualFrame frame , @ SuppressWarnings ("unused" ) Object cls , Object func , Object self ,
2881
+ Object methodGeneric (@ SuppressWarnings ("unused" ) Object cls , Object func , Object self ,
2883
2882
@ CachedLibrary (limit = "3" ) PythonObjectLibrary dataModelLibrary ) {
2884
- PythonContext context = getContextRef ().get ();
2885
- Object state = IndirectCallContext .enter (frame , context , this );
2886
- try {
2887
- if (dataModelLibrary .isCallable (func )) {
2888
- return factory ().createMethod (self , func );
2889
- } else {
2890
- throw raise (TypeError , ErrorMessages .FIRST_ARG_MUST_BE_CALLABLE );
2891
- }
2892
- } finally {
2893
- IndirectCallContext .exit (frame , context , state );
2883
+ if (dataModelLibrary .isCallable (func )) {
2884
+ return factory ().createMethod (self , func );
2885
+ } else {
2886
+ throw raise (TypeError , ErrorMessages .FIRST_ARG_MUST_BE_CALLABLE );
2894
2887
}
2895
2888
}
2896
2889
}
@@ -3061,8 +3054,8 @@ Object initArgs(Object cls, Object[] args, @SuppressWarnings("unused") PKeyword[
3061
3054
@ Builtin (name = "mappingproxy" , constructsClass = PythonBuiltinClassType .PMappingproxy , isPublic = false , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 2 )
3062
3055
@ GenerateNodeFactory
3063
3056
public abstract static class MappingproxyNode extends PythonBuiltinNode {
3064
- @ Specialization (guards = "isMapping(frame, obj, lib)" , limit = "1" )
3065
- Object doMapping (@ SuppressWarnings ( "unused" ) VirtualFrame frame , Object klass , PythonObject obj ,
3057
+ @ Specialization (guards = "isMapping(obj, lib)" , limit = "1" )
3058
+ Object doMapping (Object klass , PythonObject obj ,
3066
3059
@ SuppressWarnings ("unused" ) @ CachedLibrary ("obj" ) PythonObjectLibrary lib ) {
3067
3060
return factory ().createMappingproxy (klass , obj );
3068
3061
}
@@ -3073,23 +3066,17 @@ Object doMissing(Object klass, PNone none) {
3073
3066
throw raise (TypeError , ErrorMessages .MISSING_D_REQUIRED_S_ARGUMENT_S_POS , "mappingproxy()" , "mapping" , 1 );
3074
3067
}
3075
3068
3076
- @ Specialization (guards = {"!isMapping(frame, obj, lib)" , "!isNoValue(obj)" }, limit = "1" )
3077
- Object doInvalid (@ SuppressWarnings ("unused" ) VirtualFrame frame , @ SuppressWarnings ( "unused" ) Object klass , Object obj ,
3069
+ @ Specialization (guards = {"!isMapping(obj, lib)" , "!isNoValue(obj)" }, limit = "1" )
3070
+ Object doInvalid (@ SuppressWarnings ("unused" ) Object klass , Object obj ,
3078
3071
@ SuppressWarnings ("unused" ) @ CachedLibrary ("obj" ) PythonObjectLibrary lib ) {
3079
3072
throw raise (TypeError , ErrorMessages .ARG_MUST_BE_S_NOT_P , "mappingproxy()" , "mapping" , obj );
3080
3073
}
3081
3074
3082
- protected boolean isMapping (VirtualFrame frame , Object o , PythonObjectLibrary library ) {
3083
- PythonContext context = getContextRef ().get ();
3075
+ protected boolean isMapping (Object o , PythonObjectLibrary library ) {
3084
3076
if (o instanceof PList || o instanceof PTuple ) {
3085
3077
return false ;
3086
3078
}
3087
- Object state = IndirectCallContext .enter (frame , context , this );
3088
- try {
3089
- return library .isMapping (o );
3090
- } finally {
3091
- IndirectCallContext .exit (frame , context , state );
3092
- }
3079
+ return library .isMapping (o );
3093
3080
}
3094
3081
}
3095
3082
0 commit comments