if (verboseJNI) VM.sysWrite("JNI called: AllocObject  \n");
if (traceJNI) VM.sysWrite("JNI called: AllocObject  \n");
  private static int AllocObject(int envJREF, int classJREF)     throws InstantiationException, OutOfMemoryError {      if (verboseJNI) VM.sysWrite("JNI called: AllocObject  \n");      VM_JNIEnvironment env;      try {        env = VM_Thread.getCurrentThread().getJNIEnv();        Class javaCls = (Class) env.getJNIRef(classJREF);        if (javaCls.isArray() || javaCls.isPrimitive() || javaCls.isInterface())          throw new InstantiationException();        VM_Class cls = java.lang.JikesRVMSupport.getTypeForClass(javaCls).asClass();        if (cls.isAbstract() || cls.isInterface()) {          env.recordException(new InstantiationException());          return 0;        }	int allocator = VM_Interface.pickAllocator(cls);        Object newObj = VM_Runtime.resolvedNewScalar(cls.getInstanceSize(),                                                   cls.getTypeInformationBlock(),                                                  cls.hasFinalizer(),						  allocator);        if (newObj==null)          return 0;        else                return env.pushJNIRef(newObj);      } catch (Throwable unexpected) {        env = VM_Thread.getCurrentThread().getJNIEnv();        env.recordException(unexpected);        return 0;      }    }