use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class NativeString method intern.
/**
* native
*
* @see String#intern()
*/
private static Result intern(MethodCode methodCode, MethodArgs methodArgs, Frame frame) {
ObjectRef objectRef = methodArgs.objectRef;
Result result = NativeMethod.result(methodCode, objectRef, frame);
return result;
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Invokevirtual method invokevirtual.
public static void invokevirtual(Frame frame) {
MethodInsnNode methodInsnNode = frame.methodInsnNode();
String className = methodInsnNode.owner;
String methodName = methodInsnNode.name;
String methodDesc = methodInsnNode.desc;
List<VariableType> variableTypes = VariableType.parseArgs(methodDesc);
MethodArgs methodArgs = new MethodArgs(variableTypes, frame.operandStack, false);
ObjectRef objectRef = methodArgs.objectRef;
if (objectRef == null) {
frame.throwNullPointerException();
return;
}
String type = objectRef.getVariableType().getType();
if (!Objects.equals(className, type)) {
if (objectRef.getVariableType().isPrimitiveType()) {
} else {
className = type;
}
}
if (objectRef.isArray()) {
className = Constants.OBJECT_CLASS_NAME;
}
MethodCode methodCode = frame.methodArea.loadMethod(className, methodName, methodDesc);
// Log.opcode(frame.getCurrentOpCode(), objectRef, methodName, methodDesc);
Result result = NativeMethod.run(methodCode, methodArgs, frame);
if (result != null) {
return;
}
frame.vm.run(methodCode, methodArgs.frameArgs, true);
}
use of io.nuls.contract.vm.ObjectRef in project nuls by nuls-io.
the class Xastore method iastore.
public static void iastore(final Frame frame) {
int value = frame.operandStack.popInt();
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 lastore.
public static void lastore(final Frame frame) {
long value = frame.operandStack.popLong();
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