Skip to content

Commit 6c2624c

Browse files
committed
Remove TypedSequenceStorage
1 parent 32d84e2 commit 6c2624c

File tree

9 files changed

+14
-44
lines changed

9 files changed

+14
-44
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/SequenceStorageNodes.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage.StorageType;
129129
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorageFactory;
130130
import com.oracle.graal.python.runtime.sequence.storage.SequenceStoreException;
131-
import com.oracle.graal.python.runtime.sequence.storage.TypedSequenceStorage;
132131
import com.oracle.graal.python.util.BiFunction;
133132
import com.oracle.graal.python.util.OverflowException;
134133
import com.oracle.graal.python.util.PythonUtils;
@@ -3387,7 +3386,7 @@ static Object[] doObjectSequenceStorage(ObjectSequenceStorage s) {
33873386
}
33883387

33893388
@Specialization
3390-
static Object[] doTypedSequenceStorage(Node inliningTarget, TypedSequenceStorage s,
3389+
static Object[] doArrayBasedSequenceStorage(Node inliningTarget, ArrayBasedSequenceStorage s,
33913390
@Cached CopyInternalArrayNode copy) {
33923391
Object[] internalArray = copy.execute(inliningTarget, s);
33933392
assert internalArray.length == s.length();
@@ -3405,7 +3404,7 @@ static Object[] doEmptySequenceStorage(@SuppressWarnings("unused") EmptySequence
34053404
return PythonUtils.EMPTY_OBJECT_ARRAY;
34063405
}
34073406

3408-
@Specialization(replaces = {"doObjectSequenceStorage", "doTypedSequenceStorage", "doNativeObject", "doEmptySequenceStorage"})
3407+
@Specialization(replaces = {"doObjectSequenceStorage", "doArrayBasedSequenceStorage", "doNativeObject", "doEmptySequenceStorage"})
34093408
static Object[] doGeneric(Node inliningTarget, SequenceStorage s,
34103409
@Exclusive @Cached GetItemScalarNode getItemNode) {
34113410
return materializeGeneric(inliningTarget, s, s.length(), getItemNode);
@@ -3473,7 +3472,7 @@ protected final SequenceStorage executeCached(SequenceStorage storage, int index
34733472
protected abstract SequenceStorage execute(Node inliningTarget, SequenceStorage storage, int index, Object value, boolean recursive);
34743473

34753474
@Specialization
3476-
protected static SequenceStorage doStorage(EmptySequenceStorage storage, int index, Object value, boolean recursive,
3475+
protected static SequenceStorage doEmptyStorage(EmptySequenceStorage storage, int index, Object value, boolean recursive,
34773476
@Shared @Cached(inline = false) InsertItemNode recursiveNode) {
34783477
if (!recursive) {
34793478
throw CompilerDirectives.shouldNotReachHere();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ArrayBasedSequenceStorage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ public abstract class ArrayBasedSequenceStorage extends BasicSequenceStorage {
5454

5555
public abstract ArrayBasedSequenceStorage createEmpty(int newCapacity);
5656

57+
@Override
58+
public ObjectSequenceStorage generalizeFor(Object value, SequenceStorage other) {
59+
return new ObjectSequenceStorage(getInternalArray());
60+
}
61+
5762
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/BoolSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import com.oracle.graal.python.util.PythonUtils;
3131

32-
public final class BoolSequenceStorage extends TypedSequenceStorage {
32+
public final class BoolSequenceStorage extends ArrayBasedSequenceStorage {
3333

3434
private boolean[] values;
3535

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/ByteSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import com.oracle.truffle.api.library.ExportMessage;
4141

4242
@ExportLibrary(PythonBufferAccessLibrary.class)
43-
public final class ByteSequenceStorage extends TypedSequenceStorage {
43+
public final class ByteSequenceStorage extends ArrayBasedSequenceStorage {
4444

4545
private byte[] values;
4646

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/DoubleSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import com.oracle.graal.python.util.PythonUtils;
3131

32-
public final class DoubleSequenceStorage extends TypedSequenceStorage {
32+
public final class DoubleSequenceStorage extends ArrayBasedSequenceStorage {
3333

3434
private double[] values;
3535

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/IntSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import com.oracle.graal.python.util.PythonUtils;
3131

32-
public final class IntSequenceStorage extends TypedSequenceStorage {
32+
public final class IntSequenceStorage extends ArrayBasedSequenceStorage {
3333

3434
private int[] values;
3535

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/LongSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import com.oracle.graal.python.builtins.objects.ints.PInt;
3232
import com.oracle.graal.python.util.PythonUtils;
3333

34-
public final class LongSequenceStorage extends TypedSequenceStorage {
34+
public final class LongSequenceStorage extends ArrayBasedSequenceStorage {
3535

3636
private long[] values;
3737

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/MroSequenceStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import com.oracle.truffle.api.strings.TruffleString;
6060
import com.oracle.truffle.api.utilities.CyclicAssumption;
6161

62-
public final class MroSequenceStorage extends TypedSequenceStorage {
62+
public final class MroSequenceStorage extends ArrayBasedSequenceStorage {
6363

6464
private final TruffleString className;
6565
/**

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/TypedSequenceStorage.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)