Commit 2b3c6788 by Keith Seitz Committed by Keith Seitz

Class.h (_Jv_GetClassStatus): Declare.

        * 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.

From-SVN: r121074
parent d374f567
2007-01-22 Keith Seitz <keiths@redhat.com>
* 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.
2007-01-22 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
......
// Class.h - Header file for java.lang.Class. -*- c++ -*-
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
This file is part of libgcj.
......@@ -257,6 +257,8 @@ class _Jv_MethodBase;
_Jv_MethodBase *_Jv_FindInterpreterMethod (jclass, jmethodID);
#endif
jbyte _Jv_GetClassState (jclass);
// Friend classes and functions to implement the ClassLoader
class java::lang::ClassLoader;
class java::lang::VMClassLoader;
......@@ -552,6 +554,7 @@ private:
friend _Jv_MethodBase *(::_Jv_FindInterpreterMethod) (jclass klass,
jmethodID desired_method);
#endif
friend jbyte (::_Jv_GetClassState) (jclass klass);
// Friends classes and functions to implement the ClassLoader
friend class java::lang::ClassLoader;
......
// natClass.cc - Implementation of java.lang.Class native methods.
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation
This file is part of libgcj.
......@@ -2004,3 +2004,9 @@ _Jv_GetMethodDeclaringClass (jmethodID method)
return reinterpret_cast<jclass> (_Jv_StackTrace::ncodeMap->get (obj));
}
jbyte
_Jv_GetClassState (jclass klass)
{
return klass->state;
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment