jvm.h (_Jv_GetJavaVM): Declare.
* include/jvm.h (_Jv_GetJavaVM): Declare. * include/java-interp.h (_Jv_GetFirstMethod): New function. (_Jv_MethodBase::get_method): New method. (_Jv_JNIMethod::set_function): New method. * jni.cc (_Jv_JNI_UnregisterNatives): New function. (_Jv_JNI_RegisterNatives): New function. (_Jv_JNIFunctions): Updated for new functions. (_Jv_GetJavaVM): New function. (_Jv_JNI_GetJavaVM): Use it. Now static. (_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread is already a Java thread but does not have a JNIEnv yet. * java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload function. From-SVN: r32056
This commit is contained in:
parent
31e890f0f3
commit
8ade47715e
5 changed files with 135 additions and 14 deletions
|
@ -79,6 +79,12 @@ protected:
|
|||
|
||||
// Size of raw arguments.
|
||||
_Jv_ushort args_raw_size;
|
||||
|
||||
public:
|
||||
_Jv_Method *get_method ()
|
||||
{
|
||||
return self;
|
||||
}
|
||||
};
|
||||
|
||||
class _Jv_InterpMethod : public _Jv_MethodBase
|
||||
|
@ -156,8 +162,16 @@ class _Jv_InterpClass : public java::lang::Class
|
|||
friend void _Jv_PrepareClass(jclass);
|
||||
friend void _Jv_InitField (jobject, jclass, int);
|
||||
friend void* _Jv_MarkObj (void *, void *, void *, void *);
|
||||
|
||||
friend _Jv_MethodBase ** _Jv_GetFirstMethod (_Jv_InterpClass *klass);
|
||||
};
|
||||
|
||||
extern inline _Jv_MethodBase **
|
||||
_Jv_GetFirstMethod (_Jv_InterpClass *klass)
|
||||
{
|
||||
return klass->interpreted_methods;
|
||||
}
|
||||
|
||||
struct _Jv_ResolvedMethod {
|
||||
jint stack_item_count;
|
||||
jint vtable_index;
|
||||
|
@ -190,6 +204,13 @@ class _Jv_JNIMethod : public _Jv_MethodBase
|
|||
|
||||
friend class _Jv_ClassReader;
|
||||
friend void _Jv_PrepareClass(jclass);
|
||||
|
||||
public:
|
||||
// FIXME: this is ugly.
|
||||
void set_function (void *f)
|
||||
{
|
||||
function = f;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* INTERPRETER */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue