Commit 3a8da024 by Hans Boehm Committed by Tom Tromey

natObject.cc (heavy_lock): Moved fields old_client_data, old_finalization_proc near beginning.

2001-10-15  Hans Boehm <Hans_Boehm@hp.com>

	* java/lang/natObject.cc (heavy_lock): Moved fields
	old_client_data, old_finalization_proc near beginning.
	(heavy_lock_finalization_proc): Now inline; changed type of
	argument.
	(JV_SYNC_TABLE_SZ): Now 2048.
	(mp): New global.
	(spin): `mp' now global.
	(heavy_lock_obj_finalization_proc): Updated to correctly handle
	heavy lock finalization.
	(remove_all_heavy): New function.
	(maybe_remove_all_heavy): Likewise.
	(_Jv_MonitorEnter): Throw exception if object is NULL.
	(_Jv_MonitorExit): Likewise.  Also, clear long lists of unlocked
	heavy locks.
	* include/jvm.h (_Jv_AllocTraceTwo): Declare.
	* nogc.cc (_Jv_AllocTraceTwo): New function.
	* boehm.cc (trace_two_vtable): New global.
	(_Jv_AllocTraceTwo): New function.

From-SVN: r46271
parent c83303d8
2001-10-15 Hans Boehm <Hans_Boehm@hp.com>
* java/lang/natObject.cc (heavy_lock): Moved fields
old_client_data, old_finalization_proc near beginning.
(heavy_lock_finalization_proc): Now inline; changed type of
argument.
(JV_SYNC_TABLE_SZ): Now 2048.
(mp): New global.
(spin): `mp' now global.
(heavy_lock_obj_finalization_proc): Updated to correctly handle
heavy lock finalization.
(remove_all_heavy): New function.
(maybe_remove_all_heavy): Likewise.
(_Jv_MonitorEnter): Throw exception if object is NULL.
(_Jv_MonitorExit): Likewise. Also, clear long lists of unlocked
heavy locks.
* include/jvm.h (_Jv_AllocTraceTwo): Declare.
* nogc.cc (_Jv_AllocTraceTwo): New function.
* boehm.cc (trace_two_vtable): New global.
(_Jv_AllocTraceTwo): New function.
2001-10-15 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
......
......@@ -531,7 +531,7 @@ static _Jv_VTable trace_one_vtable = {
(void *)(2 * sizeof(void *)),
// descriptor; scan 2 words incl. vtable ptr.
// Least significant bits must be zero to
// identify this as a lenght descriptor
// identify this as a length descriptor
{0} // First method
};
......@@ -541,6 +541,24 @@ _Jv_AllocTraceOne (jsize size /* includes vtable slot */)
return GC_GCJ_MALLOC (size, &trace_one_vtable);
}
// Ditto for two words.
// the first field (beyond the fake vtable pointer) to be traced.
// Eventually this should probably be generalized.
static _Jv_VTable trace_two_vtable =
{
0, // class pointer
(void *)(3 * sizeof(void *)),
// descriptor; scan 3 words incl. vtable ptr.
{0} // First method
};
void *
_Jv_AllocTraceTwo (jsize size /* includes vtable slot */)
{
return GC_GCJ_MALLOC (size, &trace_two_vtable);
}
#endif /* JV_HASH_SYNCHRONIZATION */
void
......
......@@ -144,6 +144,8 @@ void _Jv_ThrowNoMemory() __attribute__((__noreturn__));
/* Allocate an object with a single pointer. The first word is reserved
for the GC, and the second word is the traced pointer. */
void *_Jv_AllocTraceOne (jsize size /* incl. reserved slot */);
/* Ditto, but for two traced pointers. */
void *_Jv_AllocTraceTwo (jsize size /* incl. reserved slot */);
/* Initialize the GC. */
void _Jv_InitGC (void);
/* Register a finalizer. */
......
......@@ -146,4 +146,12 @@ _Jv_AllocTraceOne (jsize size /* includes vtable slot */)
if (!obj) _Jv_ThrowNoMemory();
return result;
}
void *
_Jv_AllocTraceTwo (jsize size /* includes vtable slot */)
{
ptr_t obj = calloc(size, 1);
if (!obj) _Jv_ThrowNoMemory();
return result;
}
#endif /* JV_HASH_SYNCHRONIZATION */
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