Package xscript.runtime.genericclass

Examples of xscript.runtime.genericclass.XGenericClass


    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()));
    }
  }
View Full Code Here


 
  @Override
  public void run(XVirtualMachine vm, XThread thread, XMethodExecutor methodExecutor) {
    long[] value = methodExecutor.pop();
    methodExecutor.push(value[0], (int) value[1]);
    XGenericClass genericClass = XPrimitive.getXClass(vm, value[0], (int) value[1]);
    if(genericClass!=null)
      XChecks.checkCast(genericClass, xClass.getXClass(vm, methodExecutor.getDeclaringClass(), methodExecutor));
  }
View Full Code Here

      XObject obj = vm.getObjectProvider().getObject(l);
      if(obj==null)
        return null;
      return obj.getXClass();
    case BOOL:
      return new XGenericClass(vm.getClassProvider().BOOL);
    case BYTE:
      return new XGenericClass(vm.getClassProvider().BYTE);
    case CHAR:
      return new XGenericClass(vm.getClassProvider().CHAR);
    case SHORT:
      return new XGenericClass(vm.getClassProvider().SHORT);
    case INT:
      return new XGenericClass(vm.getClassProvider().INT);
    case LONG:
      return new XGenericClass(vm.getClassProvider().LONG);
    case FLOAT:
      return new XGenericClass(vm.getClassProvider().FLOAT);
    case DOUBLE:
      return new XGenericClass(vm.getClassProvider().DOUBLE);
    case VOID:
      return new XGenericClass(vm.getClassProvider().VOID);
    }
    throw new XRuntimeException("Unknown primitiveID %s", i);
  }
View Full Code Here

      if(classTable==null)
        throw new XRuntimeException("Can't cast %s to %s", xClass, getDeclaringClass());
      data = object.getData();
      i = classTable.getFieldStartID()+index;
      if(getTypePrimitive()==XPrimitive.OBJECT){
        XGenericClass type = getType(object.getXClass());
        XChecks.checkCast(object.getXClass(), type);
      }
    }
    int size = getSizeInObject();
    for(int j=size-1; j>=0; j--){
View Full Code Here

    xClass = XClassPtr.load(inputStream);
  }
 
  @Override
  public void run(XVirtualMachine vm, XThread thread, XMethodExecutor methodExecutor) {
    XGenericClass rClass = xClass.getXClass(vm, methodExecutor.getDeclaringClass(), methodExecutor);
    XChecks.checkAccess(methodExecutor.getDeclaringClass().getXClass(), rClass.getXClass());
    long pointer = vm.getObjectProvider().createObject(rClass);
    methodExecutor.oPush(pointer);
  }
View Full Code Here

TOP

Related Classes of xscript.runtime.genericclass.XGenericClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.