Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 05f1f9c0fa8c
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: db3fa9fbb2be
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Jun 11, 2016

  1. Copy the full SHA
    826ebaa View commit details
  2. [Truffle] Fix typo.

    eregon committed Jun 11, 2016
    Copy the full SHA
    0c4ccdc View commit details
  3. Copy the full SHA
    619f59f View commit details
  4. Copy the full SHA
    db3fa9f View commit details
4 changes: 2 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -329,7 +329,7 @@ def mvn(*args)
end

def maven_options(*options)
maven_options = %w[-DskipTests]
maven_options = []
offline = options.delete('--offline')
if offline
maven_options.push "-Dmaven.repo.local=#{Utilities.find_repo('jruby-build-pack')}/maven"
@@ -431,7 +431,7 @@ def checkout(branch)

def bootstrap(*options)
maven_options, other_options = maven_options(*options)
mvn *maven_options, '-DskipTests', '-Pbootstrap-no-launcher'
mvn *maven_options, '-Pbootstrap-no-launcher'
end

def build(*options)
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ protected ObjectIVarGetNode createObjectIVarGetNode() {
public abstract static class ObjectIVarSetPrimitiveNode extends PrimitiveArrayArgumentsNode {

@Specialization
public Object ivarGet(DynamicObject object, DynamicObject name, Object value,
public Object ivarSet(DynamicObject object, DynamicObject name, Object value,
@Cached("createObjectIVarSetNode()") ObjectIVarSetNode iVarSetNode) {
return iVarSetNode.executeIVarSet(object, Layouts.SYMBOL.getString(name), value);
}
Original file line number Diff line number Diff line change
@@ -28,4 +28,9 @@ public String toString() {
return RopeOperations.decodeUTF8(this);
}

public LeafRope computeHashCode() {
hashCode();
return this;
}

}
Original file line number Diff line number Diff line change
@@ -27,24 +27,24 @@ public class RopeConstants {
static {
final byte[] emptyBytes = new byte[] {};

EMPTY_UTF8_ROPE = new AsciiOnlyLeafRope(emptyBytes, UTF8Encoding.INSTANCE);
EMPTY_US_ASCII_ROPE = new AsciiOnlyLeafRope(emptyBytes, USASCIIEncoding.INSTANCE);
EMPTY_ASCII_8BIT_ROPE = new AsciiOnlyLeafRope(emptyBytes, ASCIIEncoding.INSTANCE);
EMPTY_UTF8_ROPE = new AsciiOnlyLeafRope(emptyBytes, UTF8Encoding.INSTANCE).computeHashCode();
EMPTY_US_ASCII_ROPE = new AsciiOnlyLeafRope(emptyBytes, USASCIIEncoding.INSTANCE).computeHashCode();
EMPTY_ASCII_8BIT_ROPE = new AsciiOnlyLeafRope(emptyBytes, ASCIIEncoding.INSTANCE).computeHashCode();

for (int i = 0; i < 128; i++) {
final byte[] bytes = new byte[] { (byte) i };

UTF8_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, UTF8Encoding.INSTANCE);
US_ASCII_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, USASCIIEncoding.INSTANCE);
ASCII_8BIT_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, ASCIIEncoding.INSTANCE);
UTF8_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, UTF8Encoding.INSTANCE).computeHashCode();
US_ASCII_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, USASCIIEncoding.INSTANCE).computeHashCode();
ASCII_8BIT_SINGLE_BYTE_ROPES[i] = new AsciiOnlyLeafRope(bytes, ASCIIEncoding.INSTANCE).computeHashCode();
}

for (int i = 128; i < 256; i++) {
final byte[] bytes = new byte[] { (byte) i };

UTF8_SINGLE_BYTE_ROPES[i] = new InvalidLeafRope(bytes, UTF8Encoding.INSTANCE);
US_ASCII_SINGLE_BYTE_ROPES[i] = new InvalidLeafRope(bytes, USASCIIEncoding.INSTANCE);
ASCII_8BIT_SINGLE_BYTE_ROPES[i] = new ValidLeafRope(bytes, ASCIIEncoding.INSTANCE, 1);
UTF8_SINGLE_BYTE_ROPES[i] = new InvalidLeafRope(bytes, UTF8Encoding.INSTANCE).computeHashCode();
US_ASCII_SINGLE_BYTE_ROPES[i] = new InvalidLeafRope(bytes, USASCIIEncoding.INSTANCE).computeHashCode();
ASCII_8BIT_SINGLE_BYTE_ROPES[i] = new ValidLeafRope(bytes, ASCIIEncoding.INSTANCE, 1).computeHashCode();
}
}

Original file line number Diff line number Diff line change
@@ -126,6 +126,7 @@
import org.jruby.truffle.core.rope.RopeOperations;
import org.jruby.truffle.core.rope.SubstringRope;
import org.jruby.truffle.core.string.StringNodesFactory.StringAreComparableNodeGen;
import org.jruby.truffle.core.string.StringNodesFactory.StringEqualNodeGen;
import org.jruby.truffle.language.CheckLayoutNode;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyGuards;
@@ -298,14 +299,14 @@ protected static boolean isSingleByteString(DynamicObject string) {
@CoreMethod(names = {"==", "===", "eql?"}, required = 1)
public abstract static class EqualNode extends CoreMethodArrayArgumentsNode {

@Child private StringEqualPrimitiveNode stringEqualNode;
@Child private StringEqualNode stringEqualNode;
@Child private KernelNodes.RespondToNode respondToNode;
@Child private CallDispatchHeadNode objectEqualNode;
@Child private CheckLayoutNode checkLayoutNode;

public EqualNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
stringEqualNode = StringNodesFactory.StringEqualPrimitiveNodeFactory.create(new RubyNode[]{});
stringEqualNode = StringEqualNodeGen.create(null, null);
}

@Specialization(guards = "isRubyString(b)")
@@ -3011,9 +3012,9 @@ protected static Encoding getEncoding(DynamicObject string) {

}

@Primitive(name = "string_equal", needsSelf = true)
@ImportStatic(StringGuards.class)
public static abstract class StringEqualPrimitiveNode extends PrimitiveArrayArgumentsNode {
@NodeChildren({ @NodeChild("first"), @NodeChild("second") })
public static abstract class StringEqualNode extends RubyNode {

@Child StringAreComparableNode areComparableNode;