-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java Class Library #7
Comments
Things I've been thinking about:
|
For native methods we might need a library like |
Calling intiPhase1 requires Unsafe... BootstrapClassLoader::constants_mut().resolve_and_initialize(*thread);
auto *system = BootstrapClassLoader::get().load_or_throw("java/lang/System");
assert(system);
jmethodID method = thread->jni_env->GetStaticMethodID((jclass) system, "initPhase1", "()V");
assert(method);
thread->jni_env->CallStaticVoidMethod((jclass) system, method);
return 0;
}
extern "C" {
_JNI_IMPORT_OR_EXPORT_ void JNICALL
Java_jdk_internal_misc_Unsafe_registerNatives(JNIEnv *env, jclass clazz) {
}
}
|
Reuse OpenJDK or gnu classpath. Which native methdos do we have to implement ourselves? Can we link to a openjdk binary
for some things?
Step 1:
I think as a first step we should focus on making some classes from java/lang usable (Object, String).
lazy loading of classes
Create a (bootstrap) classloader (or should it be named differently?).
The classloader just keeps the zip files open but initially it only reads the index.
Shoudl we only support normal files and jars or also jmods?
native methods (at least enough that we don't crash). Do we have to provide those for object?
Currently some invoke instructions don't even check if a method is native.
(dlopen the correct libraries)
strings
We need to be able to turn a constan pool entry into an allocated string. Possibly with interning.
Threads?
I don't know if we need some support for threads to run simple programs
Step 2 (maybe):
implement jni.h and jvm.h
create libjvm.so and copy it into our copy of the jdk. Should we move our copy of the system jdk into the build folder to avoid problems with multiple builds?
The text was updated successfully, but these errors were encountered: