natClass.cc (initializeClass): Check tables when (state == JV_STATE_IN_PROGRESS).
* java/lang/natClass.cc (initializeClass): Check tables when (state == JV_STATE_IN_PROGRESS). (_Jv_GetInterfaces): Use _Jv_WaitForState to link interface. * java/lang/natClassLoader.cc (_Jv_WaitForState): Handle interpreted classes. (linkClass0): Use _Jv_WaitForState. From-SVN: r62161
This commit is contained in:
parent
ccf9f10cc3
commit
ae724017fd
3 changed files with 31 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
|||
2003-01-30 Jeff Sturm <jsturm@one-point.com>
|
||||
|
||||
* java/lang/natClass.cc (initializeClass): Check tables when
|
||||
(state == JV_STATE_IN_PROGRESS).
|
||||
(_Jv_GetInterfaces): Use _Jv_WaitForState to link interface.
|
||||
* java/lang/natClassLoader.cc (_Jv_WaitForState): Handle
|
||||
interpreted classes.
|
||||
(linkClass0): Use _Jv_WaitForState.
|
||||
|
||||
2003-01-28 Oscar Pearce <oscar@pearceenterprises.com>
|
||||
|
||||
* java/awt/Component.java (processPaintEvent): Dispose of Graphics
|
||||
|
|
|
@ -766,11 +766,23 @@ java::lang::Class::initializeClass (void)
|
|||
wait ();
|
||||
|
||||
// Steps 3 & 4.
|
||||
if (state == JV_STATE_DONE || state == JV_STATE_IN_PROGRESS)
|
||||
if (state == JV_STATE_DONE)
|
||||
{
|
||||
_Jv_MonitorExit (this);
|
||||
return;
|
||||
}
|
||||
if (state == JV_STATE_IN_PROGRESS)
|
||||
{
|
||||
_Jv_MonitorExit (this);
|
||||
|
||||
/* Initialization in progress. The class is linked now,
|
||||
so ensure internal tables are built. */
|
||||
_Jv_PrepareConstantTimeTables (this);
|
||||
_Jv_MakeVTable(this);
|
||||
_Jv_LinkOffsetTable(this);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 5.
|
||||
if (state == JV_STATE_ERROR)
|
||||
|
@ -1213,6 +1225,10 @@ _Jv_GetInterfaces (jclass klass, _Jv_ifaces *ifaces)
|
|||
for (int i=0; i < klass->interface_count; i++)
|
||||
{
|
||||
jclass iface = klass->interfaces[i];
|
||||
|
||||
/* Make sure interface is linked. */
|
||||
_Jv_WaitForState(iface, JV_STATE_LINKED);
|
||||
|
||||
if (_Jv_IndexOf (iface, (void **) ifaces->list, ifaces->count) == -1)
|
||||
{
|
||||
if (ifaces->count + 1 >= ifaces->len)
|
||||
|
|
|
@ -117,6 +117,10 @@ _Jv_WaitForState (jclass klass, int state)
|
|||
{
|
||||
// Must call _Jv_PrepareCompiledClass while holding the class
|
||||
// mutex.
|
||||
#ifdef INTERPRETER
|
||||
if (_Jv_IsInterpretedClass (klass))
|
||||
_Jv_PrepareClass (klass);
|
||||
#endif
|
||||
_Jv_PrepareCompiledClass (klass);
|
||||
_Jv_MonitorExit (klass);
|
||||
return;
|
||||
|
@ -141,15 +145,7 @@ _Jv_WaitForState (jclass klass, int state)
|
|||
void
|
||||
java::lang::ClassLoader::linkClass0 (java::lang::Class *klass)
|
||||
{
|
||||
if (klass->state >= JV_STATE_LINKED)
|
||||
return;
|
||||
|
||||
#ifdef INTERPRETER
|
||||
if (_Jv_IsInterpretedClass (klass))
|
||||
_Jv_PrepareClass (klass);
|
||||
#endif
|
||||
|
||||
_Jv_PrepareCompiledClass (klass);
|
||||
_Jv_WaitForState (klass, JV_STATE_LINKED);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue