47
47
import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
48
48
import com .oracle .graal .python .builtins .modules .WarningsModuleBuiltins ;
49
49
import com .oracle .graal .python .builtins .objects .PNone ;
50
- import com .oracle .graal .python .builtins .objects .PythonAbstractObject ;
51
50
import com .oracle .graal .python .builtins .objects .cext .PythonAbstractNativeObject ;
52
51
import com .oracle .graal .python .builtins .objects .ints .PInt ;
53
52
import com .oracle .graal .python .nodes .ErrorMessages ;
@@ -100,7 +99,7 @@ static PInt doPInt(PInt object) {
100
99
}
101
100
102
101
@ Specialization (rewriteOn = UnexpectedResultException .class )
103
- int doCallIndexInt (VirtualFrame frame , PythonAbstractObject object ,
102
+ int doCallIndexInt (VirtualFrame frame , Object object ,
104
103
@ Shared ("callIndex" ) @ Cached CallIndexNode callIndex ,
105
104
@ Shared ("getClass" ) @ Cached GetClassNode getClassNode ,
106
105
@ Shared ("isSubtype" ) @ Cached IsSubtypeNode isSubtype ) throws UnexpectedResultException {
@@ -123,17 +122,16 @@ int doCallIndexInt(VirtualFrame frame, PythonAbstractObject object,
123
122
}
124
123
}
125
124
126
- // TODO: Accept "Object" again once GR-30482 is fixed
127
125
@ Specialization (replaces = "doCallIndexInt" )
128
- static Object doCallIndex (VirtualFrame frame , PythonAbstractObject object ,
126
+ static Object doCallIndex (VirtualFrame frame , Object object ,
129
127
@ Shared ("callIndex" ) @ Cached CallIndexNode callIndex ,
130
128
@ Shared ("getClass" ) @ Cached GetClassNode getClassNode ,
131
129
@ Shared ("isSubtype" ) @ Cached IsSubtypeNode isSubtype ,
132
- @ Shared ( "resultClass" ) @ Cached GetClassNode resultClassNode ,
133
- @ Shared ( "resultSubtype" ) @ Cached IsSubtypeNode resultSubtype ,
134
- @ Shared ( "isInt" ) @ Cached IsBuiltinClassProfile isInt ,
135
- @ Shared ( "raiseNode" ) @ Cached PRaiseNode raiseNode ,
136
- @ Shared ( "warnNode" ) @ Cached WarningsModuleBuiltins .WarnNode warnNode ) {
130
+ @ Cached GetClassNode resultClassNode ,
131
+ @ Cached IsSubtypeNode resultSubtype ,
132
+ @ Cached IsBuiltinClassProfile isInt ,
133
+ @ Cached PRaiseNode raiseNode ,
134
+ @ Cached WarningsModuleBuiltins .WarnNode warnNode ) {
137
135
if (isSubtype .execute (getClassNode .execute (object ), PythonBuiltinClassType .PInt )) {
138
136
return object ;
139
137
}
@@ -142,20 +140,6 @@ static Object doCallIndex(VirtualFrame frame, PythonAbstractObject object,
142
140
return result ;
143
141
}
144
142
145
- // TODO: Remove again once GR-30482 is fixed
146
- @ Specialization (guards = "!isAnyPythonObject(object)" )
147
- static Object doCallIndexForeign (VirtualFrame frame , Object object ,
148
- @ Shared ("callIndex" ) @ Cached CallIndexNode callIndex ,
149
- @ Shared ("resultClass" ) @ Cached GetClassNode resultClassNode ,
150
- @ Shared ("resultSubtype" ) @ Cached IsSubtypeNode resultSubtype ,
151
- @ Shared ("isInt" ) @ Cached IsBuiltinClassProfile isInt ,
152
- @ Shared ("raiseNode" ) @ Cached PRaiseNode raiseNode ,
153
- @ Shared ("warnNode" ) @ Cached WarningsModuleBuiltins .WarnNode warnNode ) {
154
- Object result = callIndex .execute (frame , object );
155
- checkResult (frame , object , result , resultClassNode , resultSubtype , isInt , raiseNode , warnNode );
156
- return result ;
157
- }
158
-
159
143
private static void checkResult (VirtualFrame frame , Object originalObject , Object result , GetClassNode getClassNode , IsSubtypeNode isSubtype , IsBuiltinClassProfile isInt , PRaiseNode raiseNode ,
160
144
WarningsModuleBuiltins .WarnNode warnNode ) {
161
145
if (!isInt .profileObject (result , PythonBuiltinClassType .PInt )) {
0 commit comments