Skip to content

Commit 96d9262

Browse files
committed
Do not qualify inner classes
1 parent ed778a2 commit 96d9262

File tree

1 file changed

+26
-22
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io

1 file changed

+26
-22
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io/BytesIOBuiltins.java

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@
9696
import com.oracle.graal.python.builtins.objects.bytes.BytesBuiltins;
9797
import com.oracle.graal.python.builtins.objects.bytes.PBytes;
9898
import com.oracle.graal.python.builtins.objects.common.HashingStorageLibrary;
99-
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes;
99+
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.EnsureCapacityNode;
100+
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.GetInternalArrayNode;
101+
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.GetInternalByteArrayNode;
102+
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.GetInternalObjectArrayNode;
103+
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.SetLenNode;
100104
import com.oracle.graal.python.builtins.objects.dict.PDict;
101105
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
102106
import com.oracle.graal.python.lib.PyIndexCheckNode;
@@ -204,7 +208,7 @@ Object exportsError(PBytesIO self, Object size) {
204208
}
205209

206210
static PBytes readBytes(PBytesIO self, int size,
207-
SequenceStorageNodes.GetInternalByteArrayNode getBytes,
211+
GetInternalByteArrayNode getBytes,
208212
PythonObjectFactory factory) {
209213
if (size == 0) {
210214
return factory.createBytes(PythonUtils.EMPTY_BYTE_ARRAY);
@@ -235,7 +239,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
235239

236240
@Specialization(guards = "self.hasBuf()")
237241
Object read(PBytesIO self, int len,
238-
@Cached SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
242+
@Cached GetInternalByteArrayNode getBytes) {
239243
int size = len;
240244
/* adjust invalid sizes */
241245
int n = self.getStringSize() - self.getPos();
@@ -261,7 +265,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
261265
}
262266

263267
static int scanEOL(PBytesIO self, int l,
264-
SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
268+
GetInternalByteArrayNode getBytes) {
265269
assert (self.hasBuf());
266270
assert (self.getPos() >= 0);
267271

@@ -308,7 +312,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
308312

309313
@Specialization(guards = "self.hasBuf()")
310314
Object readline(PBytesIO self, int size,
311-
@Cached SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
315+
@Cached GetInternalByteArrayNode getBytes) {
312316
int n = scanEOL(self, size, getBytes);
313317
return readBytes(self, n, getBytes, factory());
314318
}
@@ -326,7 +330,7 @@ protected ArgumentClinicProvider getArgumentClinic() {
326330

327331
@Specialization(guards = "self.hasBuf()")
328332
Object readlines(PBytesIO self, int maxsize,
329-
@Cached SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
333+
@Cached GetInternalByteArrayNode getBytes) {
330334
ArrayBuilder<Object> result = new ArrayBuilder<>();
331335

332336
int n;
@@ -396,15 +400,15 @@ protected ArgumentClinicProvider getArgumentClinic() {
396400

397401
@Specialization(guards = {"self.hasBuf()", "checkExports(self)"})
398402
Object truncate(PBytesIO self, @SuppressWarnings("unused") PNone size,
399-
@Shared("i") @Cached SequenceStorageNodes.GetInternalArrayNode internalArray,
400-
@Shared("l") @Cached SequenceStorageNodes.SetLenNode setLenNode) {
403+
@Shared("i") @Cached GetInternalArrayNode internalArray,
404+
@Shared("l") @Cached SetLenNode setLenNode) {
401405
return truncate(self, self.getPos(), internalArray, setLenNode);
402406
}
403407

404408
@Specialization(guards = {"self.hasBuf()", "checkExports(self)", "size >= 0", "size < self.getStringSize()"})
405409
Object truncate(PBytesIO self, int size,
406-
@Shared("i") @Cached SequenceStorageNodes.GetInternalArrayNode internalArray,
407-
@Shared("l") @Cached SequenceStorageNodes.SetLenNode setLenNode) {
410+
@Shared("i") @Cached GetInternalArrayNode internalArray,
411+
@Shared("l") @Cached SetLenNode setLenNode) {
408412
self.setStringSize(size);
409413
resizeBuffer(self, size, internalArray, factory());
410414
setLenNode.execute(self.getBuf().getSequenceStorage(), size);
@@ -420,8 +424,8 @@ static Object same(@SuppressWarnings("unused") PBytesIO self, int size) {
420424
Object obj(VirtualFrame frame, PBytesIO self, Object arg,
421425
@Cached PyNumberAsSizeNode asSizeNode,
422426
@Cached PyNumberIndexNode indexNode,
423-
@Shared("i") @Cached SequenceStorageNodes.GetInternalArrayNode internalArray,
424-
@Shared("l") @Cached SequenceStorageNodes.SetLenNode setLenNode) {
427+
@Shared("i") @Cached GetInternalArrayNode internalArray,
428+
@Shared("l") @Cached SetLenNode setLenNode) {
425429
int size = asSizeNode.executeExact(frame, indexNode.execute(frame, arg), OverflowError);
426430
if (size >= 0) {
427431
if (size < self.getStringSize()) {
@@ -459,14 +463,14 @@ protected static void unshareBuffer(PBytesIO self, int size, byte[] buf,
459463
}
460464

461465
protected static void unshareBuffer(PBytesIO self, int size,
462-
SequenceStorageNodes.GetInternalArrayNode internalArray,
466+
GetInternalArrayNode internalArray,
463467
PythonObjectFactory factory) {
464468
byte[] buf = (byte[]) internalArray.execute(self.getBuf().getSequenceStorage());
465469
unshareBuffer(self, size, buf, factory);
466470
}
467471

468472
protected static void resizeBuffer(PBytesIO self, int size,
469-
SequenceStorageNodes.GetInternalArrayNode internalArray,
473+
GetInternalArrayNode internalArray,
470474
PythonObjectFactory factory) {
471475
int alloc = self.getStringSize();
472476
if (size < alloc) {
@@ -486,9 +490,9 @@ abstract static class WriteNode extends ClosedCheckPythonBinaryBuiltinNode {
486490
Object doWrite(PBytesIO self, Object b,
487491
@CachedLibrary("b") PythonBufferAcquireLibrary acquireLib,
488492
@CachedLibrary(limit = "2") PythonBufferAccessLibrary bufferLib,
489-
@Cached SequenceStorageNodes.GetInternalArrayNode internalArray,
490-
@Cached SequenceStorageNodes.EnsureCapacityNode ensureCapacityNode,
491-
@Cached SequenceStorageNodes.SetLenNode setLenNode) {
493+
@Cached GetInternalArrayNode internalArray,
494+
@Cached EnsureCapacityNode ensureCapacityNode,
495+
@Cached SetLenNode setLenNode) {
492496
Object buffer = acquireLib.acquireReadonly(b);
493497
try {
494498
int len = bufferLib.getBufferLength(buffer);
@@ -661,7 +665,7 @@ Object closedError(PBytesIO self, int pos, int whence) {
661665
abstract static class GetBufferNode extends ClosedCheckPythonUnaryBuiltinNode {
662666
@Specialization(guards = "self.hasBuf()")
663667
Object doit(VirtualFrame frame, PBytesIO self,
664-
@Cached SequenceStorageNodes.GetInternalArrayNode internalArray,
668+
@Cached GetInternalArrayNode internalArray,
665669
@Cached PyMemoryViewFromObject memoryViewNode) {
666670
// if (SHARED_BUF(b))
667671
unshareBuffer(self, self.getStringSize(), internalArray, factory());
@@ -686,7 +690,7 @@ protected static boolean shouldUnshare(PBytesIO self) {
686690

687691
@Specialization(guards = {"self.hasBuf()", "shouldCopy(self)"})
688692
Object copy(PBytesIO self,
689-
@Cached SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
693+
@Cached GetInternalByteArrayNode getBytes) {
690694
byte[] buf = getBytes.execute(self.getBuf().getSequenceStorage());
691695
return factory().createBytes(PythonUtils.arrayCopyOf(buf, self.getStringSize()));
692696
}
@@ -698,7 +702,7 @@ static Object doit(PBytesIO self) {
698702

699703
@Specialization(guards = {"self.hasBuf()", "!shouldCopy(self)", "shouldUnshare(self)"})
700704
Object unshare(PBytesIO self,
701-
@Cached SequenceStorageNodes.GetInternalArrayNode internalArray) {
705+
@Cached GetInternalArrayNode internalArray) {
702706
// if (SHARED_BUF(self))
703707
unshareBuffer(self, self.getStringSize(), internalArray, factory());
704708
// else resize self.buf
@@ -724,7 +728,7 @@ Object doit(VirtualFrame frame, PBytesIO self,
724728
abstract static class SetStateNode extends PythonBinaryBuiltinNode {
725729
@Specialization(guards = "checkExports(self)")
726730
Object doit(VirtualFrame frame, PBytesIO self, PTuple state,
727-
@Cached SequenceStorageNodes.GetInternalObjectArrayNode getArray,
731+
@Cached GetInternalObjectArrayNode getArray,
728732
@Cached WriteNode writeNode,
729733
@Cached PyIndexCheckNode indexCheckNode,
730734
@Cached PyNumberAsSizeNode asSizeNode,
@@ -867,7 +871,7 @@ abstract static class IternextNode extends ClosedCheckPythonUnaryBuiltinNode {
867871

868872
@Specialization(guards = "self.hasBuf()")
869873
Object doit(PBytesIO self,
870-
@Cached SequenceStorageNodes.GetInternalByteArrayNode getBytes) {
874+
@Cached GetInternalByteArrayNode getBytes) {
871875
int n = scanEOL(self, -1, getBytes);
872876
if (n == 0) {
873877
throw raise(StopIteration);

0 commit comments

Comments
 (0)