Skip to content

Commit

Permalink
[Truffle] Re-added the boundary to RopeOperations.create and made the…
Browse files Browse the repository at this point in the history
… String PE tests work with the boundary in place.
  • Loading branch information
nirvdrum committed Nov 17, 2016
1 parent 51fd3a3 commit 7142171
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -89,7 +90,6 @@ public static LeafRope create(byte[] bytes, Encoding encoding, CodeRange codeRan
case CR_VALID: return new ValidLeafRope(bytes, encoding, characterLength);
case CR_BROKEN: return new InvalidLeafRope(bytes, encoding);
default: {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new RuntimeException(StringUtils.format("Unknown code range type: %d", codeRange));
}
}
Expand Down
Expand Up @@ -128,7 +128,7 @@ public abstract static class CreateSimpleStringNode extends CoreMethodArrayArgum

@Specialization
public DynamicObject createSimpleString() {
return createString(RopeOperations.create(new byte[]{'t', 'e', 's', 't'}, UTF8Encoding.INSTANCE, CodeRange.CR_7BIT));
return createString(new AsciiOnlyLeafRope(new byte[]{'t', 'e', 's', 't'}, UTF8Encoding.INSTANCE));
}
}

Expand Down

0 comments on commit 7142171

Please sign in to comment.