29
29
import org .truffleruby .annotations .Primitive ;
30
30
import org .truffleruby .annotations .Visibility ;
31
31
import org .truffleruby .builtins .CoreMethodArrayArgumentsNode ;
32
+ import org .truffleruby .builtins .CoreMethodNode ;
32
33
import org .truffleruby .builtins .PrimitiveArrayArgumentsNode ;
33
34
import org .truffleruby .core .array .ArrayHelpers ;
34
35
import org .truffleruby .core .array .RubyArray ;
@@ -282,11 +283,7 @@ public RubyNode cloneUninitialized() {
282
283
@ NodeChild (value = "bindingNode" , type = RubyNode .class )
283
284
@ NodeChild (value = "nameNode" , type = RubyBaseNodeWithExecute .class )
284
285
@ ImportStatic (BindingNodes .class )
285
- public abstract static class BindingLocalVariableGetNode extends RubySourceNode {
286
-
287
- abstract RubyNode getBindingNode ();
288
-
289
- abstract RubyBaseNodeWithExecute getNameNode ();
286
+ public abstract static class BindingLocalVariableGetNode extends CoreMethodNode {
290
287
291
288
@ CreateCast ("nameNode" )
292
289
protected RubyBaseNodeWithExecute coerceToString (RubyBaseNodeWithExecute name ) {
@@ -298,17 +295,6 @@ protected Object localVariableGet(RubyBinding binding, String name,
298
295
@ Cached LocalVariableGetNode localVariableGetNode ) {
299
296
return localVariableGetNode .execute (binding , name );
300
297
}
301
-
302
- private RubyBaseNodeWithExecute getNameNodeBeforeCasting () {
303
- return ((NameToJavaStringNode ) getNameNode ()).getValueNode ();
304
- }
305
-
306
- @ Override
307
- public RubyNode cloneUninitialized () {
308
- return BindingNodesFactory .BindingLocalVariableGetNodeFactory .create (
309
- getBindingNode ().cloneUninitialized (),
310
- getNameNodeBeforeCasting ().cloneUninitialized ()).copyFlags (this );
311
- }
312
298
}
313
299
314
300
@ GenerateUncached
@@ -345,13 +331,7 @@ protected Object localVariableGetLastLine(RubyBinding binding, String name) {
345
331
@ NodeChild (value = "bindingNode" , type = RubyNode .class )
346
332
@ NodeChild (value = "nameNode" , type = RubyBaseNodeWithExecute .class )
347
333
@ NodeChild (value = "valueNode" , type = RubyNode .class )
348
- public abstract static class BindingLocalVariableSetNode extends RubySourceNode {
349
-
350
- abstract RubyNode getBindingNode ();
351
-
352
- abstract RubyBaseNodeWithExecute getNameNode ();
353
-
354
- abstract RubyNode getValueNode ();
334
+ public abstract static class BindingLocalVariableSetNode extends CoreMethodNode {
355
335
356
336
@ CreateCast ("nameNode" )
357
337
protected RubyBaseNodeWithExecute coerceToString (RubyBaseNodeWithExecute name ) {
@@ -363,18 +343,6 @@ protected Object localVariableSet(RubyBinding binding, String name, Object value
363
343
@ Cached LocalVariableSetNode localVariableSetNode ) {
364
344
return localVariableSetNode .execute (binding , name , value );
365
345
}
366
-
367
- private RubyBaseNodeWithExecute getNameNodeBeforeCasting () {
368
- return ((NameToJavaStringNode ) getNameNode ()).getValueNode ();
369
- }
370
-
371
- @ Override
372
- public RubyNode cloneUninitialized () {
373
- return BindingNodesFactory .BindingLocalVariableSetNodeFactory .create (
374
- getBindingNode ().cloneUninitialized (),
375
- getNameNodeBeforeCasting ().cloneUninitialized (),
376
- getValueNode ().cloneUninitialized ()).copyFlags (this );
377
- }
378
346
}
379
347
380
348
@@ -394,7 +362,7 @@ public abstract static class LocalVariableSetNode extends RubyBaseNode {
394
362
protected Object localVariableSetCached (RubyBinding binding , String name , Object value ,
395
363
@ Cached ("name" ) String cachedName ,
396
364
@ Cached ("getFrameDescriptor(binding)" ) FrameDescriptor cachedFrameDescriptor ,
397
- @ Cached ("findFrameSlotOrNull(name, binding.getFrame())" ) FindDeclarationVariableNodes . FrameSlotAndDepth cachedFrameSlot ,
365
+ @ Cached ("findFrameSlotOrNull(name, binding.getFrame())" ) FrameSlotAndDepth cachedFrameSlot ,
398
366
@ Cached ("createWriteNode(cachedFrameSlot.slot)" ) WriteFrameSlotNode writeLocalVariableNode ) {
399
367
final MaterializedFrame frame = RubyArguments
400
368
.getDeclarationFrame (binding .getFrame (), cachedFrameSlot .depth );
0 commit comments