Skip to content

Commit 02c5cee

Browse files
committed
Remove obsolete methods 'PSequence.setSlice'.
1 parent 806a6e6 commit 02c5cee

File tree

5 files changed

+0
-67
lines changed

5 files changed

+0
-67
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/array/PArray.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
*/
2626
package com.oracle.graal.python.builtins.objects.array;
2727

28-
import com.oracle.graal.python.builtins.objects.slice.PSlice;
2928
import com.oracle.graal.python.builtins.objects.type.PythonClass;
3029
import com.oracle.graal.python.runtime.sequence.PLenSupplier;
3130
import com.oracle.graal.python.runtime.sequence.PSequence;
@@ -44,16 +43,6 @@ public PArray(PythonClass clazz, SequenceStorage store) {
4443
this.store = store;
4544
}
4645

47-
@Override
48-
public void setSlice(int start, int stop, int step, PSequence value) {
49-
throw new UnsupportedOperationException();
50-
}
51-
52-
@Override
53-
public void setSlice(PSlice slice, PSequence value) {
54-
throw new UnsupportedOperationException();
55-
}
56-
5746
@Override
5847
public SequenceStorage getSequenceStorage() {
5948
return store;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/bytes/PByteArray.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
*/
2626
package com.oracle.graal.python.builtins.objects.bytes;
2727

28-
import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
29-
3028
import java.util.Arrays;
3129

32-
import com.oracle.graal.python.PythonLanguage;
3330
import com.oracle.graal.python.builtins.objects.slice.PSlice;
3431
import com.oracle.graal.python.builtins.objects.type.PythonClass;
3532
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
@@ -39,7 +36,6 @@
3936
import com.oracle.graal.python.runtime.sequence.storage.EmptySequenceStorage;
4037
import com.oracle.graal.python.runtime.sequence.storage.NativeSequenceStorage;
4138
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
42-
import com.oracle.graal.python.runtime.sequence.storage.SequenceStoreException;
4339
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage.ListStorageType;
4440
import com.oracle.truffle.api.CompilerAsserts;
4541

@@ -57,29 +53,6 @@ public PByteArray(PythonClass cls, SequenceStorage store) {
5753
this.store = store;
5854
}
5955

60-
@Override
61-
public void setSlice(int start, int stop, int step, PSequence value) {
62-
final int normalizedStart = SequenceUtil.normalizeSliceStart(start, step, store.length());
63-
int normalizedStop = SequenceUtil.normalizeSliceStop(stop, step, store.length());
64-
65-
if (normalizedStop < normalizedStart) {
66-
normalizedStop = normalizedStart;
67-
}
68-
69-
SequenceStorage other = value.getSequenceStorage();
70-
try {
71-
store.setSliceInBound(normalizedStart, normalizedStop, step, other);
72-
} catch (SequenceStoreException e) {
73-
throw PythonLanguage.getCore().raise(TypeError, "an integer is required");
74-
}
75-
}
76-
77-
@Override
78-
public void setSlice(PSlice slice, PSequence value) {
79-
PSlice.SliceInfo sliceInfo = slice.computeActualIndices(len());
80-
setSlice(sliceInfo.start, sliceInfo.stop, sliceInfo.step, value);
81-
}
82-
8356
@Override
8457
public SequenceStorage getSequenceStorage() {
8558
return store;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/list/PList.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ public final void setSequenceStorage(SequenceStorage newStorage) {
5353
this.store = newStorage;
5454
}
5555

56-
@Override
57-
public final void setSlice(PSlice slice, PSequence value) {
58-
// Should not be used. Replaces with ListNodes.SetSliceNode.
59-
// When it will be replaced in other PSequence implementations,
60-
// then the setSlice from PSequence can be removed.
61-
throw new UnsupportedOperationException();
62-
}
63-
64-
@Override
65-
public final void setSlice(int start, int stop, int step, PSequence value) {
66-
throw new UnsupportedOperationException();
67-
}
68-
6956
public final void delSlice(PSlice slice) {
7057
PSlice.SliceInfo sliceInfo = slice.computeActualIndices(this.len());
7158
store.delSlice(sliceInfo.start, sliceInfo.stop, sliceInfo.step);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/PImmutableSequence.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
*/
2626
package com.oracle.graal.python.runtime.sequence;
2727

28-
import com.oracle.graal.python.builtins.objects.slice.PSlice;
2928
import com.oracle.graal.python.builtins.objects.type.PythonClass;
3029
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
3130

@@ -48,14 +47,4 @@ public void setSequenceStorage(SequenceStorage store) {
4847
public final void setItem(int idx, Object value) {
4948
throw new UnsupportedOperationException();
5049
}
51-
52-
@Override
53-
public final void setSlice(PSlice slice, PSequence value) {
54-
throw new UnsupportedOperationException();
55-
}
56-
57-
@Override
58-
public final void setSlice(int start, int stop, int step, PSequence value) {
59-
throw new UnsupportedOperationException();
60-
}
6150
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/PSequence.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
package com.oracle.graal.python.runtime.sequence;
2727

2828
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
29-
import com.oracle.graal.python.builtins.objects.slice.PSlice;
3029
import com.oracle.graal.python.builtins.objects.type.PythonClass;
3130
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
3231
import com.oracle.truffle.api.CompilerDirectives;
@@ -38,10 +37,6 @@ public PSequence(PythonClass cls) {
3837
super(cls);
3938
}
4039

41-
public abstract void setSlice(int start, int stop, int step, PSequence value);
42-
43-
public abstract void setSlice(PSlice slice, PSequence value);
44-
4540
public abstract SequenceStorage getSequenceStorage();
4641

4742
/**

0 commit comments

Comments
 (0)