Skip to content
Snippets Groups Projects
Commit 1f277de9 authored by Tomas Stupka's avatar Tomas Stupka
Browse files

generated test outputmove warnings management from Fast/SlowPathAccess to the iterators

parent 59822812
No related branches found
No related tags found
No related merge requests found
Showing
with 551 additions and 517 deletions
......@@ -224,16 +224,16 @@ public final class RRawVector extends RVector<byte[]> implements RAbstractRawVec
}
@Override
protected byte getRaw(Object store, int index) {
return hasStore ? ((byte[]) store)[index] : NativeDataAccess.getRawNativeMirrorData(store, index);
protected byte getRawImpl(AccessIterator accessIter, int index) {
return hasStore ? ((byte[]) accessIter.getStore())[index] : NativeDataAccess.getRawNativeMirrorData(accessIter.getStore(), index);
}
@Override
protected void setRaw(Object store, int index, byte value) {
protected void setRawImpl(AccessIterator accessIter, int index, byte value) {
if (hasStore) {
((byte[]) store)[index] = value;
((byte[]) accessIter.getStore())[index] = value;
} else {
NativeDataAccess.setNativeMirrorRawData(store, index, value);
NativeDataAccess.setNativeMirrorRawData(accessIter.getStore(), index, value);
}
}
}
......@@ -245,14 +245,14 @@ public final class RRawVector extends RVector<byte[]> implements RAbstractRawVec
private static final SlowPathFromRawAccess SLOW_PATH_ACCESS = new SlowPathFromRawAccess() {
@Override
protected byte getRaw(Object store, int index) {
RRawVector vector = (RRawVector) store;
protected byte getRawImpl(AccessIterator accessIter, int index) {
RRawVector vector = (RRawVector) accessIter.getStore();
return NativeDataAccess.getData(vector, vector.data, index);
}
@Override
protected void setRaw(Object store, int index, byte value) {
RRawVector vector = (RRawVector) store;
protected void setRawImpl(AccessIterator accessIter, int index, byte value) {
RRawVector vector = (RRawVector) accessIter.getStore();
NativeDataAccess.setData(vector, vector.data, index, value);
}
};
......
......@@ -104,9 +104,9 @@ public final class RScalarList extends RScalarVector implements RAbstractListVec
}
@Override
protected Object getListElement(Object store, int index) {
protected Object getListElementImpl(AccessIterator accessIter, int index) {
assert index == 0;
return ((RScalarList) store).value;
return ((RScalarList) accessIter.getStore()).value;
}
}
......@@ -122,9 +122,9 @@ public final class RScalarList extends RScalarVector implements RAbstractListVec
}
@Override
protected Object getListElement(Object store, int index) {
protected Object getListElementImpl(AccessIterator accessIter, int index) {
assert index == 0;
return ((RScalarList) store).value;
return ((RScalarList) accessIter.getStore()).value;
}
};
......
......@@ -107,9 +107,9 @@ public final class RString extends RScalarVector implements RAbstractStringVecto
}
@Override
protected String getString(Object store, int index) {
protected String getStringImpl(AccessIterator accessIter, int index) {
assert index == 0;
return ((RString) store).value;
return ((RString) accessIter.getStore()).value;
}
}
......@@ -120,9 +120,9 @@ public final class RString extends RScalarVector implements RAbstractStringVecto
private static final SlowPathFromStringAccess SLOW_PATH_ACCESS = new SlowPathFromStringAccess() {
@Override
protected String getString(Object store, int index) {
protected String getStringImpl(AccessIterator accessIter, int index) {
assert index == 0;
return ((RString) store).value;
return ((RString) accessIter.getStore()).value;
}
};
......
......@@ -180,8 +180,8 @@ public final class RStringSequence extends RSequence implements RAbstractStringV
}
@Override
protected String getString(Object store, int index) {
RStringSequence vector = (RStringSequence) store;
protected String getStringImpl(AccessIterator accessIter, int index) {
RStringSequence vector = (RStringSequence) accessIter.getStore();
assert index >= 0 && index < vector.getLength();
return vector.prefix + (vector.start + vector.stride * index) + vector.suffix;
}
......@@ -194,8 +194,8 @@ public final class RStringSequence extends RSequence implements RAbstractStringV
private static final SlowPathFromStringAccess SLOW_PATH_ACCESS = new SlowPathFromStringAccess() {
@Override
protected String getString(Object store, int index) {
RStringSequence vector = (RStringSequence) store;
protected String getStringImpl(AccessIterator accessIter, int index) {
RStringSequence vector = (RStringSequence) accessIter.getStore();
assert index >= 0 && index < vector.getLength();
return vector.prefix + (vector.start + vector.stride * index) + vector.suffix;
}
......
......@@ -39,6 +39,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
import com.oracle.truffle.r.runtime.data.nodes.FastPathVectorAccess.FastPathFromStringAccess;
import com.oracle.truffle.r.runtime.data.nodes.SlowPathVectorAccess.SlowPathFromStringAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.AccessIterator;
import com.oracle.truffle.r.runtime.ops.na.NACheck;
public final class RStringVector extends RVector<Object[]> implements RAbstractStringVector {
......@@ -345,22 +346,22 @@ public final class RStringVector extends RVector<Object[]> implements RAbstractS
}
@Override
protected String getString(Object store, int index) {
protected String getStringImpl(AccessIterator accessIter, int index) {
assert hasStore;
if (containsWrappers) {
return ((CharSXPWrapper[]) store)[index].getContents();
return ((CharSXPWrapper[]) accessIter.getStore())[index].getContents();
} else {
return ((String[]) store)[index];
return ((String[]) accessIter.getStore())[index];
}
}
@Override
protected void setString(Object store, int index, String value) {
protected void setStringImpl(AccessIterator accessIter, int index, String value) {
assert hasStore;
if (containsWrappers) {
((CharSXPWrapper[]) store)[index] = CharSXPWrapper.create(value);
((CharSXPWrapper[]) accessIter.getStore())[index] = CharSXPWrapper.create(value);
} else {
((String[]) store)[index] = value;
((String[]) accessIter.getStore())[index] = value;
}
}
}
......@@ -372,12 +373,13 @@ public final class RStringVector extends RVector<Object[]> implements RAbstractS
private static final SlowPathFromStringAccess SLOW_PATH_ACCESS = new SlowPathFromStringAccess() {
@Override
protected String getString(Object store, int index) {
return ((RStringVector) store).getDataAt(index);
protected String getStringImpl(AccessIterator accessIter, int index) {
return ((RStringVector) accessIter.getStore()).getDataAt(index);
}
@Override
protected void setString(Object store, int index, String value) {
protected void setStringImpl(AccessIterator accessIter, int index, String value) {
Object store = accessIter.getStore();
((RStringVector) store).setDataAt(((RStringVector) store).getInternalStore(), index, value);
}
};
......
......@@ -35,6 +35,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
import com.oracle.truffle.r.runtime.data.nodes.FastPathVectorAccess.FastPathFromComplexAccess;
import com.oracle.truffle.r.runtime.data.nodes.SlowPathVectorAccess.SlowPathFromComplexAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.AccessIterator;
class RToComplexVectorClosure extends RToVectorClosure implements RAbstractComplexVector {
......@@ -89,26 +90,26 @@ class RToComplexVectorClosure extends RToVectorClosure implements RAbstractCompl
private static final SlowPathFromComplexAccess SLOW_PATH_ACCESS = new SlowPathFromComplexAccess() {
@Override
protected RComplex getComplex(Object store, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) store;
protected RComplex getComplexImpl(AccessIterator accessIter, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) accessIter.getStore();
return vector.getDataAt(index);
}
@Override
protected double getComplexR(Object store, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) store;
protected double getComplexRImpl(AccessIterator accessIter, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) accessIter.getStore();
return vector.getDataAt(index).getRealPart();
}
@Override
protected double getComplexI(Object store, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) store;
protected double getComplexIImpl(AccessIterator accessIter, int index) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) accessIter.getStore();
return vector.getDataAt(index).getImaginaryPart();
}
@Override
protected void setComplex(Object store, int index, double real, double imaginary) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) store;
protected void setComplexImpl(AccessIterator accessIter, int index, double real, double imaginary) {
RToComplexVectorClosure vector = (RToComplexVectorClosure) accessIter.getStore();
vector.setDataAt(vector.getInternalStore(), index, RComplex.valueOf(real, imaginary));
}
};
......@@ -163,22 +164,22 @@ class RToComplexVectorClosure extends RToVectorClosure implements RAbstractCompl
}
@Override
protected RComplex getComplex(Object store, int index) {
protected RComplex getComplexImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected double getComplexR(Object store, int index) {
protected double getComplexRImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected double getComplexI(Object store, int index) {
protected double getComplexIImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected void setComplex(Object store, int index, double real, double imaginary) {
protected void setComplexImpl(AccessIterator accessIterator, int index, double real, double imaginary) {
throw RInternalError.shouldNotReachHere();
}
}
......
......@@ -33,8 +33,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
import com.oracle.truffle.r.runtime.data.nodes.FastPathVectorAccess.FastPathFromDoubleAccess;
import com.oracle.truffle.r.runtime.data.nodes.SlowPathVectorAccess.SlowPathFromDoubleAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.SequentialIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.RandomIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.AccessIterator;
class RToDoubleVectorClosure extends RToVectorClosure implements RAbstractDoubleVector {
......@@ -86,14 +85,14 @@ class RToDoubleVectorClosure extends RToVectorClosure implements RAbstractDouble
private static final SlowPathFromDoubleAccess SLOW_PATH_ACCESS = new SlowPathFromDoubleAccess() {
@Override
protected double getDouble(Object store, int index) {
RToDoubleVectorClosure vector = (RToDoubleVectorClosure) store;
protected double getDoubleImpl(AccessIterator accessIter, int index) {
RToDoubleVectorClosure vector = (RToDoubleVectorClosure) accessIter.getStore();
return vector.getDataAt(index);
}
@Override
protected void setDouble(Object store, int index, double value) {
RToDoubleVectorClosure vector = (RToDoubleVectorClosure) store;
protected void setDoubleImpl(AccessIterator accessIter, int index, double value) {
RToDoubleVectorClosure vector = (RToDoubleVectorClosure) accessIter.getStore();
vector.setDataAt(vector.getInternalStore(), index, value);
}
};
......@@ -128,12 +127,12 @@ class RToDoubleVectorClosure extends RToVectorClosure implements RAbstractDouble
}
@Override
protected double getDouble(Object store, int index) {
protected double getDoubleImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected void setDouble(Object store, int index, double value) {
protected void setDoubleImpl(AccessIterator accessIterator, int index, double value) {
throw RInternalError.shouldNotReachHere();
}
}
......
......@@ -34,8 +34,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
import com.oracle.truffle.r.runtime.data.nodes.FastPathVectorAccess.FastPathFromIntAccess;
import com.oracle.truffle.r.runtime.data.nodes.SlowPathVectorAccess.SlowPathFromIntAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.RandomIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.SequentialIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.AccessIterator;
class RToIntVectorClosure extends RToVectorClosure implements RAbstractIntVector {
......@@ -87,14 +86,14 @@ class RToIntVectorClosure extends RToVectorClosure implements RAbstractIntVector
private static final SlowPathFromIntAccess SLOW_PATH_ACCESS = new SlowPathFromIntAccess() {
@Override
protected int getInt(Object store, int index) {
RToIntVectorClosure vector = (RToIntVectorClosure) store;
protected int getIntImpl(AccessIterator accessIter, int index) {
RToIntVectorClosure vector = (RToIntVectorClosure) accessIter.getStore();
return vector.getDataAt(index);
}
@Override
protected void setInt(Object store, int index, int value) {
RToIntVectorClosure vector = (RToIntVectorClosure) store;
protected void setIntImpl(AccessIterator accessIter, int index, int value) {
RToIntVectorClosure vector = (RToIntVectorClosure) accessIter.getStore();
vector.setDataAt(vector.getInternalStore(), index, value);
}
};
......@@ -129,12 +128,12 @@ class RToIntVectorClosure extends RToVectorClosure implements RAbstractIntVector
}
@Override
protected int getInt(Object store, int index) {
protected int getIntImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected void setInt(Object store, int index, int value) {
protected void setIntImpl(AccessIterator accessIterator, int index, int value) {
throw RInternalError.shouldNotReachHere();
}
}
......
......@@ -38,8 +38,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
import com.oracle.truffle.r.runtime.data.nodes.FastPathVectorAccess.FastPathFromStringAccess;
import com.oracle.truffle.r.runtime.data.nodes.SlowPathVectorAccess.SlowPathFromStringAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.RandomIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.SequentialIterator;
import com.oracle.truffle.r.runtime.data.nodes.VectorAccess.AccessIterator;
class RToStringVectorClosure extends RToVectorClosure implements RAbstractStringVector {
......@@ -90,14 +89,14 @@ class RToStringVectorClosure extends RToVectorClosure implements RAbstractString
private static final SlowPathFromStringAccess SLOW_PATH_ACCESS = new SlowPathFromStringAccess() {
@Override
protected String getString(Object store, int index) {
RToStringVectorClosure vector = (RToStringVectorClosure) store;
protected String getStringImpl(AccessIterator accessIter, int index) {
RToStringVectorClosure vector = (RToStringVectorClosure) accessIter.getStore();
return vector.getDataAt(index);
}
@Override
protected void setString(Object store, int index, String value) {
RToStringVectorClosure vector = (RToStringVectorClosure) store;
protected void setStringImpl(AccessIterator accessIter, int index, String value) {
RToStringVectorClosure vector = (RToStringVectorClosure) accessIter.getStore();
vector.setDataAt(vector.getInternalStore(), index, value);
}
};
......@@ -132,12 +131,12 @@ class RToStringVectorClosure extends RToVectorClosure implements RAbstractString
}
@Override
protected String getString(Object store, int index) {
protected String getStringImpl(AccessIterator accessIterator, int index) {
throw RInternalError.shouldNotReachHere();
}
@Override
protected void setString(Object store, int index, String value) {
protected void setStringImpl(AccessIterator accessIterator, int index, String value) {
throw RInternalError.shouldNotReachHere();
}
}
......
......@@ -42,29 +42,29 @@ public abstract class PrimitiveVectorAccess {
if (value instanceof Integer) {
return new FastPathFromIntAccess(value) {
@Override
protected int getInt(Object store, int index) {
return (Integer) store;
public int getIntImpl(AccessIterator accessIter, int index) {
return (Integer) accessIter.getStore();
}
};
} else if (value instanceof Double) {
return new FastPathFromDoubleAccess(value) {
@Override
protected double getDouble(Object store, int index) {
return (Double) store;
public double getDoubleImpl(AccessIterator accessIter, int index) {
return (Double) accessIter.getStore();
}
};
} else if (value instanceof Byte) {
return new FastPathFromLogicalAccess(value) {
@Override
protected byte getLogical(Object store, int index) {
return (Byte) store;
public byte getLogicalImpl(AccessIterator accessIter, int index) {
return (Byte) accessIter.getStore();
}
};
} else if (value instanceof String) {
return new FastPathFromStringAccess(value) {
@Override
protected String getString(Object store, int index) {
return (String) store;
public String getStringImpl(AccessIterator accessIter, int index) {
return (String) accessIter.getStore();
}
};
} else if (value instanceof RNull) {
......@@ -80,7 +80,7 @@ public abstract class PrimitiveVectorAccess {
}
@Override
protected Object getListElement(Object store, int index) {
public Object getListElementImpl(AccessIterator accessIter, int index) {
throw RInternalError.shouldNotReachHere();
}
};
......@@ -91,26 +91,26 @@ public abstract class PrimitiveVectorAccess {
private static final SlowPathFromIntAccess SLOW_PATH_INT = new SlowPathFromIntAccess() {
@Override
protected int getInt(Object store, int index) {
return (Integer) store;
public int getIntImpl(AccessIterator accessIter, int index) {
return (Integer) accessIter.getStore();
}
};
private static final SlowPathFromDoubleAccess SLOW_PATH_DOUBLE = new SlowPathFromDoubleAccess() {
@Override
protected double getDouble(Object store, int index) {
return (Double) store;
public double getDoubleImpl(AccessIterator accessIter, int index) {
return (Double) accessIter.getStore();
}
};
private static final SlowPathFromLogicalAccess SLOW_PATH_LOGICAL = new SlowPathFromLogicalAccess() {
@Override
protected byte getLogical(Object store, int index) {
return (Byte) store;
public byte getLogicalImpl(AccessIterator accessIter, int index) {
return (Byte) accessIter.getStore();
}
};
private static final SlowPathFromStringAccess SLOW_PATH_STRING = new SlowPathFromStringAccess() {
@Override
protected String getString(Object store, int index) {
return (String) store;
public String getStringImpl(AccessIterator accessIter, int index) {
return (String) accessIter.getStore();
}
};
private static final SlowPathFromListAccess SLOW_PATH_NULL = new SlowPathFromListAccess() {
......@@ -125,7 +125,7 @@ public abstract class PrimitiveVectorAccess {
}
@Override
protected Object getListElement(Object store, int index) {
public Object getListElementImpl(AccessIterator accessIter, int index) {
throw RInternalError.shouldNotReachHere();
}
};
......
......@@ -27,6 +27,7 @@ import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.r.runtime.RError;
import com.oracle.truffle.r.runtime.RInternalError;
import com.oracle.truffle.r.runtime.RType;
import com.oracle.truffle.r.runtime.data.RComplex;
......@@ -42,6 +43,8 @@ import com.oracle.truffle.r.runtime.data.RStringVector;
import com.oracle.truffle.r.runtime.data.model.RAbstractContainer;
import com.oracle.truffle.r.runtime.nodes.RBaseNode;
import com.oracle.truffle.r.runtime.ops.na.NACheck;
import java.util.HashSet;
import java.util.Set;
/**
* This class is the main access point for reading and writing vectors. Every implementation of
......@@ -79,15 +82,40 @@ public abstract class VectorAccess extends Node {
this.hasStore = hasStore;
}
public static final class SequentialIterator implements AutoCloseable {
public abstract static class AccessIterator {
private Set<RError.Message> reportedWarnings;
protected final Object store; // internal store, native mirror or vector
protected final int length;
protected int index;
private SequentialIterator(Object store, int length) {
protected AccessIterator(Object store, int length) {
this.store = store;
this.length = length;
}
public final Object getStore() {
return store;
}
@TruffleBoundary
public final boolean warning(RError.Message message) {
if (reportedWarnings == null) {
reportedWarnings = new HashSet<>();
}
if (reportedWarnings.add(message)) {
RError.warning(RError.SHOW_CALLER, message);
return true;
}
return false;
}
}
public static final class SequentialIterator extends AccessIterator implements AutoCloseable {
protected int index;
private SequentialIterator(Object store, int length) {
super(store, length);
this.index = -1;
}
......@@ -100,24 +128,16 @@ public abstract class VectorAccess extends Node {
return index;
}
Object getStore() {
return store;
}
@Override
public String toString() {
return String.format("<iterator %d of %d, %s>", index, length, store == null ? "null" : store.getClass().getSimpleName());
}
}
public static final class RandomIterator implements AutoCloseable {
protected final Object store; // internal store, native mirror or vector
protected final int length;
public static final class RandomIterator extends AccessIterator implements AutoCloseable {
private RandomIterator(Object store, int length) {
this.store = store;
this.length = length;
super(store, length);
}
@Override
......@@ -125,85 +145,81 @@ public abstract class VectorAccess extends Node {
// nothing to do
}
Object getStore() {
return store;
}
@Override
public String toString() {
return String.format("<random access %s>", store == null ? "null" : store.getClass().getSimpleName());
}
}
protected abstract int getInt(Object store, int index);
protected abstract int getIntImpl(AccessIterator accessIter, int index);
protected abstract double getDouble(Object store, int index);
protected abstract double getDoubleImpl(AccessIterator accessIter, int index);
protected abstract RComplex getComplex(Object store, int index);
protected abstract RComplex getComplexImpl(AccessIterator accessIter, int index);
protected abstract double getComplexR(Object store, int index);
protected abstract double getComplexRImpl(AccessIterator accessIter, int index);
protected abstract double getComplexI(Object store, int index);
protected abstract double getComplexIImpl(AccessIterator accessIter, int index);
protected abstract byte getRaw(Object store, int index);
protected abstract byte getRawImpl(AccessIterator accessIter, int index);
protected abstract byte getLogical(Object store, int index);
protected abstract byte getLogicalImpl(AccessIterator accessIter, int index);
protected abstract String getString(Object store, int index);
protected abstract String getStringImpl(AccessIterator accessIter, int index);
protected abstract Object getListElement(Object store, int index);
protected abstract Object getListElementImpl(AccessIterator accessIter, int index);
@SuppressWarnings("unused")
protected void setInt(Object store, int index, int value) {
protected void setIntImpl(AccessIterator accessIter, int index, int value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setDouble(Object store, int index, double value) {
protected void setDoubleImpl(AccessIterator accessIter, int index, double value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setComplex(Object store, int index, double real, double imaginary) {
protected void setComplexImpl(AccessIterator accessIter, int index, double real, double imaginary) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setRaw(Object store, int index, byte value) {
protected void setRawImpl(AccessIterator accessIter, int index, byte value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setLogical(Object store, int index, byte value) {
protected void setLogicalImpl(AccessIterator accessIter, int index, byte value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setString(Object store, int index, String value) {
protected void setStringImpl(AccessIterator accessIter, int index, String value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setListElement(Object store, int index, Object value) {
protected void setListElementImpl(AccessIterator accessIter, int index, Object value) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setFromSameType(Object store, int index, VectorAccess sourceAccess, SequentialIterator sourceIter) {
protected void setFromSameTypeImpl(AccessIterator accessIter, int index, VectorAccess sourceAccess, SequentialIterator sourceIter) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setFromSameType(Object store, int index, VectorAccess sourceAccess, RandomIterator sourceIter, int sourceIndex) {
protected void setFromSameTypeImpl(AccessIterator accessIter, int index, VectorAccess sourceAccess, RandomIterator sourceIter, int sourceIndex) {
throw RInternalError.shouldNotReachHere();
}
@SuppressWarnings("unused")
protected void setNA(Object store, int index) {
protected void setNAImpl(AccessIterator accessIter, int index) {
throw RInternalError.shouldNotReachHere();
}
protected abstract boolean isNA(Object store, int index);
protected abstract boolean isNAImpl(AccessIterator accessIter, int index);
public final Object cast(Object value) {
return clazz.cast(value);
......@@ -276,83 +292,85 @@ public abstract class VectorAccess extends Node {
public abstract RType getType();
public int getInt(SequentialIterator iter) {
return getInt(iter.store, iter.index);
return getIntImpl(iter, iter.index);
}
public double getDouble(SequentialIterator iter) {
return getDouble(iter.store, iter.index);
return getDoubleImpl(iter, iter.index);
}
public RComplex getComplex(SequentialIterator iter) {
return getComplex(iter.store, iter.index);
return getComplexImpl(iter, iter.index);
}
public double getComplexR(SequentialIterator iter) {
return getComplexR(iter.store, iter.index);
return getComplexRImpl(iter, iter.index);
}
public double getComplexI(SequentialIterator iter) {
return getComplexI(iter.store, iter.index);
return getComplexIImpl(iter, iter.index);
}
public final byte getRaw(SequentialIterator iter) {
return getRaw(iter.store, iter.index);
return getRawImpl(iter, iter.index);
}
public final byte getLogical(SequentialIterator iter) {
return getLogical(iter.store, iter.index);
return getLogicalImpl(iter, iter.index);
}
public String getString(SequentialIterator iter) {
return getString(iter.store, iter.index);
return getStringImpl(iter, iter.index);
}
public final Object getListElement(SequentialIterator iter) {
return getListElement(iter.store, iter.index);
return getListElementImpl(iter, iter.index);
}
public final void setInt(SequentialIterator iter, int value) {
setInt(iter.store, iter.index, value);
setIntImpl(iter, iter.index, value);
}
public final void setDouble(SequentialIterator iter, double value) {
setDouble(iter.store, iter.index, value);
setDoubleImpl(iter, iter.index, value);
}
public final void setComplex(SequentialIterator iter, double real, double imaginary) {
setComplex(iter.store, iter.index, real, imaginary);
setComplexImpl(iter, iter.index, real, imaginary);
}
public final void setRaw(SequentialIterator iter, byte value) {
setRaw(iter.store, iter.index, value);
setRawImpl(iter, iter.index, value);
}
public final void setLogical(SequentialIterator iter, byte value) {
setLogical(iter.store, iter.index, value);
setLogicalImpl(iter, iter.index, value);
}
public final void setString(SequentialIterator iter, String value) {
setString(iter.store, iter.index, value);
setStringImpl(iter, iter.index, value);
}
public final void setListElement(SequentialIterator iter, Object value) {
setListElement(iter.store, iter.index, value);
setListElementImpl(iter, iter.index, value);
}
public final void setFromSameType(SequentialIterator iter, VectorAccess sourceAccess, SequentialIterator sourceIter) {
setFromSameType(iter.store, iter.index, sourceAccess, sourceIter);
public final void setFromSameType(SequentialIterator iter, VectorAccess sourceAccess,
SequentialIterator sourceIter) {
setFromSameTypeImpl(iter, iter.index, sourceAccess, sourceIter);
}
public final void setFromSameType(SequentialIterator iter, VectorAccess sourceAccess, RandomIterator sourceIter, int sourceIndex) {
setFromSameType(iter.store, iter.index, sourceAccess, sourceIter, sourceIndex);
public final void setFromSameType(SequentialIterator iter, VectorAccess sourceAccess,
RandomIterator sourceIter, int sourceIndex) {
setFromSameTypeImpl(iter, iter.index, sourceAccess, sourceIter, sourceIndex);
}
public final void setNA(SequentialIterator iter) {
setNA(iter.store, iter.index);
setNAImpl(iter, iter.index);
}
public final boolean isNA(SequentialIterator iter) {
return isNA(iter.store, iter.index);
return isNAImpl(iter, iter.index);
}
/**
......@@ -377,83 +395,83 @@ public abstract class VectorAccess extends Node {
}
public int getInt(RandomIterator iter, int index) {
return getInt(iter.store, index);
return getIntImpl(iter, index);
}
public double getDouble(RandomIterator iter, int index) {
return getDouble(iter.store, index);
return getDoubleImpl(iter, index);
}
public RComplex getComplex(RandomIterator iter, int index) {
return getComplex(iter.store, index);
return getComplexImpl(iter, index);
}
public double getComplexR(RandomIterator iter, int index) {
return getComplexR(iter.store, index);
return getComplexRImpl(iter, index);
}
public double getComplexI(RandomIterator iter, int index) {
return getComplexI(iter.store, index);
return getComplexIImpl(iter, index);
}
public final byte getRaw(RandomIterator iter, int index) {
return getRaw(iter.store, index);
return getRawImpl(iter, index);
}
public final byte getLogical(RandomIterator iter, int index) {
return getLogical(iter.store, index);
return getLogicalImpl(iter, index);
}
public String getString(RandomIterator iter, int index) {
return getString(iter.store, index);
return getStringImpl(iter, index);
}
public final Object getListElement(RandomIterator iter, int index) {
return getListElement(iter.store, index);
return getListElementImpl(iter, index);
}
public final void setInt(RandomIterator iter, int index, int value) {
setInt(iter.store, index, value);
setIntImpl(iter, index, value);
}
public final void setDouble(RandomIterator iter, int index, double value) {
setDouble(iter.store, index, value);
setDoubleImpl(iter, index, value);
}
public final void setComplex(RandomIterator iter, int index, double real, double imaginary) {
setComplex(iter.store, index, real, imaginary);
setComplexImpl(iter, index, real, imaginary);
}
public final void setRaw(RandomIterator iter, int index, byte value) {
setRaw(iter.store, index, value);
setRawImpl(iter, index, value);
}
public final void setLogical(RandomIterator iter, int index, byte value) {
setLogical(iter.store, index, value);
setLogicalImpl(iter, index, value);
}
public final void setString(RandomIterator iter, int index, String value) {
setString(iter.store, index, value);
setStringImpl(iter, index, value);
}
public final void setListElement(RandomIterator iter, int index, Object value) {
setListElement(iter.store, index, value);
setListElementImpl(iter, index, value);
}
public final void setFromSameType(RandomIterator iter, int index, VectorAccess sourceAccess, SequentialIterator sourceIter) {
setFromSameType(iter.store, index, sourceAccess, sourceIter);
setFromSameTypeImpl(iter, index, sourceAccess, sourceIter);
}
public final void setFromSameType(RandomIterator iter, int index, VectorAccess sourceAccess, RandomIterator sourceIter, int sourceIndex) {
setFromSameType(iter.store, index, sourceAccess, sourceIter, sourceIndex);
setFromSameTypeImpl(iter, index, sourceAccess, sourceIter, sourceIndex);
}
public final void setNA(RandomIterator iter, int index) {
setNA(iter.store, index);
setNAImpl(iter, index);
}
public final boolean isNA(RandomIterator iter, int index) {
return isNA(iter.store, index);
return isNAImpl(iter, index);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment