< prev index next >
src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java
Print this page
@@ -154,26 +154,10 @@
}
return darray;
}
- private long[] toLongArray() {
- assert length() <= array.length : "length exceeds internal array size";
- final int len = (int)length();
- final long[] larray = new long[array.length];
-
- for (int index = 0; index < len; index++) {
- larray[index] = array[index];
- }
-
- return larray;
- }
-
- private LongArrayData convertToLong() {
- return new LongArrayData(toLongArray(), (int)length());
- }
-
private NumberArrayData convertToDouble() {
return new NumberArrayData(toDoubleArray(), (int)length());
}
private ObjectArrayData convertToObject() {
@@ -182,12 +166,10 @@
@Override
public ArrayData convert(final Class<?> type) {
if (type == Integer.class || type == Byte.class || type == Short.class) {
return this;
- } else if (type == Long.class) {
- return convertToLong();
} else if (type == Double.class || type == Float.class) {
return convertToDouble();
} else {
return convertToObject();
}
@@ -251,21 +233,10 @@
return this;
}
@Override
- public ArrayData set(final int index, final long value, final boolean strict) {
- if (JSType.isRepresentableAsInt(value)) {
- array[index] = JSType.toInt32(value);
- setLength(Math.max(index + 1, length()));
- return this;
- }
-
- return convert(Long.class).set(index, value, strict);
- }
-
- @Override
public ArrayData set(final int index, final double value, final boolean strict) {
if (JSType.isRepresentableAsInt(value)) {
array[index] = (int)(long)value;
setLength(Math.max(index + 1, length()));
return this;
@@ -283,20 +254,10 @@
public int getIntOptimistic(final int index, final int programPoint) {
return array[index];
}
@Override
- public long getLong(final int index) {
- return array[index];
- }
-
- @Override
- public long getLongOptimistic(final int index, final int programPoint) {
- return array[index];
- }
-
- @Override
public double getDouble(final int index) {
return array[index];
}
@Override
< prev index next >