@@ -180,10 +180,9 @@ boolean isPythonException(VirtualFrame frame, LazyPythonClass type,
180
180
return isSubtype .execute (frame , type , PythonBuiltinClassType .PBaseException );
181
181
}
182
182
183
- @ Specialization (guards = {"emulateJython" , "context.getEnv().isHostObject(type)" }, limit = "1" )
183
+ @ Specialization (guards = {"emulateJython(context) " , "context.getEnv().isHostObject(type)" })
184
184
boolean isJavaException (@ SuppressWarnings ("unused" ) VirtualFrame frame , Object type ,
185
- @ CachedContext (PythonLanguage .class ) PythonContext context ,
186
- @ SuppressWarnings ("unused" ) @ Cached ("emulateJython(context)" ) boolean emulateJython ) {
185
+ @ CachedContext (PythonLanguage .class ) PythonContext context ) {
187
186
Object hostType = context .getEnv ().asHostObject (type );
188
187
return hostType instanceof Class && Throwable .class .isAssignableFrom ((Class <?>) hostType );
189
188
}
@@ -228,31 +227,28 @@ boolean matchPythonSingle(VirtualFrame frame, PException e, Object clause,
228
227
return isSubtype .execute (frame , plib .getLazyPythonClass (e .getExceptionObject ()), clause );
229
228
}
230
229
231
- @ Specialization (guards = {"emulateJython" , "context.getEnv().isHostException(e)" , "context.getEnv().isHostObject(clause)" }, limit = "1" )
230
+ @ Specialization (guards = {"emulateJython(context) " , "context.getEnv().isHostException(e)" , "context.getEnv().isHostObject(clause)" })
232
231
boolean matchJava (VirtualFrame frame , Throwable e , Object clause ,
233
232
@ Cached ValidExceptionNode isValidException ,
234
- @ CachedContext (PythonLanguage .class ) PythonContext context ,
235
- @ SuppressWarnings ("unused" ) @ Cached ("emulateJython(context)" ) boolean emulateJython ) {
233
+ @ CachedContext (PythonLanguage .class ) PythonContext context ) {
236
234
raiseIfNoException (frame , clause , isValidException );
237
235
// cast must succeed due to ValidExceptionNode above
238
236
Class <?> javaClause = (Class <?>) context .getEnv ().asHostObject (clause );
239
237
Throwable hostException = context .getEnv ().asHostException (e );
240
238
return javaClause .isInstance (hostException );
241
239
}
242
240
243
- @ Specialization (guards = {"emulateJython" , "context.getEnv().isHostObject(clause)" }, limit = "1" )
241
+ @ Specialization (guards = {"emulateJython(context) " , "context.getEnv().isHostObject(clause)" })
244
242
boolean doNotMatchPython (VirtualFrame frame , @ SuppressWarnings ("unused" ) PException e , Object clause ,
245
243
@ SuppressWarnings ("unused" ) @ CachedContext (PythonLanguage .class ) PythonContext context ,
246
- @ SuppressWarnings ("unused" ) @ Cached ("emulateJython(context)" ) boolean emulateJython ,
247
244
@ Cached ValidExceptionNode isValidException ) {
248
245
raiseIfNoException (frame , clause , isValidException );
249
246
return false ;
250
247
}
251
248
252
- @ Specialization (guards = {"emulateJython" , "context.getEnv().isHostException(e)" }, limit = "1" )
249
+ @ Specialization (guards = {"emulateJython(context) " , "context.getEnv().isHostException(e)" })
253
250
boolean doNotMatchJava (VirtualFrame frame , @ SuppressWarnings ("unused" ) Throwable e , LazyPythonClass clause ,
254
251
@ SuppressWarnings ("unused" ) @ CachedContext (PythonLanguage .class ) PythonContext context ,
255
- @ SuppressWarnings ("unused" ) @ Cached ("emulateJython(context)" ) boolean emulateJython ,
256
252
@ Cached ValidExceptionNode isValidException ) {
257
253
raiseIfNoException (frame , clause , isValidException );
258
254
return false ;
0 commit comments