Skip to content
Permalink
Browse files
Merge branch 'master' into truffle-head
  • Loading branch information
chrisseaton committed Dec 30, 2014
2 parents 7567b0b + 44d7c49 commit a5b1f0ab115672338866f43322e6328e3aa0ef7f
Showing with 61 additions and 390 deletions.
  1. +8 −1 core/src/main/java/org/jruby/Ruby.java
  2. +0 −40 core/src/main/java/org/jruby/ast/ArgsNoArgNode.java
  3. +0 −40 core/src/main/java/org/jruby/ast/ArgsPreOneArgNode.java
  4. +0 −40 core/src/main/java/org/jruby/ast/ArgsPreTwoArgNode.java
  5. +0 −8 core/src/main/java/org/jruby/ast/ArrayNode.java
  6. +3 −62 core/src/main/java/org/jruby/ast/AttrAssignNode.java
  7. +0 −29 core/src/main/java/org/jruby/ast/AttrAssignOneArgNode.java
  8. +0 −33 core/src/main/java/org/jruby/ast/AttrAssignThreeArgNode.java
  9. +0 −31 core/src/main/java/org/jruby/ast/AttrAssignTwoArgNode.java
  10. +2 −6 core/src/main/java/org/jruby/ast/CallNode.java
  11. +3 −8 core/src/main/java/org/jruby/ast/FCallNode.java
  12. +0 −3 core/src/main/java/org/jruby/ast/OpElementAsgnNode.java
  13. +0 −4 core/src/main/java/org/jruby/ast/RescueBodyNode.java
  14. +0 −3 core/src/main/java/org/jruby/ast/SuperNode.java
  15. +3 −6 core/src/main/java/org/jruby/ast/WhenNode.java
  16. +0 −4 core/src/main/java/org/jruby/ast/YieldNode.java
  17. +4 −11 core/src/main/java/org/jruby/ir/IRBuilder.java
  18. +4 −43 core/src/main/java/org/jruby/parser/ParserSupport.java
  19. +4 −4 core/src/main/java/org/jruby/parser/RubyParser.y
  20. +7 −2 core/src/main/java/org/jruby/truffle/TruffleBridgeImpl.java
  21. +9 −0 core/src/main/java/org/jruby/truffle/nodes/methods/SetFrameVisibilityNode.java
  22. +14 −7 core/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  23. +0 −5 core/src/main/java/org/jruby/truffle/translator/TranslatorDriver.java
@@ -1694,7 +1694,6 @@ private void initBuiltins() {
addLazyBuiltin("stringio.jar", "stringio", "org.jruby.ext.stringio.StringIOLibrary");
addLazyBuiltin("strscan.jar", "strscan", "org.jruby.ext.strscan.StringScannerLibrary");
addLazyBuiltin("zlib.jar", "zlib", "org.jruby.ext.zlib.ZlibLibrary");
addLazyBuiltin("enumerator.jar", "enumerator", "org.jruby.ext.enumerator.EnumeratorLibrary");
addLazyBuiltin("thread.jar", "thread", "org.jruby.ext.thread.ThreadLibrary");
addLazyBuiltin("thread.rb", "thread", "org.jruby.ext.thread.ThreadLibrary");
addLazyBuiltin("digest.jar", "digest.so", "org.jruby.ext.digest.DigestLibrary");
@@ -1731,6 +1730,14 @@ public void load(Ruby runtime, boolean wrap) throws IOException {
addBuiltinIfAllowed("continuation.rb", dummy);
addBuiltinIfAllowed("io/nonblock.rb", dummy);

// rb_provide logic, in a roundabout way
addLazyBuiltin("enumerator.jar", "enumerator", "org.jruby.ext.enumerator.EnumeratorLibrary");
loadService.require("enumerator.jar");
addBuiltinIfAllowed("rational.jar", dummy);
loadService.require("rational.jar");
addBuiltinIfAllowed("complex.jar", dummy);
loadService.require("complex.jar");

if(RubyInstanceConfig.NATIVE_NET_PROTOCOL) {
addLazyBuiltin("net/protocol.rb", "net/protocol", "org.jruby.ext.net.protocol.NetProtocolBufferedIOLibrary");
}

This file was deleted.

This file was deleted.

This file was deleted.

@@ -66,12 +66,4 @@ public NodeType getNodeType() {
public <T> T accept(NodeVisitor<T> iVisitor) {
return iVisitor.visitArrayNode(this);
}

public void setLightweight(boolean lightweight) {
this.lightweight = lightweight;
}

public boolean isLightweight() {
return lightweight;
}
}
@@ -53,7 +53,7 @@ public AttrAssignNode(ISourcePosition position, Node receiverNode, String name,

this.receiverNode = receiverNode;
this.name = name;
setArgsInternal(argsNode);
this.argsNode = argsNode;
}

public NodeType getNodeType() {
@@ -95,74 +95,15 @@ public Node getArgsNode() {
return argsNode;
}


protected Node newAttrAssignNode(ArrayNode argsNode) {
int size = argsNode.size();

switch (size) {
case 1:
return new AttrAssignOneArgNode(getPosition(), receiverNode, name, argsNode);
case 2:
return new AttrAssignTwoArgNode(getPosition(), receiverNode, name, argsNode);
case 3:
return new AttrAssignThreeArgNode(getPosition(), receiverNode, name, argsNode);
default:
return new AttrAssignNode(getPosition(), receiverNode, name, argsNode);
}
}

protected Node newMutatedAttrAssignNode(ArrayNode argsNode) {
int size = argsNode.size();

switch (size) {
case 1:
if (!(this instanceof AttrAssignOneArgNode)) {
return new AttrAssignOneArgNode(getPosition(), receiverNode, name, argsNode);
} else {
return this;
}
case 2:
if (!(this instanceof AttrAssignTwoArgNode)) {
return new AttrAssignTwoArgNode(getPosition(), receiverNode, name, argsNode);
} else {
return this;
}
case 3:
if (!(this instanceof AttrAssignThreeArgNode)) {
return new AttrAssignThreeArgNode(getPosition(), receiverNode, name, argsNode);
} else {
return this;
}
default:
return new AttrAssignNode(getPosition(), receiverNode, name, argsNode);
}
}

/**
* Set the argsNode
*
* @param argsNode set the arguments for this node.
*/
public Node setArgsNode(Node argsNode) {
// Empirical Observations:
// null -> Some arity
// argsNode == this.argsNode then check for arity changes
// newline(splatnode) -> argspushnode
if (this.argsNode == null && argsNode instanceof ArrayNode) {
return newAttrAssignNode((ArrayNode) argsNode);
} else if (this.argsNode == argsNode) {
return newMutatedAttrAssignNode((ArrayNode)argsNode);
}

setArgsInternal(argsNode);

return this;
}

private void setArgsInternal(Node argsNode) {
this.argsNode = argsNode;
if (argsNode instanceof ArrayNode) ((ArrayNode)argsNode).setLightweight(true);

return this;
}

public List<Node> childNodes() {

This file was deleted.

This file was deleted.

This file was deleted.

@@ -55,7 +55,7 @@ public CallNode(ISourcePosition position, Node receiverNode, String name, Node a

this.name = name;
this.receiverNode = receiverNode;
setArgsNode(argsNode);
this.argsNode = argsNode;
this.iterNode = iterNode;
}

@@ -96,11 +96,7 @@ public Node getArgsNode() {
*/
public Node setArgsNode(Node argsNode) {
this.argsNode = argsNode;
// If we have more than one arg, make sure the array created to contain them is not ObjectSpaced
if (argsNode instanceof ArrayNode) {
((ArrayNode)argsNode).setLightweight(true);
}


return argsNode;
}

@@ -51,7 +51,7 @@ public FCallNode(ISourcePosition position, String name) {
public FCallNode(ISourcePosition position, String name, Node argsNode, Node iterNode) {
super(position);
this.name = name;
setArgsNode(argsNode);
this.argsNode = argsNode;
this.iterNode = iterNode;
}

@@ -89,16 +89,11 @@ public Node getArgsNode() {
}

/**
* Set the argsNode. This is for re-writer and general interpretation.
*
* @param argsNode set the arguments for this node.
* Set the argsNode. Changes to parser means fcall is made before actual
* args are associated with fcall so we need a setter.
*/
public Node setArgsNode(Node argsNode) {
this.argsNode = argsNode;
// If we have more than one arg, make sure the array created to contain them is not ObjectSpaced
if (argsNode instanceof ArrayNode) {
((ArrayNode)argsNode).setLightweight(true);
}

return argsNode;
}

0 comments on commit a5b1f0a

Please sign in to comment.