}
public void call(XThread thread, XMethodExecutor methodExecutor, XMethod method, XGenericClass[] generics, long[] params) {
XNativeMethod nativeMethod = method.getNativeMethod();
XObject _this = null;
int i=0;
if(!XModifier.isStatic(method.getModifier())){
_this = virtualMachine.getObjectProvider().getObject(params[0]);
i=1;
}
Object[] oParam = new Object[params.length-i];
XGenericClass[] genericClasses = method.getParams(_this==null?null:_this.getXClass(), new XGenericMethodProviderImp(method, generics));
if(oParam.length!=genericClasses.length)
throw new XRuntimeException("An native call error happened");
for(int j=0; j<oParam.length; j++){
long value = params[j+i];
XGenericClass genericClass = genericClasses[j];
oParam[j] = XWrapper.getJavaObject(virtualMachine.getObjectProvider(), genericClass, value);
}
Object ret = invokeNative(nativeMethod, thread, methodExecutor, generics, _this, oParam);
XGenericClass genericClass = method.getReturnType(_this==null?null:_this.getXClass(), new XGenericMethodProviderImp(method, generics));
if(XPrimitive.getPrimitiveID(genericClass.getXClass())!=XPrimitive.VOID){
long l = XWrapper.getXObject(virtualMachine.getObjectProvider(), genericClass, ret);
methodExecutor.push(l, XPrimitive.getPrimitiveID(genericClass.getXClass()));
}
}