* VM Classes and Reference Implementation of GNU Classpath

YeongKyoon Lee, R&D, Tmax, 2004.04.17

A VM class means the interface btw GNU classpath & VM which is dependent on VM structure.

For using GNU classpath, VM classes as follows should be implemented, otherwise classpath be modified.

Each class table below shows all the methods of the class and the reference implementation by JamVM.

-  java.lang.VMObject

-  java.lang.VMSystem

-  java.lang.VMRuntime

-  java.lang.VMClass

-  java.lang.VMThrowable

-  java.lang.VMSecurityManager

-  java.lang.VMClassLoader

-  java.lang.reflect.Constructor

-  java.lang.reflect.Field

-  java.lang.reflect.Method

-  java.lang.VMString

-  java.lang.VMThread

-  java.lang.VMFloat

-  java.lang.VMDouble

-  java.io.VMObjectStreamClass

java.lang.VMObject

Method | Java or Native (J/N) | Impl’d by CP (Full, Partial, None) | Impl’d by JamVM (O/X/Modified/Removed)

static nativejava.lang.Object clone(java.lang.Cloneablec) / N / None / O
static nativevoid notify(java.lang.Objecto) / N / None / O
static nativevoid notifyAll(java.lang.Objecto) / N / None / O
static nativevoid wait(java.lang.Objecto, longms, intns) / N / None / O

java.lang.VMSystem

static native void arraycopy(java.lang.Objectsrc, intsrcStart,
java.lang.Objectdest, intdestStart, intlen) / N / None / O
static native void currentTimeMillis() / N / None / O
static native int identityHashCode(java.lang.Objecto) / N / None / O
static native boolean isWordsBigEndian() / N / Full / -
static native PrintStream makeStandardErrorStream() / J / Full / O
static native InputStream makeStandardInputStream() / J / Full / O
static native PrintStream makeStandardOutputStream() / J / Full / O
static native void setErr(java.io.PrintStreamerr) / N / Full / -
static native void setIn(java.io.InputStreamin) / N / Full / -
static native void setOut(java.io.PrintStreamout) / N / Full / -

java.lang.VMRuntime

static native int availableProcessors() / N->J / None / M
static native Process exec(java.lang.String[]cmd, java.lang.String[]env,
java.io.Filedir) / N->J / None / M
static native void exit(intstatus) / N / None / O
static native long freeMemory() / N / None / O
static native void gc() / N / None / O
static native void insertSystemProperties(java.util.Propertiesp) / N / None / O
static native long maxMemory() / N / None / O
static native String nativeGetLibname(java.lang.Stringpathname,
java.lang.Stringlibname) / N / None / O
static native int nativeLoad(java.lang.Stringfilename) / N / None / O
static native void runFinalization() / N->J / None / M
static native void runFinalizationForExit() / N->J / None / M
static native void runFinalizersOnExit(booleanvalue) / N->J / None / M
static native long totalMemory() / N / None / O
static native void traceInstructions(booleanon) / N->J / None / M
static native void traceMethodCalls(booleanon) / N->J / None / M

java.lang.VMClass

static native Class forName(java.lang.Stringname) / N / None / O
native ClassLoader getClassLoader()) / N / None / O
native Class getComponentType() / N / None / O
native Class[] getDeclaredClasses(booleanpublicOnly) / N / None / O
native Constructor[] getDeclaredConstructors(booleanpublicOnly) / N / None / O
native Field[] getDeclaredFields(booleanpublicOnly) / N / None / O
native Method[] getDeclaredMethods(booleanpublicOnly) / N / None / O
native Class getDeclaringClass() / N / None / O
native Class[] getInterfaces() / N / None / O
native int getModifiers() / N / None / O
native String getName() / N / None / O
native Class getSuperclass() / N / None / O
native void initialize() / N / None / O
private void initialize(intthread) / J / Partial / R
native int isArray() / N / None / O
native boolean isAssignableFrom(java.lang.Classc) / N / None / O
native boolean isInitialized() / N / None / R
native boolean isInstance(java.lang.Objecto) / N / None / O
native boolean isInterface() / N / None / O
native boolean isPrimitive() / N / None / O
static native Class loadArrayClass(java.lang.Stringname,
java.lang.ClassLoaderclassloader) / N / None / O
private native void setInitialized() / N / None / R
private native void step7() / N / None / R
private native void step8() / N / None / R
static native void throwException(java.lang.Throwablet) / N / None / O
public static native Boolean hasClassInitializer(Class c) / added

java.lang.VMThrowable

static VMThrowable fillInStackTrace(java.lang.Throwablet) / J->N / Partial / O
StackTraceElement[] getStackTrace(java.lang.Throwablet) / J->N / Full / O

java.lang.VMSecurityManager

static native ClassLoader currentClassLoader() / N / None / O
static native Class[] getClassContext() / N / None / O

java.lang.VMClassLoader

static final classAssertionStatus() / J / Partial / -
static final boolean defaultAssertionStatus() / J / Partial / -
static final native Class defineClass(java.lang.ClassLoadercl,
java.lang.Stringname, byte[]data, intoffset, intlen) / N / None / R
static final Class defineClass(java.lang.ClassLoadercl, java.lang.Stringname,
byte[]data, intoffset, intlen, java.security.ProtectionDomainpd) / J->N / Partial / M
static Package getPackage(java.lang.Stringname) / J / Partial / -
static Package[] getPackages() / J / Partial / -
static final Class getPrimitiveClass(chartype) / J / Full / R
static final native Class getPrimitiveClass(java.lang.Stringtype) / N / None / O
static URL getResource(java.lang.Stringname) / J / Partial / M
static Enumeration getResources(java.lang.Stringname) / J / Partial / M
static ClassLoader getSystemClassLoader() / J / Full / -
static final Class loadClass(java.lang.Stringname, booleanresolve) / J->N / Partial / M
static final Map packageAssertionStatus() / J / Partial / -
static final native void resolveClass(java.lang.Classc) / J->N / Partial / M
static final native Class findLoadedClass(ClassLoader cl, String name) / added

java.lang.reflect.Constructor

private native Object constructNative(java.lang.Object[]args,
java.lang.ClassdeclaringClass, intslot) / N / None / O
public boolean equals(java.lang.Objecto) / J / Full / -
public Class getDeclaringClass() / J / Full / -
public Class[] getExceptionTypes() / J / Full / -
public native int getModifiers() / N->J / None / O
public String getName() / J / Full / -
public Class[] getParameterTypes() / J / Full / -
public int hashCode() / J / Full / -
public Object newInstance(java.lang.Object[]args) / J / Full / -
public String toString() / J / Full / -
private native int getConstructorModifiers(int slot) / Added
private native Object constructNative(Object[] args, Class declaringClass,
Class[] parameterTypes, int slot) / added

java.lang.reflect.Field

public boolean equals(java.lang.Objecto) / J / Full / -
public native Object get(java.lang.Objecto) / N->J / None / M
public native boolean getBoolean(java.lang.Objecto) / N->J / None / M
public native byte getByte(java.lang.Objecto) / N->J / None / M
public native char getChar(java.lang.Objecto) / N->J / None / M
public Class getDeclaringClass() / J / Full / -
public native double getDouble(java.lang.Objecto) / N->J / None / M
public native float getFloat(java.lang.Objecto) / N->J / None / M
public native int getInt(java.lang.Objecto) / N->J / None / M
public native long getLong(java.lang.Objecto) / N->J / None / M
public native int getModifiers() / N->J / None / M
public String getName() / N->J / None / M
public native short getShort(java.lang.Objecto) / N->J / None / M
public native Class getType() / N->J / None / M
public int hashCode() / J / Full / -
public native void set(java.lang.Objecto, java.lang.Objectvalue) / N->J / None / M
public native void setBoolean(java.lang.Objecto, booleanvalue) / N->J / None / M
public native void setByte(java.lang.Objecto, bytevalue) / N->J / None / M
public native void setChar(java.lang.Objecto, charvalue) / N->J / None / M
public native void setDouble(java.lang.Objecto, doublevalue) / N->J / None / M
public native void setFloat(java.lang.Objecto, floatvalue) / N->J / None / M
public native void setInt(java.lang.Objecto, intvalue) / N->J / None / M
public native void setLong(java.lang.Objecto, longvalue) / N->J / None / M
public native void setShort(java.lang.Objecto, shortvalue) / N->J / None / M
public String toString() / J / Full / -
public native int getFieldModifiers(int slot) / added
private native Object getField(Object o, Class declaringClass, Class type,
int slot) / added
private native void setField(Object o, Class declaringClass, Class type,
int slot, Object value) / added
private native double getDField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native int getIField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native long getJField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native boolean getZField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native float getFField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native char getCField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native short getSField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native byte getBField(Object o, Class declaringClass, Class type,
int slot, int type_no) / added
private native void setDField(Object o, Class declaringClass, Class type,
int slot, int type_no, double v) / added
private native void setIField(Object o, Class declaringClass, Class type,
int slot, int type_no, int i) / added
private native void setJField(Object o, Class declaringClass, Class type,
int slot, int type_no, long j) / added
private native void setZField(Object o, Class declaringClass, Class type,
int slot, int type_no, boolean z) / added
private native void setFField(Object o, Class declaringClass, Class type,
int slot, int type_no, float f) / added
private native void setCField(Object o, Class declaringClass, Class type,
int slot, int type_no, char c) / added
private native void setSField(Object o, Class declaringClass, Class type,
int slot, int type_no, short s) / added
private native void setBField(Object o, Class declaringClass, Class type,
int slot, int type_no, byte b) / added

java.lang.reflect.Method

public boolean equals(java.lang.Objecto) / J / Full / -
public Class getDeclaringClass() / J / Full / -
public native Class[] getExceptionTypes() / N->J / None / M
public native int getModifiers() / N->J / None / M
public String getName() / J / Full / -
public native Class[] getParameterTypes() / N->J / None / M
public native Class getReturnType() / N->J / None / M
public int hashCode() / J / Full / -
public Object invoke(java.lang.Objecto, java.lang.Object[]args) / J / Full / -
private native Object invokeNative(java.lang.Objecto, java.lang.Object[]args,
java.lang.ClassdeclaringClass, intslot) / N / None / O
public String toString() / J / Full / -
private native int getMethodModifiers(int slot) / added

java.lang.VMString

intern(java.lang.Stringstr) / J->N / Full / M

java.lang.VMThread

static void create(java.lang.Threadthread, longstacksize) / J->N / Full / M
native static Thread currentThread() / N / None / O
String getName() / J / Full / -
int getPriority() / J / Full / -
native boolean holdsLock(java.lang.Objectobj) / N / None / O
native void interrupt() / N / None / O
native boolean interrupted() / N / None / O
boolean isDaemon() / J / Full / -
native boolean isInterrupted() / N / None / O
synchronized void join(longms, intns) / J / Full / M
native void nativeSetPriority(intpriority) / N / None / O
native void nativeStop(java.lang.Throwablet) / N / None / R
native void resume() / N->J / None / M
private void run() / J / Full / R
void setName(java.lang.Stringname) / J / Full / -
void setPriority(intpriority) / J / Full / -
static native void sleep(longms, intns) / N / None / O
native void start(longstacksize) / N / None / X
void stop(java.lang.Throwablet) / J / Full / M
native void suspend() / N->J / None / M
static native void yield() / N / None / O

java.lang.VMFloat

static native int floatToIntBits(floatvalue) / N / Full / -
static native int floatToRawIntBits(floatvalue) / N / Full / -
static native float intBitsToFloat(intbits) / N / Full / -

java.lang.VMDouble

static native long doubleToLongBits(doublevalue) / N / Full / -
static native long doubleToRawLongBits(doublevalue) / N / Full / -
static native double longBitsToDouble(longbits) / N / Full / -

java.io.VMObjectStreamClass (refer to VMClass.hasClassInitializer)

static native boolean hasClassInitializer (Class clazz) / N->J / None / M

java.lang.ClassLoader – JamVM