227
227
import com .oracle .graal .python .nodes .function .builtins .PythonVarargsBuiltinNode ;
228
228
import com .oracle .graal .python .nodes .function .builtins .clinic .ArgumentClinicProvider ;
229
229
import com .oracle .graal .python .nodes .object .BuiltinClassProfiles .IsBuiltinObjectProfile ;
230
- import com .oracle .graal .python .nodes .object .GetClassNode ;
231
230
import com .oracle .graal .python .nodes .object .GetOrCreateDictNode ;
232
231
import com .oracle .graal .python .nodes .object .InlinedGetClassNode ;
233
232
import com .oracle .graal .python .nodes .object .InlinedGetClassNode .GetPythonObjectClassNode ;
@@ -486,6 +485,7 @@ static boolean doHashColl(VirtualFrame frame, PHashingCollection object,
486
485
}
487
486
488
487
@ Specialization
488
+ @ SuppressWarnings ("truffle-static-method" )
489
489
boolean doObject (VirtualFrame frame , Object object ,
490
490
@ Bind ("this" ) Node inliningTarget ,
491
491
@ Cached PyObjectGetIter getIter ,
@@ -543,6 +543,7 @@ static boolean doHashColl(VirtualFrame frame, PHashingCollection object,
543
543
}
544
544
545
545
@ Specialization
546
+ @ SuppressWarnings ("truffle-static-method" )
546
547
boolean doObject (VirtualFrame frame , Object object ,
547
548
@ Bind ("this" ) Node inliningTarget ,
548
549
@ Cached PyObjectGetIter getIter ,
@@ -639,6 +640,7 @@ TruffleString doPI(PInt x,
639
640
}
640
641
641
642
@ Specialization (replaces = {"doL" , "doD" , "doPI" })
643
+ @ SuppressWarnings ("truffle-static-method" )
642
644
TruffleString doO (VirtualFrame frame , Object x ,
643
645
@ Bind ("this" ) Node inliningTarget ,
644
646
@ Cached InlinedConditionProfile isMinLong ,
@@ -1305,7 +1307,7 @@ public static GetAttrNode create() {
1305
1307
1306
1308
public abstract Object executeWithArgs (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue );
1307
1309
1308
- @ SuppressWarnings ("unused" )
1310
+ @ SuppressWarnings ({ "unused" , "truffle-static-method" } )
1309
1311
@ Specialization (limit = "getAttributeAccessInlineCacheMaxDepth()" , guards = {"stringEquals(cachedName, name, equalNode, inliningTarget, stringProfile)" , "isNoValue(defaultValue)" })
1310
1312
public Object getAttrDefault (VirtualFrame frame , Object primary , TruffleString name , PNone defaultValue ,
1311
1313
@ Bind ("this" ) Node inliningTarget ,
@@ -1316,7 +1318,7 @@ public Object getAttrDefault(VirtualFrame frame, Object primary, TruffleString n
1316
1318
return getAttributeNode .executeObject (frame , primary );
1317
1319
}
1318
1320
1319
- @ SuppressWarnings ("unused" )
1321
+ @ SuppressWarnings ({ "unused" , "truffle-static-method" } )
1320
1322
@ Specialization (limit = "getAttributeAccessInlineCacheMaxDepth()" , guards = {"stringEquals(cachedName, name, equalNode, inliningTarget, stringProfile)" , "!isNoValue(defaultValue)" })
1321
1323
Object getAttr (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue ,
1322
1324
@ Bind ("this" ) Node inliningTarget ,
@@ -1340,6 +1342,7 @@ Object getAttrFromObject(VirtualFrame frame, Object primary, TruffleString name,
1340
1342
}
1341
1343
1342
1344
@ Specialization (replaces = {"getAttr" , "getAttrDefault" }, guards = "!isNoValue(defaultValue)" )
1345
+ @ SuppressWarnings ("truffle-static-method" )
1343
1346
Object getAttrFromObject (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue ,
1344
1347
@ Bind ("this" ) Node inliningTarget ,
1345
1348
@ Cached GetAnyAttributeNode getAttributeNode ,
@@ -1509,13 +1512,14 @@ private static TriState isInstanceCheckInternal(VirtualFrame frame, Object insta
1509
1512
1510
1513
@ Specialization (guards = "isPythonClass(cls)" )
1511
1514
static boolean isInstance (VirtualFrame frame , Object instance , Object cls ,
1515
+ @ Bind ("this" ) Node inliningTarget ,
1512
1516
@ Shared ("instanceCheck" ) @ Cached ("create(InstanceCheck)" ) LookupAndCallBinaryNode instanceCheckNode ,
1513
1517
@ Shared ("boolCast" ) @ Cached ("createIfTrueNode()" ) CoerceToBooleanNode castToBooleanNode ,
1514
- @ Cached GetClassNode getClassNode ,
1515
- @ Cached TypeNodes .IsSameTypeNode isSameTypeNode ,
1518
+ @ Cached InlinedGetClassNode getClassNode ,
1519
+ @ Cached TypeNodes .InlinedIsSameTypeNode isSameTypeNode ,
1516
1520
@ Cached IsSubtypeNode isSubtypeNode ) {
1517
- Object instanceClass = getClassNode .execute (instance );
1518
- return isSameTypeNode .execute (instanceClass , cls ) || isSubtypeNode .execute (frame , instanceClass , cls )//
1521
+ Object instanceClass = getClassNode .execute (inliningTarget , instance );
1522
+ return isSameTypeNode .execute (inliningTarget , instanceClass , cls ) || isSubtypeNode .execute (frame , instanceClass , cls )//
1519
1523
|| isInstanceCheckInternal (frame , instance , cls , instanceCheckNode , castToBooleanNode ) == TriState .TRUE ;
1520
1524
}
1521
1525
@@ -2165,19 +2169,19 @@ public abstract static class SumFunctionNode extends PythonBuiltinNode {
2165
2169
@ Specialization (rewriteOn = UnexpectedResultException .class )
2166
2170
int sumIntNone (VirtualFrame frame , Object arg1 , @ SuppressWarnings ("unused" ) PNone start ,
2167
2171
@ Bind ("this" ) Node inliningTarget ,
2168
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile1 ,
2169
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile2 ,
2170
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile3 ,
2172
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile1 ,
2173
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile2 ,
2174
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile3 ,
2171
2175
@ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
2172
2176
return sumIntInternal (frame , arg1 , 0 , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
2173
2177
}
2174
2178
2175
2179
@ Specialization (rewriteOn = UnexpectedResultException .class )
2176
2180
int sumIntInt (VirtualFrame frame , Object arg1 , int start ,
2177
2181
@ Bind ("this" ) Node inliningTarget ,
2178
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile1 ,
2179
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile2 ,
2180
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile3 ,
2182
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile1 ,
2183
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile2 ,
2184
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile3 ,
2181
2185
@ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
2182
2186
return sumIntInternal (frame , arg1 , start , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
2183
2187
}
@@ -2209,9 +2213,9 @@ private int sumIntInternal(VirtualFrame frame, Object arg1, int start, PyObjectG
2209
2213
@ Specialization (rewriteOn = UnexpectedResultException .class )
2210
2214
double sumDoubleDouble (VirtualFrame frame , Object arg1 , double start ,
2211
2215
@ Bind ("this" ) Node inliningTarget ,
2212
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile1 ,
2213
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile2 ,
2214
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile3 ,
2216
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile1 ,
2217
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile2 ,
2218
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile3 ,
2215
2219
@ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
2216
2220
return sumDoubleInternal (frame , arg1 , start , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
2217
2221
}
@@ -2243,7 +2247,7 @@ private double sumDoubleInternal(VirtualFrame frame, Object arg1, double start,
2243
2247
@ Specialization (replaces = {"sumIntNone" , "sumIntInt" , "sumDoubleDouble" })
2244
2248
Object sum (VirtualFrame frame , Object arg1 , Object start ,
2245
2249
@ Bind ("this" ) Node inliningTarget ,
2246
- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile1 ,
2250
+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile1 ,
2247
2251
@ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ,
2248
2252
@ Cached InlinedConditionProfile hasStart ) {
2249
2253
if (PGuards .isString (start )) {
@@ -2407,7 +2411,8 @@ abstract static class CalculateMetaclassNode extends PNodeWithRaise {
2407
2411
/* Determine the most derived metatype. */
2408
2412
@ Specialization
2409
2413
Object calculate (Object metatype , PTuple bases ,
2410
- @ Cached GetClassNode getClass ,
2414
+ @ Bind ("this" ) Node inliningTarget ,
2415
+ @ Cached InlinedGetClassNode getClass ,
2411
2416
@ Cached IsSubtypeNode isSubType ,
2412
2417
@ Cached IsSubtypeNode isSubTypeReverse ) {
2413
2418
CompilerAsserts .neverPartOfCompilation ();
@@ -2422,7 +2427,7 @@ Object calculate(Object metatype, PTuple bases,
2422
2427
Object winner = metatype ;
2423
2428
for (int i = 0 ; i < nbases ; i ++) {
2424
2429
Object tmp = storage .getItemNormalized (i );
2425
- Object tmpType = getClass .execute (tmp );
2430
+ Object tmpType = getClass .execute (inliningTarget , tmp );
2426
2431
if (isSubType .execute (winner , tmpType )) {
2427
2432
// nothing to do
2428
2433
} else if (isSubTypeReverse .execute (tmpType , winner )) {
0 commit comments