Skip to content

Commit 4fb55ed

Browse files
committed
add more missing TruffleBoundaries for JDK15
1 parent c355d18 commit 4fb55ed

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes/BytesBuiltins.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
import com.oracle.graal.python.util.PythonUtils;
127127
import com.oracle.truffle.api.CompilerAsserts;
128128
import com.oracle.truffle.api.CompilerDirectives;
129+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
129130
import com.oracle.truffle.api.dsl.Cached;
130131
import com.oracle.truffle.api.dsl.CachedContext;
131132
import com.oracle.truffle.api.dsl.Fallback;
@@ -2021,6 +2022,7 @@ public static ExpectIntNode createExpectIntNode() {
20212022
}
20222023

20232024
@Override
2025+
@TruffleBoundary
20242026
protected List<byte[]> splitWhitespace(byte[] bytes, int len, int maxsplit) {
20252027
int i, j, maxcount = maxsplit;
20262028
List<byte[]> list = new ArrayList<>();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/traceback/TracebackBuiltins.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Object dir(@SuppressWarnings("unused") PTraceback self) {
8181
/**
8282
* Use the Truffle stacktrace attached to an exception to populate the information in the
8383
* {@link PTraceback} and its tb_next chain as far as the stacktrace goes for this segment.
84-
*
84+
*
8585
* @see GetTracebackNode
8686
*/
8787
abstract static class MaterializeTruffleStacktraceNode extends Node {
@@ -91,6 +91,7 @@ abstract static class MaterializeTruffleStacktraceNode extends Node {
9191
void doExisting(@SuppressWarnings("unused") PTraceback tb) {
9292
}
9393

94+
@TruffleBoundary
9495
@Specialization(guards = "!tb.isMaterialized()")
9596
void doMaterialize(PTraceback tb,
9697
@Cached MaterializeFrameNode materializeFrameNode,

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/literal/FormatStringLiteralNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public Object execute(VirtualFrame frame) {
123123
PythonUtils.getChars(value, 0, value.length(), result, nextIndex);
124124
nextIndex += value.length();
125125
}
126-
return new String(result);
126+
return PythonUtils.newString(result);
127127
}
128128

129129
private void ensureCastNodes() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/util/PythonUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ public static RootCallTarget getOrCreateCallTarget(RootNode rootNode) {
150150
return ct;
151151
}
152152

153+
@TruffleBoundary(allowInlining = true)
154+
public static String newString(char[] chars) {
155+
return new String(chars);
156+
}
157+
153158
@TruffleBoundary(allowInlining = true)
154159
public static StringBuilder newStringBuilder() {
155160
return new StringBuilder();

0 commit comments

Comments
 (0)