private static int DefineClass(JNIEnvironment env,Address classNameAddress,int classLoader,Address data,int dataLen){
  if (traceJNI)   VM.sysWrite("JNI called: DefineClass  \n");
  RuntimeEntrypoints.checkJNICountDownToGC();
  try {
    String classString=null;
    if (!classNameAddress.isZero()) {
      JNIGenericHelpers.createStringFromC(classNameAddress);
    }
    ClassLoader cl;
    if (classLoader == 0) {
      cl=RVMClass.getClassLoaderFromStackFrame(1);
    }
 else {
      cl=(ClassLoader)env.getJNIRef(classLoader);
    }
    AddressInputStream reader=new AddressInputStream(data,Extent.fromIntZeroExtend(dataLen));
    final RVMType vmType=RVMClassLoader.defineClassInternal(classString,reader,cl);
    return env.pushJNIRef(vmType.getClassForType());
  }
 catch (  Throwable unexpected) {
    if (traceJNI)     unexpected.printStackTrace(System.err);
    env.recordException(unexpected);
    return 0;
  }
}

private static int DefineClass ( JNIEnvironment env , Address classNameAddress , int classLoader , Address data , int dataLen ) { if ( traceJNI ) VM . sysWrite ( "JNI called: DefineClass  \n" ) ; RuntimeEntrypoints . checkJNICountDownToGC ( ) ; try { String classString = null ; if ( ! classNameAddress . isZero ( ) ) { JNIGenericHelpers . createStringFromC ( classNameAddress ) ; } ClassLoader cl ; if ( classLoader == 0 ) { cl = RVMClass . getClassLoaderFromStackFrame ( 1 ) ; } else { cl = ( ClassLoader ) env . getJNIRef ( classLoader ) ; } AddressInputStream reader = new AddressInputStream ( data , Extent . fromIntZeroExtend ( dataLen ) ) ; final RVMType vmType = RVMClassLoader . defineClassInternal ( classString , reader , cl ) ; return env . pushJNIRef ( vmType . getClassForType ( ) ) ; } catch ( Throwable unexpected ) { if ( traceJNI ) unexpected . printStackTrace ( System . err ) ; env . recordException ( unexpected ) ; return 0 ; } }
defineclass : loads a class from a buffer of raw class data .
