89
89
import com .oracle .graal .python .runtime .exception .PythonErrorType ;
90
90
import com .oracle .graal .python .runtime .sequence .storage .SequenceStorage ;
91
91
import com .oracle .truffle .api .CompilerDirectives ;
92
+ import com .oracle .truffle .api .CompilerDirectives .ValueType ;
92
93
import com .oracle .truffle .api .dsl .Bind ;
93
94
import com .oracle .truffle .api .dsl .Cached ;
94
95
import com .oracle .truffle .api .dsl .Cached .Shared ;
@@ -347,20 +348,20 @@ static Object doSetTraceback(Object self, PTraceback tb,
347
348
@ GenerateNodeFactory
348
349
abstract static class DictNode extends PythonBinaryBuiltinNode {
349
350
@ Specialization
350
- static PNone dict (PBaseException self , PDict mapping ,
351
+ static PNone dict (Object self , PDict mapping ,
351
352
@ Cached SetDictNode setDict ) {
352
353
setDict .execute (self , mapping );
353
354
return PNone .NONE ;
354
355
}
355
356
356
357
@ Specialization (guards = "isNoValue(mapping)" )
357
- Object dict (PBaseException self , @ SuppressWarnings ("unused" ) PNone mapping ,
358
+ Object dict (Object self , @ SuppressWarnings ("unused" ) PNone mapping ,
358
359
@ Cached GetOrCreateDictNode getDict ) {
359
360
return getDict .execute (self );
360
361
}
361
362
362
363
@ Specialization (guards = {"!isNoValue(mapping)" , "!isDict(mapping)" })
363
- PNone dict (@ SuppressWarnings ("unused" ) PBaseException self , Object mapping ) {
364
+ PNone dict (@ SuppressWarnings ("unused" ) Object self , Object mapping ) {
364
365
throw raise (TypeError , ErrorMessages .DICT_MUST_BE_SET_TO_DICT , mapping );
365
366
}
366
367
}
@@ -449,12 +450,12 @@ Object str(VirtualFrame frame, Object self,
449
450
@ Builtin (name = J___SETSTATE__ , minNumOfPositionalArgs = 2 )
450
451
@ GenerateNodeFactory
451
452
public abstract static class BaseExceptionSetStateNode extends PythonBinaryBuiltinNode {
452
- @ CompilerDirectives . ValueType
453
+ @ ValueType
453
454
static final class ExcState {
454
455
private final HashingStorage dictStorage ;
455
- private final PBaseException exception ;
456
+ private final Object exception ;
456
457
457
- ExcState (HashingStorage dictStorage , PBaseException exception ) {
458
+ ExcState (HashingStorage dictStorage , Object exception ) {
458
459
this .dictStorage = dictStorage ;
459
460
this .exception = exception ;
460
461
}
@@ -479,7 +480,7 @@ public static ExcState doIt(Frame frame, @SuppressWarnings("unused") Node inlini
479
480
}
480
481
481
482
@ Specialization
482
- Object setDict (VirtualFrame frame , PBaseException self , PDict state ,
483
+ Object setDict (VirtualFrame frame , Object self , PDict state ,
483
484
@ Cached ForEachKW forEachKW ,
484
485
@ Cached HashingStorageForEach forEachNode ) {
485
486
final HashingStorage dictStorage = state .getDictStorage ();
@@ -488,7 +489,7 @@ Object setDict(VirtualFrame frame, PBaseException self, PDict state,
488
489
}
489
490
490
491
@ Specialization (guards = "!isDict(state)" )
491
- Object generic (@ SuppressWarnings ("unused" ) PBaseException self , Object state ) {
492
+ Object generic (@ SuppressWarnings ("unused" ) Object self , Object state ) {
492
493
if (state != PNone .NONE ) {
493
494
throw raise (TypeError , STATE_IS_NOT_A_DICT );
494
495
}
0 commit comments