6767import com .oracle .truffle .api .dsl .ImportStatic ;
6868import com .oracle .truffle .api .dsl .Specialization ;
6969import com .oracle .truffle .api .frame .FrameDescriptor ;
70+ import com .oracle .truffle .api .frame .FrameSlot ;
7071import com .oracle .truffle .api .frame .MaterializedFrame ;
7172import com .oracle .truffle .api .frame .VirtualFrame ;
7273import com .oracle .truffle .api .library .CachedLibrary ;
7677import com .oracle .truffle .api .profiles .ConditionProfile ;
7778
7879@ ExportLibrary (HashingStorageLibrary .class )
79- @ SuppressWarnings ("deprecation" ) // new Frame API
8080public final class LocalsStorage extends HashingStorage {
8181 /* This won't be the real (materialized) frame but a clone of it. */
8282 protected final MaterializedFrame frame ;
@@ -94,11 +94,11 @@ public MaterializedFrame getFrame() {
9494 return this .frame ;
9595 }
9696
97- private Object getValue (com . oracle . truffle . api . frame . FrameSlot slot ) {
97+ private Object getValue (FrameSlot slot ) {
9898 return getValue (this .frame , slot );
9999 }
100100
101- private static Object getValue (MaterializedFrame frame , com . oracle . truffle . api . frame . FrameSlot slot ) {
101+ private static Object getValue (MaterializedFrame frame , FrameSlot slot ) {
102102 if (slot != null ) {
103103 Object value = frame .getValue (slot );
104104 if (value instanceof PCell ) {
@@ -122,34 +122,32 @@ public int length() {
122122 @ TruffleBoundary
123123 private void calculateLength () {
124124 this .len = this .frame .getFrameDescriptor ().getSize ();
125- for (com . oracle . truffle . api . frame . FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
125+ for (FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
126126 Object identifier = slot .getIdentifier ();
127127 if (!isUserFrameSlot (identifier ) || getValue (frame , slot ) == null ) {
128128 this .len --;
129129 }
130130 }
131131 }
132132
133- @ SuppressWarnings ({ "unused" , "deprecation" }) // new frame API
133+ @ SuppressWarnings ("unused" )
134134 @ ExportMessage
135135 @ ImportStatic (PGuards .class )
136136 static class GetItemWithState {
137137 @ Specialization (guards = {"key == cachedKey" , "desc == self.frame.getFrameDescriptor()" }, limit = "3" , assumptions = "desc.getVersion()" )
138- @ SuppressWarnings ("deprecation" ) // new Frame API
139138 static Object getItemCached (LocalsStorage self , String key , ThreadState state ,
140139 @ Cached ("key" ) String cachedKey ,
141140 @ Cached ("self.frame.getFrameDescriptor()" ) FrameDescriptor desc ,
142- @ Cached ("desc.findFrameSlot(key)" ) com . oracle . truffle . api . frame . FrameSlot slot ) {
141+ @ Cached ("desc.findFrameSlot(key)" ) FrameSlot slot ) {
143142 return self .getValue (slot );
144143 }
145144
146145 @ Specialization (replaces = "getItemCached" )
147- @ SuppressWarnings ("deprecation" ) // new Frame API
148146 static Object string (LocalsStorage self , String key , ThreadState state ) {
149147 if (!isUserFrameSlot (key )) {
150148 return null ;
151149 }
152- com . oracle . truffle . api . frame . FrameSlot slot = findSlot (self , key );
150+ FrameSlot slot = findSlot (self , key );
153151 return self .getValue (slot );
154152 }
155153
@@ -160,7 +158,6 @@ static Object pstring(LocalsStorage self, PString key, ThreadState state,
160158 }
161159
162160 @ Specialization (guards = "!isBuiltinString(key, profile)" , limit = "1" )
163- @ SuppressWarnings ("deprecation" ) // new Frame API
164161 static Object notString (LocalsStorage self , Object key , ThreadState state ,
165162 @ Shared ("builtinProfile" ) @ Cached IsBuiltinClassProfile profile ,
166163 @ Cached PyObjectRichCompareBool .EqNode eqNode ,
@@ -169,7 +166,7 @@ static Object notString(LocalsStorage self, Object key, ThreadState state,
169166 CompilerDirectives .bailout ("accessing locals storage with non-string keys is slow" );
170167 VirtualFrame frame = gotState .profile (state == null ) ? null : PArguments .frameForCall (state );
171168 long hash = hashNode .execute (frame , key );
172- for (com . oracle . truffle . api . frame . FrameSlot slot : self .frame .getFrameDescriptor ().getSlots ()) {
169+ for (FrameSlot slot : self .frame .getFrameDescriptor ().getSlots ()) {
173170 Object currentKey = slot .getIdentifier ();
174171 if (currentKey instanceof String ) {
175172 long keyHash = hashNode .execute (frame , currentKey );
@@ -182,8 +179,7 @@ static Object notString(LocalsStorage self, Object key, ThreadState state,
182179 }
183180
184181 @ TruffleBoundary
185- @ SuppressWarnings ("deprecation" ) // new Frame API
186- private static com .oracle .truffle .api .frame .FrameSlot findSlot (LocalsStorage self , Object key ) {
182+ private static FrameSlot findSlot (LocalsStorage self , Object key ) {
187183 return self .frame .getFrameDescriptor ().findFrameSlot (key );
188184 }
189185 }
@@ -221,10 +217,9 @@ private HashingStorage generalize(HashingStorageLibrary lib, boolean isStringKey
221217 @ ExportMessage
222218 @ TruffleBoundary
223219 @ Override
224- @ SuppressWarnings ("deprecation" ) // new Frame API
225220 public Object forEachUntyped (ForEachNode <Object > node , Object arg ) {
226221 Object result = arg ;
227- for (com . oracle . truffle . api . frame . FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
222+ for (FrameSlot slot : this .frame .getFrameDescriptor ().getSlots ()) {
228223 Object identifier = slot .getIdentifier ();
229224 if (identifier instanceof String ) {
230225 if (isUserFrameSlot (identifier )) {
@@ -240,21 +235,19 @@ public Object forEachUntyped(ForEachNode<Object> node, Object arg) {
240235
241236 @ ExportMessage
242237 static class AddAllToOther {
243- @ SuppressWarnings ("deprecation" ) // new Frame API
244- protected static com .oracle .truffle .api .frame .FrameSlot [] getSlots (FrameDescriptor desc ) {
245- return desc .getSlots ().toArray (new com .oracle .truffle .api .frame .FrameSlot [0 ]);
238+ protected static FrameSlot [] getSlots (FrameDescriptor desc ) {
239+ return desc .getSlots ().toArray (new FrameSlot [0 ]);
246240 }
247241
248242 @ Specialization (guards = {"desc == self.frame.getFrameDescriptor()" }, limit = "1" , assumptions = "desc.getVersion()" )
249243 @ ExplodeLoop
250- @ SuppressWarnings ("deprecation" ) // new Frame API
251244 static HashingStorage cached (LocalsStorage self , HashingStorage other ,
252245 @ CachedLibrary (limit = "2" ) HashingStorageLibrary lib ,
253246 @ Exclusive @ SuppressWarnings ("unused" ) @ Cached ("self.frame.getFrameDescriptor()" ) FrameDescriptor desc ,
254- @ Exclusive @ Cached (value = "getSlots(desc)" , dimensions = 1 ) com . oracle . truffle . api . frame . FrameSlot [] slots ) {
247+ @ Exclusive @ Cached (value = "getSlots(desc)" , dimensions = 1 ) FrameSlot [] slots ) {
255248 HashingStorage result = other ;
256249 for (int i = 0 ; i < slots .length ; i ++) {
257- com . oracle . truffle . api . frame . FrameSlot slot = slots [i ];
250+ FrameSlot slot = slots [i ];
258251 Object value = self .getValue (slot );
259252 if (value != null ) {
260253 result = lib .setItem (result , slot .getIdentifier (), value );
@@ -265,13 +258,12 @@ static HashingStorage cached(LocalsStorage self, HashingStorage other,
265258
266259 @ Specialization (replaces = "cached" )
267260 @ TruffleBoundary
268- @ SuppressWarnings ("deprecation" ) // new Frame API
269261 static HashingStorage generic (LocalsStorage self , HashingStorage other ,
270262 @ CachedLibrary (limit = "2" ) HashingStorageLibrary lib ) {
271263 HashingStorage result = other ;
272- com . oracle . truffle . api . frame . FrameSlot [] slots = getSlots (self .frame .getFrameDescriptor ());
264+ FrameSlot [] slots = getSlots (self .frame .getFrameDescriptor ());
273265 for (int i = 0 ; i < slots .length ; i ++) {
274- com . oracle . truffle . api . frame . FrameSlot slot = slots [i ];
266+ FrameSlot slot = slots [i ];
275267 Object value = self .getValue (slot );
276268 if (value != null ) {
277269 result = lib .setItem (result , slot .getIdentifier (), value );
@@ -304,13 +296,12 @@ public HashingStorageIterable<Object> reverseKeys() {
304296 return new HashingStorageIterable <>(new ReverseLocalsIterator (this .frame ));
305297 }
306298
307- @ SuppressWarnings ("deprecation" ) // new Frame API
308299 protected abstract static class AbstractLocalsIterator implements Iterator <Object > {
309- protected List <? extends com . oracle . truffle . api . frame . FrameSlot > slots ;
300+ protected List <? extends FrameSlot > slots ;
310301 protected final int size ;
311302 protected int index ;
312303 protected final MaterializedFrame frame ;
313- protected com . oracle . truffle . api . frame . FrameSlot nextFrameSlot = null ;
304+ protected FrameSlot nextFrameSlot = null ;
314305
315306 AbstractLocalsIterator (MaterializedFrame frame ) {
316307 this .frame = frame ;
@@ -320,7 +311,7 @@ protected abstract static class AbstractLocalsIterator implements Iterator<Objec
320311 }
321312
322313 @ TruffleBoundary
323- private static List <? extends com . oracle . truffle . api . frame . FrameSlot > getSlots (MaterializedFrame frame ) {
314+ private static List <? extends FrameSlot > getSlots (MaterializedFrame frame ) {
324315 return frame .getFrameDescriptor ().getSlots ();
325316 }
326317
@@ -357,10 +348,10 @@ public Object next() {
357348 }
358349
359350 @ TruffleBoundary
360- public com . oracle . truffle . api . frame . FrameSlot nextSlot () {
351+ public FrameSlot nextSlot () {
361352 if (hasNext ()) {
362353 assert this .nextFrameSlot != null ;
363- com . oracle . truffle . api . frame . FrameSlot value = this .nextFrameSlot ;
354+ FrameSlot value = this .nextFrameSlot ;
364355 this .nextFrameSlot = null ;
365356 return value ;
366357 }
@@ -377,10 +368,9 @@ private static final class LocalsIterator extends AbstractLocalsIterator {
377368
378369 @ TruffleBoundary
379370 @ Override
380- @ SuppressWarnings ("deprecation" ) // new Frame API
381371 protected boolean loadNext () {
382372 while (this .index < this .size ) {
383- com . oracle . truffle . api . frame . FrameSlot nextCandidate = this .slots .get (this .index ++);
373+ FrameSlot nextCandidate = this .slots .get (this .index ++);
384374 Object identifier = nextCandidate .getIdentifier ();
385375 if (identifier instanceof String ) {
386376 if (isUserFrameSlot (identifier )) {
@@ -405,10 +395,9 @@ private static final class ReverseLocalsIterator extends AbstractLocalsIterator
405395
406396 @ TruffleBoundary
407397 @ Override
408- @ SuppressWarnings ("deprecation" ) // new Frame API
409398 protected boolean loadNext () {
410399 while (this .index >= 0 ) {
411- com . oracle . truffle . api . frame . FrameSlot nextCandidate = this .slots .get (this .index --);
400+ FrameSlot nextCandidate = this .slots .get (this .index --);
412401 Object identifier = nextCandidate .getIdentifier ();
413402 if (identifier instanceof String ) {
414403 if (isUserFrameSlot (identifier )) {
0 commit comments