@Override
public void run(WeaselInterpreter interpreter, WeaselThread thread, WeaselMethodExecutor method) {
resolve(interpreter);
WeaselObject object = interpreter.getObject(thread.getObject(thread.getStackPointer()-this.method.getParamClasses().length-1));
WeaselMethodBody methodBody = this.method.getMethodFromClass(object.getWeaselClass());
if(methodBody.isNative()){
if(nativeMethod==null){
nativeMethod = interpreter.getNativeMethod(methodBody.getNameAndDesk());
}
Object[] params = new Object[this.method.getParamClasses().length];
for(int i=0; i<params.length; i++){
StackElement se = thread.pop();
if(se.value==null){
params[i] = interpreter.getObject(se.object);
}else{
params[i] = se.value;
}
}
thread.popObject();
Object ret = nativeMethod.invoke(interpreter, thread, method, methodBody.getNameAndDesk(), object, params);
WeaselClass rc = this.method.getReturnClasses();
switch(WeaselPrimitive.getPrimitiveID(rc)){
case WeaselPrimitive.BOOLEAN:
thread.pushValue((Boolean)ret);
break;