24
24
import com .oracle .truffle .api .dsl .Cached ;
25
25
import com .oracle .truffle .api .dsl .NodeChild ;
26
26
import com .oracle .truffle .api .dsl .Specialization ;
27
- import com .oracle .truffle .api .frame .VirtualFrame ;
28
27
29
28
import static org .truffleruby .language .dispatch .DispatchConfiguration .PRIVATE_RETURN_MISSING ;
30
29
@@ -59,7 +58,7 @@ public void doNotCopy() {
59
58
public abstract RubyNode getChild ();
60
59
61
60
@ Specialization
62
- protected Object splatNil (VirtualFrame frame , Nil nil ) {
61
+ protected Object splatNil (Nil nil ) {
63
62
switch (nilBehavior ) {
64
63
case EMPTY_ARRAY :
65
64
return createEmptyArray ();
@@ -68,7 +67,7 @@ protected Object splatNil(VirtualFrame frame, Nil nil) {
68
67
return createArray (new Object []{ nil });
69
68
70
69
case CONVERT :
71
- return callToA (frame , nil );
70
+ return callToA (nil );
72
71
73
72
case NIL :
74
73
return nil ;
@@ -79,18 +78,18 @@ protected Object splatNil(VirtualFrame frame, Nil nil) {
79
78
}
80
79
81
80
@ Specialization
82
- protected RubyArray splat (VirtualFrame frame , RubyArray array ) {
81
+ protected RubyArray splat (RubyArray array ) {
83
82
// TODO(cs): is it necessary to dup here in all cases?
84
83
// It is needed at least for [*ary] (parsed as just a SplatParseNode) and b = *ary.
85
84
if (copy ) {
86
- return executeDup (frame , array );
85
+ return executeDup (array );
87
86
} else {
88
87
return array ;
89
88
}
90
89
}
91
90
92
91
@ Specialization (guards = { "!isNil(object)" , "!isRubyArray(object)" })
93
- protected RubyArray splat (VirtualFrame frame , Object object ,
92
+ protected RubyArray splat (Object object ,
94
93
@ Cached DispatchNode toArrayNode ) {
95
94
final Object array = toArrayNode .call (
96
95
coreLibrary ().truffleTypeModule ,
@@ -102,27 +101,27 @@ protected RubyArray splat(VirtualFrame frame, Object object,
102
101
return createArray (new Object []{ object });
103
102
} else {
104
103
if (copy ) {
105
- return executeDup (frame , (RubyArray ) array );
104
+ return executeDup ((RubyArray ) array );
106
105
} else {
107
106
return (RubyArray ) array ;
108
107
}
109
108
}
110
109
}
111
110
112
- private Object callToA (VirtualFrame frame , Object nil ) {
111
+ private Object callToA (Object nil ) {
113
112
if (toA == null ) {
114
113
CompilerDirectives .transferToInterpreterAndInvalidate ();
115
114
toA = insert (DispatchNode .create (PRIVATE_RETURN_MISSING ));
116
115
}
117
116
return toA .call (nil , "to_a" );
118
117
}
119
118
120
- private RubyArray executeDup (VirtualFrame frame , RubyArray array ) {
119
+ private RubyArray executeDup (RubyArray array ) {
121
120
if (dup == null ) {
122
121
CompilerDirectives .transferToInterpreterAndInvalidate ();
123
122
dup = insert (ArrayDupNodeGen .create ());
124
123
}
125
- return dup .executeDup (frame , array );
124
+ return dup .executeDup (array );
126
125
}
127
126
128
127
}
0 commit comments