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

Commits on Jun 1, 2016

  1. [Truffle] Removed an incorrect optimization.

    This had the unfortunate side effect of making strings that should be CR_7BIT always CR_VALID. I thought this was okay -- some strings would just go on the slow path. But it affects other things, such as encoding negotiation, which has special semantics for two strings with different encodings, but which are both CR_7BIT.
    nirvdrum committed Jun 1, 2016
    Copy the full SHA
    c983189 View commit details
  2. Copy the full SHA
    5ab5f34 View commit details
Showing with 1 addition and 11 deletions.
  1. +0 −10 truffle/src/main/java/org/jruby/truffle/core/rope/RopeNodes.java
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
10 changes: 0 additions & 10 deletions truffle/src/main/java/org/jruby/truffle/core/rope/RopeNodes.java
Original file line number Diff line number Diff line change
@@ -189,16 +189,6 @@ private Rope makeSubstring(Rope base, int offset, int byteLength, ConditionProfi
}
}

// We short-circuit here to avoid the costly process of recalculating information we already know, such as
// whether the string has a valid code range.
if (isBinaryStringProfile.profile(base.getEncoding() == ASCIIEncoding.INSTANCE)) {
if (getContext().getOptions().ROPE_LAZY_SUBSTRINGS) {
return new SubstringRope(base, offset, byteLength, byteLength, CR_VALID);
} else {
return new ValidLeafRope(RopeOperations.extractRange(base, offset, byteLength), base.getEncoding(), byteLength);
}
}

return makeSubstringNon7Bit(base, offset, byteLength);
}

Original file line number Diff line number Diff line change
@@ -794,7 +794,7 @@ private int countSlow(DynamicObject string, DynamicObject... otherStrings) {
assert RubyGuards.isRubyString(string);

DynamicObject otherStr = otherStrings[0];
Encoding enc = encoding(otherStr);
Encoding enc = StringOperations.checkEncoding(getContext(), string, otherStr, this);

final boolean[]table = new boolean[StringSupport.TRANS_SIZE + 1];
StringSupport.TrTables tables = StringSupport.trSetupTable(StringOperations.getByteListReadOnly(otherStr), getContext().getJRubyRuntime(), table, null, true, enc);