4040 */
4141package com .oracle .graal .python .builtins .objects .superobject ;
4242
43+ import static com .oracle .graal .python .nodes .SpecialAttributeNames .__SELF_CLASS__ ;
44+ import static com .oracle .graal .python .nodes .SpecialAttributeNames .__SELF__ ;
45+ import static com .oracle .graal .python .nodes .SpecialAttributeNames .__THISCLASS__ ;
46+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__GETATTRIBUTE__ ;
47+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__GET__ ;
48+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__INIT__ ;
49+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__REPR__ ;
50+
4351import java .util .List ;
4452
45- import com .oracle .graal .python .PythonLanguage ;
4653import com .oracle .graal .python .builtins .Builtin ;
4754import com .oracle .graal .python .builtins .CoreFunctions ;
4855import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
6976import com .oracle .graal .python .builtins .objects .type .TypeNodes .IsSameTypeNode ;
7077import com .oracle .graal .python .builtins .objects .type .TypeNodesFactory .IsSameTypeNodeGen ;
7178import com .oracle .graal .python .nodes .ErrorMessages ;
79+ import com .oracle .graal .python .nodes .PNodeWithContext ;
7280import com .oracle .graal .python .nodes .SpecialAttributeNames ;
7381import com .oracle .graal .python .nodes .argument .ReadIndexedArgumentNode ;
7482import com .oracle .graal .python .nodes .attributes .LookupInheritedSlotNode ;
8997import com .oracle .graal .python .runtime .exception .PException ;
9098import com .oracle .graal .python .runtime .exception .PythonErrorType ;
9199import com .oracle .graal .python .util .PythonUtils ;
92- import com .oracle .truffle .api .Assumption ;
93100import com .oracle .truffle .api .CompilerDirectives ;
94101import com .oracle .truffle .api .dsl .Cached ;
95102import com .oracle .truffle .api .dsl .Fallback ;
98105import com .oracle .truffle .api .dsl .Specialization ;
99106import com .oracle .truffle .api .frame .VirtualFrame ;
100107import com .oracle .truffle .api .library .CachedLibrary ;
101- import com .oracle .truffle .api .nodes .Node ;
102108import com .oracle .truffle .api .profiles .ConditionProfile ;
103109
104- import static com .oracle .graal .python .nodes .SpecialAttributeNames .__SELF_CLASS__ ;
105- import static com .oracle .graal .python .nodes .SpecialAttributeNames .__SELF__ ;
106- import static com .oracle .graal .python .nodes .SpecialAttributeNames .__THISCLASS__ ;
107- import static com .oracle .graal .python .nodes .SpecialMethodNames .__GETATTRIBUTE__ ;
108- import static com .oracle .graal .python .nodes .SpecialMethodNames .__GET__ ;
109- import static com .oracle .graal .python .nodes .SpecialMethodNames .__INIT__ ;
110- import static com .oracle .graal .python .nodes .SpecialMethodNames .__REPR__ ;
111-
112110@ CoreFunctions (extendClasses = PythonBuiltinClassType .Super )
113111public final class SuperBuiltins extends PythonBuiltins {
114112 @ Override
115113 protected List <? extends NodeFactory <? extends PythonBuiltinBaseNode >> getNodeFactories () {
116114 return SuperBuiltinsFactory .getFactories ();
117115 }
118116
119- abstract static class GetTypeNode extends Node {
120- final Assumption singleContextAssumption () {
121- return PythonLanguage .get (this ).singleContextAssumption ;
122- }
117+ abstract static class GetTypeNode extends PNodeWithContext {
123118
124119 abstract Object execute (SuperObject self );
125120
126- @ Specialization (guards = " self == cachedSelf" , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" , "singleContextAssumption ()" }, limit = "1" )
121+ @ Specialization (guards = { "isSingleContext()" , " self == cachedSelf"} , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" }, limit = "1" )
127122 static Object cached (@ SuppressWarnings ("unused" ) SuperObject self ,
128123 @ SuppressWarnings ("unused" ) @ Cached ("self" ) SuperObject cachedSelf ,
129124 @ Cached ("self.getType()" ) Object type ) {
@@ -136,14 +131,11 @@ static Object uncached(SuperObject self) {
136131 }
137132 }
138133
139- abstract static class GetObjectTypeNode extends Node {
140- final Assumption singleContextAssumption () {
141- return PythonLanguage .get (this ).singleContextAssumption ;
142- }
134+ abstract static class GetObjectTypeNode extends PNodeWithContext {
143135
144136 abstract Object execute (SuperObject self );
145137
146- @ Specialization (guards = " self == cachedSelf" , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" , "singleContextAssumption ()" }, limit = "1" )
138+ @ Specialization (guards = { "isSingleContext()" , " self == cachedSelf"} , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" }, limit = "1" )
147139 static Object cached (@ SuppressWarnings ("unused" ) SuperObject self ,
148140 @ SuppressWarnings ("unused" ) @ Cached ("self" ) SuperObject cachedSelf ,
149141 @ Cached ("self.getObjectType()" ) Object type ) {
@@ -156,14 +148,11 @@ static Object uncached(SuperObject self) {
156148 }
157149 }
158150
159- abstract static class GetObjectNode extends Node {
160- final Assumption singleContextAssumption () {
161- return PythonLanguage .get (this ).singleContextAssumption ;
162- }
151+ abstract static class GetObjectNode extends PNodeWithContext {
163152
164153 abstract Object execute (SuperObject self );
165154
166- @ Specialization (guards = " self == cachedSelf" , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" , "singleContextAssumption ()" }, limit = "1" )
155+ @ Specialization (guards = { "isSingleContext()" , " self == cachedSelf"} , assumptions = {"cachedSelf.getNeverReinitializedAssumption()" }, limit = "1" )
167156 static Object cached (@ SuppressWarnings ("unused" ) SuperObject self ,
168157 @ SuppressWarnings ("unused" ) @ Cached ("self" ) SuperObject cachedSelf ,
169158 @ Cached ("self.getObject()" ) Object object ) {
0 commit comments