diff options
author | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-23 01:06:10 +0000 |
---|---|---|
committer | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-23 01:06:10 +0000 |
commit | f5e8dfe885cf0ce5adcc395ddf3def9c8b76ce15 (patch) | |
tree | 416f41361ca12878d762b9b6efc9c9c439ca26eb /libjava/jvmti.cc | |
parent | 09a8846288b52f49777b05277a941804cf470530 (diff) | |
download | gcc-f5e8dfe885cf0ce5adcc395ddf3def9c8b76ce15.tar.gz |
* java/lang/Class.h (_Jv_GetClassStatus): Declare.
* java/lang/natClass.cc (_Jv_GetClassStatus): New function.
* jvmti.cc (_Jv_JVMTI_GetClassStatus): New function.
(_Jv_JVMTI_Interface): Define GetClassStatus.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/jvmti.cc')
-rw-r--r-- | libjava/jvmti.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/libjava/jvmti.cc b/libjava/jvmti.cc index f6df8c56084..69cfda5ae75 100644 --- a/libjava/jvmti.cc +++ b/libjava/jvmti.cc @@ -420,6 +420,36 @@ _Jv_JVMTI_Deallocate (MAYBE_UNUSED jvmtiEnv *env, unsigned char *mem) } static jvmtiError JNICALL +_Jv_JVMTI_GetClassStatus (MAYBE_UNUSED jvmtiEnv *env, jclass klass, + jint *status_ptr) +{ + REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE); + NULL_CHECK (status_ptr); + if (klass == NULL) + return JVMTI_ERROR_INVALID_CLASS; + + if (klass->isArray ()) + *status_ptr = JVMTI_CLASS_STATUS_ARRAY; + else if (klass->isPrimitive ()) + *status_ptr = JVMTI_CLASS_STATUS_PRIMITIVE; + else + { + jbyte state = _Jv_GetClassState (klass); + *status_ptr = 0; + if (state >= JV_STATE_LINKED) + (*status_ptr) |= JVMTI_CLASS_STATUS_VERIFIED; + if (state >= JV_STATE_PREPARED) + (*status_ptr) |= JVMTI_CLASS_STATUS_PREPARED; + if (state == JV_STATE_ERROR || state == JV_STATE_PHANTOM) + (*status_ptr) |= JVMTI_CLASS_STATUS_ERROR; + else if (state == JV_STATE_DONE) + (*status_ptr) |= JVMTI_CLASS_STATUS_INITIALIZED; + } + + return JVMTI_ERROR_NONE; +} + +static jvmtiError JNICALL _Jv_JVMTI_GetClassModifiers (MAYBE_UNUSED jvmtiEnv *env, jclass klass, jint *mods) { @@ -1452,7 +1482,7 @@ struct _Jv_jvmtiEnv _Jv_JVMTI_Interface = _Jv_JVMTI_Allocate, // Allocate _Jv_JVMTI_Deallocate, // Deallocate UNIMPLEMENTED, // GetClassSignature - UNIMPLEMENTED, // GetClassStatus + _Jv_JVMTI_GetClassStatus, // GetClassStatus UNIMPLEMENTED, // GetSourceFileName _Jv_JVMTI_GetClassModifiers, // GetClassModifiers _Jv_JVMTI_GetClassMethods, // GetClassMethods |