jni.cc: Include IdentityHashMap.h, not Hashtable.h.

* jni.cc: Include IdentityHashMap.h, not Hashtable.h.
	(local_ref_table, global_ref_table): Now IdentityHashMap.
	(_Jv_JNI_Init): Updated for new types.
	(mark_for_gc): Likewise.
	(unmark_for_gc): Likewise.
	* gcj/javaprims.h: Rebuilt class list.
	* Makefile.in: Rebuilt.
	* Makefile.am (core_java_source_files): Added new file.
	* java/util/IdentityHashMap.java: New file.

From-SVN: r44929
This commit is contained in:
Tom Tromey 2001-08-15 20:46:48 +00:00 committed by Tom Tromey
parent 369e1d74c6
commit ac8d99218a
7 changed files with 442 additions and 11 deletions

View file

@ -37,7 +37,7 @@ details. */
#include <java/lang/reflect/Method.h>
#include <java/lang/reflect/Modifier.h>
#include <java/lang/OutOfMemoryError.h>
#include <java/util/Hashtable.h>
#include <java/util/IdentityHashMap.h>
#include <java/lang/Integer.h>
#include <java/lang/ThreadGroup.h>
#include <java/lang/Thread.h>
@ -91,9 +91,9 @@ struct _Jv_JNI_LocalFrame
};
// This holds a reference count for all local references.
static java::util::Hashtable *local_ref_table;
static java::util::IdentityHashMap *local_ref_table;
// This holds a reference count for all global references.
static java::util::Hashtable *global_ref_table;
static java::util::IdentityHashMap *global_ref_table;
// The only VM.
static JavaVM *the_vm;
@ -148,8 +148,8 @@ jvmpiDisableEvent (jint event_type, void *)
void
_Jv_JNI_Init (void)
{
local_ref_table = new java::util::Hashtable;
global_ref_table = new java::util::Hashtable;
local_ref_table = new java::util::IdentityHashMap;
global_ref_table = new java::util::IdentityHashMap;
#ifdef ENABLE_JVMPI
_Jv_JVMPI_Interface.version = 1;
@ -163,7 +163,7 @@ _Jv_JNI_Init (void)
// Tell the GC that a certain pointer is live.
static void
mark_for_gc (jobject obj, java::util::Hashtable *ref_table)
mark_for_gc (jobject obj, java::util::IdentityHashMap *ref_table)
{
JvSynchronize sync (ref_table);
@ -176,7 +176,7 @@ mark_for_gc (jobject obj, java::util::Hashtable *ref_table)
// Unmark a pointer.
static void
unmark_for_gc (jobject obj, java::util::Hashtable *ref_table)
unmark_for_gc (jobject obj, java::util::IdentityHashMap *ref_table)
{
JvSynchronize sync (ref_table);