|
73 | 73 | import com.oracle.truffle.api.CompilerDirectives;
|
74 | 74 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
75 | 75 | import com.oracle.truffle.api.dsl.Cached;
|
| 76 | +import com.oracle.truffle.api.dsl.Cached.Shared; |
76 | 77 | import com.oracle.truffle.api.dsl.Fallback;
|
77 | 78 | import com.oracle.truffle.api.dsl.GenerateNodeFactory;
|
78 | 79 | import com.oracle.truffle.api.dsl.ImportStatic;
|
@@ -341,13 +342,13 @@ Object encode(Object str, @SuppressWarnings("unused") Object errors) {
|
341 | 342 | abstract static class UnicodeEscapeDecode extends PythonBinaryBuiltinNode {
|
342 | 343 | @Specialization(guards = "isBytes(bytes)")
|
343 | 344 | Object encode(VirtualFrame frame, Object bytes, @SuppressWarnings("unused") PNone errors,
|
344 |
| - @Cached("create()") BytesNodes.ToBytesNode toBytes) { |
| 345 | + @Shared("toBytes") @Cached("create()") BytesNodes.ToBytesNode toBytes) { |
345 | 346 | return encode(frame, bytes, "", toBytes);
|
346 | 347 | }
|
347 | 348 |
|
348 | 349 | @Specialization(guards = "isBytes(bytes)")
|
349 | 350 | Object encode(VirtualFrame frame, Object bytes, @SuppressWarnings("unused") String errors,
|
350 |
| - @Cached("create()") BytesNodes.ToBytesNode toBytes) { |
| 351 | + @Shared("toBytes") @Cached("create()") BytesNodes.ToBytesNode toBytes) { |
351 | 352 | // for now we'll just parse this as a String, ignoring any error strategies
|
352 | 353 | PythonCore core = getCore();
|
353 | 354 | byte[] byteArray = toBytes.execute(frame, bytes);
|
|
0 commit comments