227227import com .oracle .graal .python .nodes .function .builtins .PythonVarargsBuiltinNode ;
228228import com .oracle .graal .python .nodes .function .builtins .clinic .ArgumentClinicProvider ;
229229import com .oracle .graal .python .nodes .object .BuiltinClassProfiles .IsBuiltinObjectProfile ;
230- import com .oracle .graal .python .nodes .object .GetClassNode ;
231230import com .oracle .graal .python .nodes .object .GetOrCreateDictNode ;
232231import com .oracle .graal .python .nodes .object .InlinedGetClassNode ;
233232import com .oracle .graal .python .nodes .object .InlinedGetClassNode .GetPythonObjectClassNode ;
@@ -486,6 +485,7 @@ static boolean doHashColl(VirtualFrame frame, PHashingCollection object,
486485 }
487486
488487 @ Specialization
488+ @ SuppressWarnings ("truffle-static-method" )
489489 boolean doObject (VirtualFrame frame , Object object ,
490490 @ Bind ("this" ) Node inliningTarget ,
491491 @ Cached PyObjectGetIter getIter ,
@@ -543,6 +543,7 @@ static boolean doHashColl(VirtualFrame frame, PHashingCollection object,
543543 }
544544
545545 @ Specialization
546+ @ SuppressWarnings ("truffle-static-method" )
546547 boolean doObject (VirtualFrame frame , Object object ,
547548 @ Bind ("this" ) Node inliningTarget ,
548549 @ Cached PyObjectGetIter getIter ,
@@ -639,6 +640,7 @@ TruffleString doPI(PInt x,
639640 }
640641
641642 @ Specialization (replaces = {"doL" , "doD" , "doPI" })
643+ @ SuppressWarnings ("truffle-static-method" )
642644 TruffleString doO (VirtualFrame frame , Object x ,
643645 @ Bind ("this" ) Node inliningTarget ,
644646 @ Cached InlinedConditionProfile isMinLong ,
@@ -1305,7 +1307,7 @@ public static GetAttrNode create() {
13051307
13061308 public abstract Object executeWithArgs (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue );
13071309
1308- @ SuppressWarnings ("unused" )
1310+ @ SuppressWarnings ({ "unused" , "truffle-static-method" } )
13091311 @ Specialization (limit = "getAttributeAccessInlineCacheMaxDepth()" , guards = {"stringEquals(cachedName, name, equalNode, inliningTarget, stringProfile)" , "isNoValue(defaultValue)" })
13101312 public Object getAttrDefault (VirtualFrame frame , Object primary , TruffleString name , PNone defaultValue ,
13111313 @ Bind ("this" ) Node inliningTarget ,
@@ -1316,7 +1318,7 @@ public Object getAttrDefault(VirtualFrame frame, Object primary, TruffleString n
13161318 return getAttributeNode .executeObject (frame , primary );
13171319 }
13181320
1319- @ SuppressWarnings ("unused" )
1321+ @ SuppressWarnings ({ "unused" , "truffle-static-method" } )
13201322 @ Specialization (limit = "getAttributeAccessInlineCacheMaxDepth()" , guards = {"stringEquals(cachedName, name, equalNode, inliningTarget, stringProfile)" , "!isNoValue(defaultValue)" })
13211323 Object getAttr (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue ,
13221324 @ Bind ("this" ) Node inliningTarget ,
@@ -1340,6 +1342,7 @@ Object getAttrFromObject(VirtualFrame frame, Object primary, TruffleString name,
13401342 }
13411343
13421344 @ Specialization (replaces = {"getAttr" , "getAttrDefault" }, guards = "!isNoValue(defaultValue)" )
1345+ @ SuppressWarnings ("truffle-static-method" )
13431346 Object getAttrFromObject (VirtualFrame frame , Object primary , TruffleString name , Object defaultValue ,
13441347 @ Bind ("this" ) Node inliningTarget ,
13451348 @ Cached GetAnyAttributeNode getAttributeNode ,
@@ -1509,13 +1512,14 @@ private static TriState isInstanceCheckInternal(VirtualFrame frame, Object insta
15091512
15101513 @ Specialization (guards = "isPythonClass(cls)" )
15111514 static boolean isInstance (VirtualFrame frame , Object instance , Object cls ,
1515+ @ Bind ("this" ) Node inliningTarget ,
15121516 @ Shared ("instanceCheck" ) @ Cached ("create(InstanceCheck)" ) LookupAndCallBinaryNode instanceCheckNode ,
15131517 @ Shared ("boolCast" ) @ Cached ("createIfTrueNode()" ) CoerceToBooleanNode castToBooleanNode ,
1514- @ Cached GetClassNode getClassNode ,
1515- @ Cached TypeNodes .IsSameTypeNode isSameTypeNode ,
1518+ @ Cached InlinedGetClassNode getClassNode ,
1519+ @ Cached TypeNodes .InlinedIsSameTypeNode isSameTypeNode ,
15161520 @ 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 )//
15191523 || isInstanceCheckInternal (frame , instance , cls , instanceCheckNode , castToBooleanNode ) == TriState .TRUE ;
15201524 }
15211525
@@ -2165,19 +2169,19 @@ public abstract static class SumFunctionNode extends PythonBuiltinNode {
21652169 @ Specialization (rewriteOn = UnexpectedResultException .class )
21662170 int sumIntNone (VirtualFrame frame , Object arg1 , @ SuppressWarnings ("unused" ) PNone start ,
21672171 @ 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 ,
21712175 @ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
21722176 return sumIntInternal (frame , arg1 , 0 , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
21732177 }
21742178
21752179 @ Specialization (rewriteOn = UnexpectedResultException .class )
21762180 int sumIntInt (VirtualFrame frame , Object arg1 , int start ,
21772181 @ 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 ,
21812185 @ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
21822186 return sumIntInternal (frame , arg1 , start , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
21832187 }
@@ -2209,9 +2213,9 @@ private int sumIntInternal(VirtualFrame frame, Object arg1, int start, PyObjectG
22092213 @ Specialization (rewriteOn = UnexpectedResultException .class )
22102214 double sumDoubleDouble (VirtualFrame frame , Object arg1 , double start ,
22112215 @ 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 ,
22152219 @ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ) throws UnexpectedResultException {
22162220 return sumDoubleInternal (frame , arg1 , start , getIter , inliningTarget , errorProfile1 , errorProfile2 , errorProfile3 );
22172221 }
@@ -2243,7 +2247,7 @@ private double sumDoubleInternal(VirtualFrame frame, Object arg1, double start,
22432247 @ Specialization (replaces = {"sumIntNone" , "sumIntInt" , "sumDoubleDouble" })
22442248 Object sum (VirtualFrame frame , Object arg1 , Object start ,
22452249 @ Bind ("this" ) Node inliningTarget ,
2246- /* @Shared */ @ Cached IsBuiltinObjectProfile errorProfile1 ,
2250+ @ Shared @ Cached IsBuiltinObjectProfile errorProfile1 ,
22472251 @ Shared ("getIter" ) @ Cached PyObjectGetIter getIter ,
22482252 @ Cached InlinedConditionProfile hasStart ) {
22492253 if (PGuards .isString (start )) {
@@ -2407,7 +2411,8 @@ abstract static class CalculateMetaclassNode extends PNodeWithRaise {
24072411 /* Determine the most derived metatype. */
24082412 @ Specialization
24092413 Object calculate (Object metatype , PTuple bases ,
2410- @ Cached GetClassNode getClass ,
2414+ @ Bind ("this" ) Node inliningTarget ,
2415+ @ Cached InlinedGetClassNode getClass ,
24112416 @ Cached IsSubtypeNode isSubType ,
24122417 @ Cached IsSubtypeNode isSubTypeReverse ) {
24132418 CompilerAsserts .neverPartOfCompilation ();
@@ -2422,7 +2427,7 @@ Object calculate(Object metatype, PTuple bases,
24222427 Object winner = metatype ;
24232428 for (int i = 0 ; i < nbases ; i ++) {
24242429 Object tmp = storage .getItemNormalized (i );
2425- Object tmpType = getClass .execute (tmp );
2430+ Object tmpType = getClass .execute (inliningTarget , tmp );
24262431 if (isSubType .execute (winner , tmpType )) {
24272432 // nothing to do
24282433 } else if (isSubTypeReverse .execute (tmpType , winner )) {
0 commit comments