Skip to content

Commit db7ab8f

Browse files
committed
Resolve DSL warnings in the lzma module
1 parent 6392da1 commit db7ab8f

File tree

3 files changed

+122
-136
lines changed

3 files changed

+122
-136
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/lzma/LZMADecompressorBuiltins.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
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.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -77,6 +77,7 @@
7777
import com.oracle.graal.python.nodes.truffle.PythonArithmeticTypes;
7878
import com.oracle.graal.python.nodes.util.CannotCastException;
7979
import com.oracle.graal.python.nodes.util.CastToJavaIntExactNode;
80+
import com.oracle.truffle.api.dsl.Bind;
8081
import com.oracle.truffle.api.dsl.Cached;
8182
import com.oracle.truffle.api.dsl.Cached.Shared;
8283
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
@@ -85,6 +86,7 @@
8586
import com.oracle.truffle.api.dsl.Specialization;
8687
import com.oracle.truffle.api.dsl.TypeSystemReference;
8788
import com.oracle.truffle.api.frame.VirtualFrame;
89+
import com.oracle.truffle.api.nodes.Node;
8890

8991
@CoreFunctions(extendClasses = PythonBuiltinClassType.PLZMADecompressor)
9092
public class LZMADecompressorBuiltins extends PythonBuiltins {
@@ -192,21 +194,23 @@ protected ArgumentClinicProvider getArgumentClinic() {
192194

193195
@Specialization(guards = {"!self.isEOF()"})
194196
PBytes doBytes(LZMADecompressor self, PBytesLike data, int maxLength,
197+
@Bind("this") Node inliningTarget,
195198
@Cached SequenceStorageNodes.GetInternalByteArrayNode toBytes,
196199
@Shared("d") @Cached LZMANodes.DecompressNode decompress) {
197200
byte[] bytes = toBytes.execute(data.getSequenceStorage());
198201
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));
200203

201204
}
202205

203206
@Specialization(guards = {"!self.isEOF()"})
204207
PBytes doObject(VirtualFrame frame, LZMADecompressor self, Object data, int maxLength,
208+
@Bind("this") Node inliningTarget,
205209
@Cached BytesNodes.ToBytesNode toBytes,
206210
@Shared("d") @Cached LZMANodes.DecompressNode decompress) {
207211
byte[] bytes = toBytes.execute(frame, data);
208212
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));
210214
}
211215

212216
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)