|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * The Universal Permissive License (UPL), Version 1.0
|
|
77 | 77 | import com.oracle.graal.python.nodes.truffle.PythonArithmeticTypes;
|
78 | 78 | import com.oracle.graal.python.nodes.util.CannotCastException;
|
79 | 79 | import com.oracle.graal.python.nodes.util.CastToJavaIntExactNode;
|
| 80 | +import com.oracle.truffle.api.dsl.Bind; |
80 | 81 | import com.oracle.truffle.api.dsl.Cached;
|
81 | 82 | import com.oracle.truffle.api.dsl.Cached.Shared;
|
82 | 83 | import com.oracle.truffle.api.dsl.GenerateNodeFactory;
|
|
85 | 86 | import com.oracle.truffle.api.dsl.Specialization;
|
86 | 87 | import com.oracle.truffle.api.dsl.TypeSystemReference;
|
87 | 88 | import com.oracle.truffle.api.frame.VirtualFrame;
|
| 89 | +import com.oracle.truffle.api.nodes.Node; |
88 | 90 |
|
89 | 91 | @CoreFunctions(extendClasses = PythonBuiltinClassType.PLZMADecompressor)
|
90 | 92 | public class LZMADecompressorBuiltins extends PythonBuiltins {
|
@@ -192,21 +194,23 @@ protected ArgumentClinicProvider getArgumentClinic() {
|
192 | 194 |
|
193 | 195 | @Specialization(guards = {"!self.isEOF()"})
|
194 | 196 | PBytes doBytes(LZMADecompressor self, PBytesLike data, int maxLength,
|
| 197 | + @Bind("this") Node inliningTarget, |
195 | 198 | @Cached SequenceStorageNodes.GetInternalByteArrayNode toBytes,
|
196 | 199 | @Shared("d") @Cached LZMANodes.DecompressNode decompress) {
|
197 | 200 | byte[] bytes = toBytes.execute(data.getSequenceStorage());
|
198 | 201 | int len = data.getSequenceStorage().length();
|
199 |
| - return factory().createBytes(decompress.execute(self, bytes, len, maxLength)); |
| 202 | + return factory().createBytes(decompress.execute(inliningTarget, self, bytes, len, maxLength)); |
200 | 203 |
|
201 | 204 | }
|
202 | 205 |
|
203 | 206 | @Specialization(guards = {"!self.isEOF()"})
|
204 | 207 | PBytes doObject(VirtualFrame frame, LZMADecompressor self, Object data, int maxLength,
|
| 208 | + @Bind("this") Node inliningTarget, |
205 | 209 | @Cached BytesNodes.ToBytesNode toBytes,
|
206 | 210 | @Shared("d") @Cached LZMANodes.DecompressNode decompress) {
|
207 | 211 | byte[] bytes = toBytes.execute(frame, data);
|
208 | 212 | int len = bytes.length;
|
209 |
| - return factory().createBytes(decompress.execute(self, bytes, len, maxLength)); |
| 213 | + return factory().createBytes(decompress.execute(inliningTarget, self, bytes, len, maxLength)); |
210 | 214 | }
|
211 | 215 |
|
212 | 216 | @SuppressWarnings("unused")
|
|
0 commit comments