Skip to content

Commit

Permalink
[Truffle] Dup nodes on kwargs opt.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Mar 21, 2015
1 parent 4728f23 commit 3422bcb
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -13,6 +13,7 @@
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.NodeUtil;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.BranchProfile;
import org.jruby.truffle.nodes.cast.BooleanCastNode;
Expand Down Expand Up @@ -129,7 +130,7 @@ public Object execute(VirtualFrame frame) {
keywordOptimizedArgumentsLength = optimized.length;

for (int n = 0; n < keywordOptimizedArgumentsLength; n++) {
keywordOptimizedArguments[n] = insert(optimized[n]);
keywordOptimizedArguments[n] = insert(NodeUtil.cloneNode(optimized[n]));
}
}
}
Expand Down Expand Up @@ -291,7 +292,8 @@ public RubyNode[] expandedArgumentNodes(InternalMethod method, RubyNode[] argume

if (!keyIsSymbol) {
// cannot optimize case where keyword label is dynamic (not a fixed RubySymbol)
return argumentNodes;
cannotOptimize = true;
return null;
}

final String label = ((ObjectLiteralNode) hashNode.getKey(j)).getObject().toString();
Expand Down

0 comments on commit 3422bcb

Please sign in to comment.