use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class IfAcmp method if_acmpeq.
public static void if_acmpeq(Frame frame) {
ObjectRef value2 = frame.operandStack.popRef();
ObjectRef value1 = frame.operandStack.popRef();
boolean result = Objects.equals(value1, value2);
if (result) {
frame.jump();
}
// Log.result(frame.getCurrentOpCode(), result, value1, "==", value2);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class IfAcmp method if_acmpne.
public static void if_acmpne(Frame frame) {
ObjectRef value2 = frame.operandStack.popRef();
ObjectRef value1 = frame.operandStack.popRef();
boolean result = !Objects.equals(value1, value2);
if (result) {
frame.jump();
}
// Log.result(frame.getCurrentOpCode(), result, value1, "!=", value2);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xastore method bastore.
public static void bastore(final Frame frame) {
int i = frame.operandStack.popInt();
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
if (arrayRef.getVariableType().getComponentType().isBoolean()) {
boolean value = i == 1 ? true : false;
frame.heap.putArray(arrayRef, index, value);
// Log.result(frame.getCurrentOpCode(), arrayRef, index, value);
} else {
byte value = (byte) i;
frame.heap.putArray(arrayRef, index, value);
// Log.result(frame.getCurrentOpCode(), arrayRef, index, value);
}
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xastore method dastore.
public static void dastore(final Frame frame) {
double value = frame.operandStack.popDouble();
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
frame.heap.putArray(arrayRef, index, value);
// Log.result(frame.getCurrentOpCode(), arrayRef, index, value);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xastore method sastore.
public static void sastore(final Frame frame) {
short value = frame.operandStack.popShort();
int index = frame.operandStack.popInt();
ObjectRef arrayRef = frame.operandStack.popRef();
if (!frame.checkArray(arrayRef, index)) {
return;
}
frame.heap.putArray(arrayRef, index, value);
// Log.result(frame.getCurrentOpCode(), arrayRef, index, value);
}
Aggregations