File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/org/truffleruby/language/supercall Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
package org .truffleruby .language .supercall ;
11
11
12
+ import com .oracle .truffle .api .profiles .ConditionProfile ;
12
13
import org .truffleruby .core .array .ArrayToObjectArrayNode ;
13
14
import org .truffleruby .core .array .ArrayToObjectArrayNodeGen ;
14
15
import org .truffleruby .core .array .ArrayUtils ;
@@ -28,6 +29,7 @@ public class ReadZSuperArgumentsNode extends RubyContextSourceNode {
28
29
@ Child private ArrayToObjectArrayNode unsplatNode ;
29
30
30
31
private final int restArgIndex ;
32
+ private final ConditionProfile isArrayProfile = ConditionProfile .create ();
31
33
32
34
public ReadZSuperArgumentsNode (int restArgIndex , RubyNode [] reloadNodes ) {
33
35
this .restArgIndex = restArgIndex ;
@@ -50,11 +52,10 @@ public final Object execute(VirtualFrame frame) {
50
52
final Object restArg = superArguments [restArgIndex ];
51
53
52
54
final Object [] restArgs ;
53
-
54
- if (restArg instanceof RubyArray ) {
55
+ if (isArrayProfile .profile (restArg instanceof RubyArray )) {
55
56
restArgs = unsplat ((RubyArray ) restArg );
56
57
} else {
57
- restArgs = new Object []{restArg };
58
+ restArgs = new Object []{ restArg };
58
59
}
59
60
60
61
final int after = superArguments .length - (restArgIndex + 1 );
You can’t perform that action at this time.
0 commit comments