40
40
*/
41
41
package com .oracle .graal .python .builtins .objects .common ;
42
42
43
+ import static com .oracle .graal .python .nodes .frame .FrameSlotIDs .isUserFrameSlot ;
44
+
43
45
import java .util .Iterator ;
44
46
import java .util .List ;
45
47
import java .util .NoSuchElementException ;
51
53
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
52
54
import com .oracle .graal .python .builtins .objects .str .PString ;
53
55
import com .oracle .graal .python .nodes .PGuards ;
54
- import com .oracle .graal .python .nodes .frame .FrameSlotIDs ;
55
56
import com .oracle .graal .python .nodes .object .IsBuiltinClassProfile ;
56
57
import com .oracle .truffle .api .CompilerDirectives ;
57
58
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
@@ -117,7 +118,7 @@ private void calculateLength() {
117
118
this .len = this .frame .getFrameDescriptor ().getSize ();
118
119
for (FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
119
120
Object identifier = slot .getIdentifier ();
120
- if (!FrameSlotIDs . isUserFrameSlot (identifier ) || getValue (frame , slot ) == null ) {
121
+ if (!isUserFrameSlot (identifier ) || getValue (frame , slot ) == null ) {
121
122
this .len --;
122
123
}
123
124
}
@@ -137,7 +138,7 @@ static Object getItemCached(LocalsStorage self, String key, ThreadState state,
137
138
138
139
@ Specialization (replaces = "getItemCached" )
139
140
static Object string (LocalsStorage self , String key , ThreadState state ) {
140
- if (!FrameSlotIDs . isUserFrameSlot (key )) {
141
+ if (!isUserFrameSlot (key )) {
141
142
return null ;
142
143
}
143
144
FrameSlot slot = findSlot (self , key );
@@ -219,9 +220,11 @@ public Object forEachUntyped(ForEachNode<Object> node, Object arg) {
219
220
bailout ();
220
221
Object result = arg ;
221
222
for (FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
222
- Object value = getValue (slot );
223
- if (value != null ) {
224
- result = node .execute (slot .getIdentifier (), result );
223
+ if (isUserFrameSlot (slot )) {
224
+ Object value = getValue (slot );
225
+ if (value != null ) {
226
+ result = node .execute (slot .getIdentifier (), result );
227
+ }
225
228
}
226
229
}
227
230
return result ;
@@ -372,7 +375,7 @@ protected boolean loadNext() {
372
375
FrameSlot nextCandidate = this .slots .get (this .index ++);
373
376
Object identifier = nextCandidate .getIdentifier ();
374
377
if (identifier instanceof String ) {
375
- if (FrameSlotIDs . isUserFrameSlot (identifier )) {
378
+ if (isUserFrameSlot (identifier )) {
376
379
Object nextValue = getValue (this .frame , nextCandidate );
377
380
if (nextValue != null ) {
378
381
this .nextFrameSlot = nextCandidate ;
@@ -399,7 +402,7 @@ protected boolean loadNext() {
399
402
FrameSlot nextCandidate = this .slots .get (this .index --);
400
403
Object identifier = nextCandidate .getIdentifier ();
401
404
if (identifier instanceof String ) {
402
- if (FrameSlotIDs . isUserFrameSlot (identifier )) {
405
+ if (isUserFrameSlot (identifier )) {
403
406
Object nextValue = getValue (this .frame , nextCandidate );
404
407
if (nextValue != null ) {
405
408
this .nextFrameSlot = nextCandidate ;
0 commit comments