Skip to content

Commit 3565117

Browse files
committed
Remove TruffleBoundary from j.l.String allocation using Unsafe.allocateInstance
1 parent 9a2d042 commit 3565117

File tree

1 file changed

+1
-3
lines changed
  • truffle/src/com.oracle.truffle.api.strings/src/com/oracle/truffle/api/strings

1 file changed

+1
-3
lines changed

truffle/src/com.oracle.truffle.api.strings/src/com/oracle/truffle/api/strings/TStringUnsafe.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ static int getJavaStringHashMasked(String s) {
163163
return hash;
164164
}
165165

166-
@TruffleBoundary
167166
private static String allocateJavaString() {
168167
try {
169168
return (String) UNSAFE.allocateInstance(String.class);
@@ -172,10 +171,9 @@ private static String allocateJavaString() {
172171
}
173172
}
174173

175-
@TruffleBoundary
176174
static String createJavaString(byte[] bytes, int stride, int hash) {
177175
if (stride < (COMPACT_STRINGS_ENABLED ? 0 : 1) || stride > 1) {
178-
throw new IllegalArgumentException("illegal stride!");
176+
throw CompilerDirectives.shouldNotReachHere("illegal stride!");
179177
}
180178
String ret = allocateJavaString();
181179
UNSAFE.putInt(ret, javaStringHashFieldOffset, hash);

0 commit comments

Comments
 (0)