Skip to content

Commit 48dfda1

Browse files
author
Franziska Geiger
committed
Added @shared annotation
1 parent 3e2c655 commit 48dfda1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CodecsModuleBuiltins.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
import com.oracle.truffle.api.CompilerDirectives;
7474
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
7575
import com.oracle.truffle.api.dsl.Cached;
76+
import com.oracle.truffle.api.dsl.Cached.Shared;
7677
import com.oracle.truffle.api.dsl.Fallback;
7778
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
7879
import com.oracle.truffle.api.dsl.ImportStatic;
@@ -341,13 +342,13 @@ Object encode(Object str, @SuppressWarnings("unused") Object errors) {
341342
abstract static class UnicodeEscapeDecode extends PythonBinaryBuiltinNode {
342343
@Specialization(guards = "isBytes(bytes)")
343344
Object encode(VirtualFrame frame, Object bytes, @SuppressWarnings("unused") PNone errors,
344-
@Cached("create()") BytesNodes.ToBytesNode toBytes) {
345+
@Shared("toBytes") @Cached("create()") BytesNodes.ToBytesNode toBytes) {
345346
return encode(frame, bytes, "", toBytes);
346347
}
347348

348349
@Specialization(guards = "isBytes(bytes)")
349350
Object encode(VirtualFrame frame, Object bytes, @SuppressWarnings("unused") String errors,
350-
@Cached("create()") BytesNodes.ToBytesNode toBytes) {
351+
@Shared("toBytes") @Cached("create()") BytesNodes.ToBytesNode toBytes) {
351352
// for now we'll just parse this as a String, ignoring any error strategies
352353
PythonCore core = getCore();
353354
byte[] byteArray = toBytes.execute(frame, bytes);

0 commit comments

Comments
 (0)