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: 8cb2b3c67eba
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7dc2c98201bf
Choose a head ref
  • 5 commits
  • 17 files changed
  • 1 contributor

Commits on Mar 25, 2015

  1. Copy the full SHA
    9318c35 View commit details
  2. Copy the full SHA
    a4585eb View commit details
  3. [Truffle] Use a flag for detecting when we are loading core - as we d…

    …on't always have access to the true node.
    chrisseaton committed Mar 25, 2015
    Copy the full SHA
    e54c5c9 View commit details
  4. 6
    Copy the full SHA
    dcd8fba View commit details
  5. Copy the full SHA
    7dc2c98 View commit details
1 change: 1 addition & 0 deletions spec/truffle/tags/core/regexp/compile_tags.txt
Original file line number Diff line number Diff line change
@@ -11,3 +11,4 @@ fails:Regexp.compile given a String with escaped characters returns a Regexp wit
fails:Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding
fails:Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present
fails:Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present
fails:Regexp.compile given a String uses ASCII_8BIT encoding if third argument is 'n' or 'none' (case insensitive) and non-ascii characters
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/regexp/equal_value_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fails:Regexp#== is true if self does not specify /n option and other does
fails:Regexp#== is true if self specifies /n option and other does not
5 changes: 5 additions & 0 deletions spec/truffle/tags/core/regexp/union_tags.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
fails:Regexp.union raises ArgumentError if the arguments include conflicting fixed encoding Regexps
fails:Regexp.union returns a regular expression that will match passed arguments
fails:Regexp.union quotes any string arguments
fails:Regexp.union returns a Regexp if an array of string with special characters is passed
fails:Regexp.union uses to_str to convert arguments (if not Regexp)
fails:Regexp.union accepts a single array of patterns as arguments
5 changes: 5 additions & 0 deletions spec/truffle/tags/language/regexp/interpolation_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fails:Regexps with interpolation allows interpolation of strings
fails:Regexps with interpolation allows interpolation of literal regexps
fails:Regexps with interpolation allows interpolation of any class that responds to to_s
fails:Regexps with interpolation allows interpolation which mixes modifiers
fails:Regexps with interpolation allows interpolation to interact with other Regexp constructs
1 change: 1 addition & 0 deletions spec/truffle/tags/language/regexp/modifiers_tags.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
fails(inherited):Regexps with modifers supports ASII/Unicode modifiers
fails:Regexps with modifers supports /o (once)
Original file line number Diff line number Diff line change
@@ -84,7 +84,6 @@ public void init() {
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, MathNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ModuleNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, MutexNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, NumericNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ObjectSpaceNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ProcessNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ProcNodesFactory.getFactories());
32 changes: 0 additions & 32 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -3090,38 +3090,6 @@ public Object popObjectWithNumObj(VirtualFrame frame, RubyArray array, Object ob

}

@CoreMethod(names = "product", required = 1)
public abstract static class ProductNode extends ArrayCoreMethodNode {

public ProductNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ProductNode(ProductNode prev) {
super(prev);
}

@Specialization(guards = {"isObject", "isOtherObject"})
public Object product(RubyArray array, RubyArray other) {
final Object[] a = (Object[]) array.getStore();
final int aLength = array.getSize();

final Object[] b = (Object[]) other.getStore();
final int bLength = other.getSize();

final Object[] pairs = new Object[aLength * bLength];

for (int an = 0; an < aLength; an++) {
for (int bn = 0; bn < bLength; bn++) {
pairs[an * bLength + bn] = new RubyArray(getContext().getCoreLibrary().getArrayClass(), new Object[]{a[an], b[bn]}, 2);
}
}

return new RubyArray(getContext().getCoreLibrary().getArrayClass(), pairs, pairs.length);
}

}

@CoreMethod(names = {"push", "<<", "__append__"}, argumentsAsArray = true, raiseIfFrozenSelf = true)
public abstract static class PushNode extends ArrayCoreMethodNode {

129 changes: 0 additions & 129 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/HashNodes.java
Original file line number Diff line number Diff line change
@@ -44,84 +44,6 @@
@CoreClass(name = "Hash")
public abstract class HashNodes {

@CoreMethod(names = "==", required = 1)
public abstract static class EqualNode extends HashCoreMethodNode {

@Child private CallDispatchHeadNode eqlNode;
@Child private BasicObjectNodes.ReferenceEqualNode equalNode;

private final ConditionProfile byIdentityProfile = ConditionProfile.createBinaryProfile();

public EqualNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
eqlNode = DispatchHeadNodeFactory.createMethodCall(context, false, false, null);
equalNode = BasicObjectNodesFactory.ReferenceEqualNodeFactory.create(context, sourceSection, null, null);
}

public EqualNode(EqualNode prev) {
super(prev);
eqlNode = prev.eqlNode;
equalNode = prev.equalNode;
}

@Specialization(guards = {"isNull", "isNull(arguments[1])"})
public boolean equalNull(RubyHash a, RubyHash b) {
return true;
}

@Specialization
public boolean equal(RubyHash a, RubyHash b) {
notDesignedForCompilation();

final List<KeyValue> aEntries = HashOperations.verySlowToKeyValues(a);
final List<KeyValue> bEntries = HashOperations.verySlowToKeyValues(a);

if (aEntries.size() != bEntries.size()) {
return false;
}

// For each entry in a, check that there is a corresponding entry in b, and don't use entries in b more than once

final boolean[] bUsed = new boolean[bEntries.size()];

for (KeyValue aKeyValue : aEntries) {
boolean found = false;

for (int n = 0; n < bEntries.size(); n++) {
if (!bUsed[n]) {
// TODO: cast

final boolean equal;

if (byIdentityProfile.profile(a.isCompareByIdentity())) {
equal = (boolean) DebugOperations.send(getContext(), aKeyValue.getKey(), "equal?", null, bEntries.get(n).getKey());
} else {
equal = (boolean) DebugOperations.send(getContext(), aKeyValue.getKey(), "eql?", null, bEntries.get(n).getKey());
}

if (equal) {
bUsed[n] = true;
found = true;
break;
}
}
}

if (!found) {
return false;
}
}

return true;
}

@Specialization(guards = "!isRubyHash(arguments[1])")
public boolean equalNonHash(RubyHash a, Object b) {
return false;
}

}

@CoreMethod(names = "[]", onSingleton = true, argumentsAsArray = true, reallyDoesNeedSelf = true)
public abstract static class ConstructNode extends HashCoreMethodNode {

@@ -860,57 +782,6 @@ private void copyOther(RubyHash self, RubyHash from) {

}

@CoreMethod(names = { "has_key?", "key?", "include?", "member?" }, required = 1)
public abstract static class KeyNode extends HashCoreMethodNode {

@Child private CallDispatchHeadNode eqlNode;

public KeyNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
eqlNode = DispatchHeadNodeFactory.createMethodCall(context, false, false, null);
}

public KeyNode(KeyNode prev) {
super(prev);
eqlNode = prev.eqlNode;
}

@Specialization(guards = "isNull")
public boolean keyNull(RubyHash hash, Object key) {
return false;
}

@Specialization(guards = {"!isNull", "!isBuckets", "!isCompareByIdentity(arguments[0])"})
public boolean keyPackedArray(VirtualFrame frame, RubyHash hash, Object key) {
notDesignedForCompilation();

final int size = hash.getSize();
final Object[] store = (Object[]) hash.getStore();

for (int n = 0; n < HashOperations.SMALL_HASH_SIZE; n++) {
if (n < size && eqlNode.callBoolean(frame, store[n * 2], "eql?", null, key)) {
return true;
}
}

return false;
}

@Specialization(guards = {"isBuckets", "!isCompareByIdentity(arguments[0])"})
public boolean keyBuckets(VirtualFrame frame, RubyHash hash, Object key) {
notDesignedForCompilation();

for (KeyValue keyValue : HashOperations.verySlowToKeyValues(hash)) {
if (eqlNode.callBoolean(frame, keyValue.getKey(), "eql?", null, key)) {
return true;
}
}

return false;
}

}

@CoreMethod(names = {"map", "collect"}, needsBlock = true)
@ImportGuards(HashGuards.class)
public abstract static class MapNode extends YieldingCoreMethodNode {
129 changes: 0 additions & 129 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/NumericNodes.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1436,33 +1436,6 @@ public Object insert(VirtualFrame frame, RubyString string, int index, RubyStrin
}
}

@CoreMethod(names = "ljust", required = 1, optional = 1, lowerFixnumParameters = 0)
public abstract static class LjustNode extends CoreMethodNode {

public LjustNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public LjustNode(LjustNode prev) {
super(prev);
}

@Specialization
public RubyString ljust(RubyString string, int length, @SuppressWarnings("unused") UndefinedPlaceholder padding) {
notDesignedForCompilation();

return getContext().makeString(RubyString.ljust(string.toString(), length, " "));
}

@Specialization
public RubyString ljust(RubyString string, int length, RubyString padding) {
notDesignedForCompilation();

return getContext().makeString(RubyString.ljust(string.toString(), length, padding.toString()));
}

}

@CoreMethod(names = "match", required = 1, taintFromSelf = true)
public abstract static class MatchNode extends CoreMethodNode {

Loading