@@ -192,10 +192,10 @@ public abstract static class GetSpecialVariableStorage extends RubyContextNode {
192
192
assumptions = "frameAssumption" )
193
193
protected SpecialVariableStorage executeGetStorage (VirtualFrame frame ,
194
194
@ Cached ("frame.getFrameDescriptor()" ) FrameDescriptor descriptor ,
195
- @ Cached ("frame.getFrameDescriptor() .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
195
+ @ Cached ("descriptor .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
196
196
@ Cached ("declarationDescriptor(frame).getVersion()" ) Assumption frameAssumption ) {
197
197
Object storage = FrameUtil .getObjectSafe (frame , slot );
198
- if (storage == Nil . INSTANCE ) {
198
+ if (storage == nil ) {
199
199
CompilerDirectives .transferToInterpreterAndInvalidate ();
200
200
storage = new SpecialVariableStorage ();
201
201
frame .setObject (slot , storage );
@@ -209,18 +209,14 @@ protected SpecialVariableStorage executeGetStorage(VirtualFrame frame,
209
209
limit = "1" )
210
210
protected SpecialVariableStorage executeGetStorageDeclarationFrame (VirtualFrame frame ,
211
211
@ Cached ("frame.getFrameDescriptor()" ) FrameDescriptor descriptor ,
212
- @ Cached ("frame.getFrameDescriptor() .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
212
+ @ Cached ("descriptor .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
213
213
@ Cached ("declarationDepth(frame)" ) int declarationFrameDepth ,
214
214
@ Cached ("declarationSlot(frame)" ) FrameSlot declarationFrameSlot ,
215
215
@ Cached ("declarationDescriptor(frame).getVersion()" ) Assumption frameAssumption ) {
216
- VirtualFrame storageFrame = frame ;
217
-
218
- for (int i = 0 ; i < declarationFrameDepth ; i ++) {
219
- storageFrame = RubyArguments .getDeclarationFrame (storageFrame );
220
- }
216
+ VirtualFrame storageFrame = RubyArguments .getDeclarationFrame (frame , declarationFrameDepth );
221
217
222
218
Object storage = FrameUtil .getObjectSafe (storageFrame , declarationFrameSlot );
223
- if (storage == Nil . INSTANCE ) {
219
+ if (storage == nil ) {
224
220
CompilerDirectives .transferToInterpreterAndInvalidate ();
225
221
storage = new SpecialVariableStorage ();
226
222
storageFrame .setObject (declarationFrameSlot , storage );
@@ -234,7 +230,7 @@ protected SpecialVariableStorage executeGetStorageDeclarationFrame(VirtualFrame
234
230
limit = "1" )
235
231
protected SpecialVariableStorage executeGetStorageDeclarationFrame (VirtualFrame frame ,
236
232
@ Cached ("frame.getFrameDescriptor()" ) FrameDescriptor descriptor ,
237
- @ Cached ("frame.getFrameDescriptor() .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
233
+ @ Cached ("descriptor .findFrameSlot(SPECIAL_VARIABLLE_STORAGE)" ) FrameSlot slot ,
238
234
@ Cached ("declarationSlot(frame)" ) FrameSlot declarationFrameSlot ,
239
235
@ Cached ("declarationDescriptor(frame).getVersion()" ) Assumption frameAssumption ) {
240
236
return getSlow (frame .materialize ());
@@ -331,10 +327,7 @@ protected FrameSlot declarationSlot(VirtualFrame topFrame) {
331
327
}
332
328
333
329
private static FrameSlot getVariableSlot (MaterializedFrame frame ) {
334
- final FrameDescriptor descriptor = frame .getFrameDescriptor ();
335
- synchronized (descriptor ) {
336
- return descriptor .findFrameSlot (Layouts .SPECIAL_VARIABLLE_STORAGE );
337
- }
330
+ return frame .getFrameDescriptor ().findFrameSlot (Layouts .SPECIAL_VARIABLLE_STORAGE );
338
331
}
339
332
340
333
public static GetSpecialVariableStorage create () {
0 commit comments