10
10
package org .truffleruby .core .range ;
11
11
12
12
import com .oracle .truffle .api .dsl .Bind ;
13
- import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
14
13
import com .oracle .truffle .api .dsl .GenerateUncached ;
15
14
import com .oracle .truffle .api .dsl .NeverDefault ;
16
15
import com .oracle .truffle .api .profiles .InlinedConditionProfile ;
34
33
import org .truffleruby .language .RubyContextSourceNode ;
35
34
import org .truffleruby .language .RubyGuards ;
36
35
import org .truffleruby .language .RubyNode ;
37
- import org .truffleruby .language .RubySourceNode ;
38
36
import org .truffleruby .annotations .Visibility ;
39
37
import org .truffleruby .language .arguments .RubyArguments ;
40
38
import org .truffleruby .language .control .RaiseException ;
@@ -467,22 +465,19 @@ protected RubyClass getRangeClass() {
467
465
}
468
466
}
469
467
470
- @ GenerateUncached
471
- @ GenerateNodeFactory
472
468
@ CoreMethod (names = { "__allocate__" , "__layout_allocate__" }, constructor = true , visibility = Visibility .PRIVATE )
473
469
@ NodeChild (value = "rubyClassNode" , type = RubyNode .class )
474
- public abstract static class AllocateNode extends RubySourceNode {
475
-
476
- @ NeverDefault
477
- public static AllocateNode create () {
478
- return RangeNodesFactory .AllocateNodeFactory .create (null );
479
- }
470
+ public abstract static class RangeAllocateNode extends CoreMethodNode {
480
471
481
- public static AllocateNode create (RubyNode rubyClassNode ) {
482
- return RangeNodesFactory .AllocateNodeFactory .create (rubyClassNode );
472
+ @ Specialization
473
+ protected RubyObjectRange allocate (RubyClass rubyClass ,
474
+ @ Cached AllocateNode allocateNode ) {
475
+ return allocateNode .execute (rubyClass );
483
476
}
477
+ }
484
478
485
- abstract RubyNode getRubyClassNode ();
479
+ @ GenerateUncached
480
+ public abstract static class AllocateNode extends RubyBaseNode {
486
481
487
482
public abstract RubyObjectRange execute (RubyClass rubyClass );
488
483
@@ -493,12 +488,6 @@ protected RubyObjectRange allocate(RubyClass rubyClass) {
493
488
AllocationTracing .trace (range , this );
494
489
return range ;
495
490
}
496
-
497
- @ Override
498
- public RubyNode cloneUninitialized () {
499
- return create (getRubyClassNode ().cloneUninitialized ()).copyFlags (this );
500
- }
501
-
502
491
}
503
492
504
493
@ CoreMethod (names = "initialize_copy" , required = 1 , raiseIfFrozenSelf = true )
0 commit comments