use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Ifnonnull method ifnonnull.
public static void ifnonnull(final Frame frame) {
ObjectRef value = frame.operandStack.popRef();
boolean result = value != null;
if (result) {
frame.jump();
}
// Log.result(frame.getCurrentOpCode(), result, value, "!=", null);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Arraylength method arraylength.
public static void arraylength(Frame frame) {
ObjectRef arrayRef = frame.operandStack.popRef();
if (arrayRef == null) {
frame.throwNullPointerException();
return;
}
int length = arrayRef.getDimensions()[0];
frame.operandStack.pushInt(length);
// Log.result(frame.getCurrentOpCode(), length);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xaload method saload.
public static void saload(final Frame frame) {
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
short value = (short) frame.heap.getArray(arrayRef, index);
frame.operandStack.pushShort(value);
// Log.result(frame.getCurrentOpCode(), value, arrayRef, index);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xaload method laload.
public static void laload(final Frame frame) {
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
long value = (long) frame.heap.getArray(arrayRef, index);
frame.operandStack.pushLong(value);
// Log.result(frame.getCurrentOpCode(), value, arrayRef, index);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xaload method iaload.
public static void iaload(final Frame frame) {
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
int value = (int) frame.heap.getArray(arrayRef, index);
frame.operandStack.pushInt(value);
// Log.result(frame.getCurrentOpCode(), value, arrayRef, index);
}
Aggregations