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

Commits on Nov 17, 2016

  1. Copy the full SHA
    650a81d View commit details
  2. Copy the full SHA
    4f9e0c5 View commit details
  3. Copy the full SHA
    621352d View commit details
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ public AsciiOnlyLeafRope(byte[] bytes, Encoding encoding) {
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}

Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@ private ConcatRope(Rope left, Rope right, Encoding encoding, CodeRange codeRange
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}

Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ public InvalidLeafRope(byte[] bytes, Encoding encoding) {
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}

Original file line number Diff line number Diff line change
@@ -62,9 +62,7 @@ private static int length(int value) {
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException(
"Cannot fast-path updating encoding with different code range.");
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}

return new LazyIntRope(value, newEncoding, length(value));
Original file line number Diff line number Diff line change
@@ -422,6 +422,7 @@ public LeafRope makeUnknownLeafRopeBinary(byte[] bytes, Encoding encoding, CodeR
return new ValidLeafRope(bytes, encoding, bytes.length);
}

@TruffleBoundary
@Specialization(guards = { "isUnknown(codeRange)", "!isEmpty(bytes)", "!isBinaryString(encoding)", "isAsciiCompatible(encoding)" })
public LeafRope makeUnknownLeafRopeAsciiCompatible(byte[] bytes, Encoding encoding, CodeRange codeRange, Object characterLength,
@Cached("createBinaryProfile()") ConditionProfile discovered7BitProfile,
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ public class RopeOperations {

private static final ConcurrentHashMap<Encoding, Charset> encodingToCharsetMap = new ConcurrentHashMap<>();

@TruffleBoundary
public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRange) {
if (bytes.length == 1) {
final int index = bytes[0] & 0xff;
@@ -95,6 +96,7 @@ public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRan
}
}

@TruffleBoundary
public static Rope withEncodingVerySlow(Rope originalRope, Encoding newEncoding, CodeRange newCodeRange) {
if ((originalRope.getEncoding() == newEncoding) && (originalRope.getCodeRange() == newCodeRange)) {
return originalRope;
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ private SubstringRope(Rope child, Encoding encoding, boolean singleByteOptimizab
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}

Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ public ValidLeafRope(byte[] bytes, Encoding encoding, int characterLength) {
@Override
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
if (newCodeRange != getCodeRange()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedOperationException("Cannot fast-path updating encoding with different code range.");
}