27
27
28
28
import static com .oracle .graal .python .builtins .objects .PNone .NO_VALUE ;
29
29
30
- import com .oracle .graal .python .PythonLanguage ;
31
30
import com .oracle .graal .python .builtins .objects .cell .PCell ;
31
+ import com .oracle .graal .python .nodes .PNodeWithContext ;
32
32
import com .oracle .graal .python .nodes .expression .ExpressionNode ;
33
33
import com .oracle .graal .python .nodes .frame .WriteIdentifierNode ;
34
34
import com .oracle .graal .python .nodes .statement .StatementNode ;
38
38
import com .oracle .truffle .api .dsl .Cached ;
39
39
import com .oracle .truffle .api .dsl .ImportStatic ;
40
40
import com .oracle .truffle .api .dsl .NodeChild ;
41
- import com .oracle .truffle .api .dsl .ReportPolymorphism ;
41
+ import com .oracle .truffle .api .dsl .ReportPolymorphism . Megamorphic ;
42
42
import com .oracle .truffle .api .dsl .Specialization ;
43
43
import com .oracle .truffle .api .frame .FrameSlot ;
44
44
import com .oracle .truffle .api .frame .VirtualFrame ;
45
- import com .oracle .truffle .api .nodes .Node ;
46
45
import com .oracle .truffle .api .nodes .NodeInfo ;
47
46
import com .oracle .truffle .api .profiles .ConditionProfile ;
48
47
@@ -88,15 +87,10 @@ public Object getIdentifier() {
88
87
}
89
88
90
89
@ ImportStatic (PythonOptions .class )
91
- @ ReportPolymorphism
92
- abstract static class WriteToCellNode extends Node {
90
+ abstract static class WriteToCellNode extends PNodeWithContext {
93
91
94
92
public abstract void execute (PCell cell , Object value );
95
93
96
- protected static Assumption singleContextAssumption () {
97
- return PythonLanguage .getCurrent ().singleContextAssumption ;
98
- }
99
-
100
94
@ Specialization (guards = "cell == cachedCell" , limit = "getAttributeAccessInlineCacheMaxDepth()" , assumptions = "singleContextAssumption" )
101
95
void doWriteCached (@ SuppressWarnings ("unused" ) PCell cell , Object value ,
102
96
@ SuppressWarnings ("unused" ) @ Cached ("singleContextAssumption()" ) Assumption singleContextAssumption ,
@@ -118,6 +112,7 @@ void doWriteCachedAssumption(PCell cell, Object value,
118
112
}
119
113
}
120
114
115
+ @ Megamorphic
121
116
@ Specialization (replaces = {"doWriteCached" , "doWriteCachedAssumption" })
122
117
void doWriteGeneric (PCell cell , Object value ) {
123
118
if (value == NO_VALUE ) {
0 commit comments