public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: PR 23367 on the 4.0 branch
@ 2005-09-30 21:03 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2005-09-30 21:03 UTC (permalink / raw)
  To: Java Patch List

I'm checking this in on the 4.0 branch.

This works around PR 23367 by simply disabling the cache.  The trunk
has a real fix, but I am wary of adding a bunch of configury and TLS
stuff to 4.0 for what amounts to a minor optimization.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	Workaround for PR libgcj/23367:
	* java/lang/natClass.cc (_Jv_FindMethodInCache): Disable.
	(_Jv_AddMethodToCache): Likewise.
	(method_cache): Remove.
	(MCACHE_SIZE): Likewise.
	(struct _Jv_mcache): Likewise.

Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClass.cc,v
retrieving revision 1.84
diff -u -r1.84 natClass.cc
--- java/lang/natClass.cc 17 Feb 2005 19:17:08 -0000 1.84
+++ java/lang/natClass.cc 30 Sep 2005 21:01:15 -0000
@@ -913,46 +913,20 @@
   return NULL;
 }
 
-// NOTE: MCACHE_SIZE should be a power of 2 minus one.
-#define MCACHE_SIZE 1023
-
-struct _Jv_mcache
-{
-  jclass klass;
-  _Jv_Method *method;
-};
-
-static _Jv_mcache method_cache[MCACHE_SIZE + 1];
-
 static void *
-_Jv_FindMethodInCache (jclass klass,
-                       _Jv_Utf8Const *name,
-                       _Jv_Utf8Const *signature)
-{
-  int index = name->hash16 () & MCACHE_SIZE;
-  _Jv_mcache *mc = method_cache + index;
-  _Jv_Method *m = mc->method;
-
-  if (mc->klass == klass
-      && m != NULL             // thread safe check
-      && _Jv_equalUtf8Consts (m->name, name)
-      && _Jv_equalUtf8Consts (m->signature, signature))
-    return mc->method->ncode;
+_Jv_FindMethodInCache (jclass,
+                       _Jv_Utf8Const *,
+                       _Jv_Utf8Const *)
+{
+  // Disabled due to bugginess.  See PR 23367 for details.
   return NULL;
 }
 
 static void
-_Jv_AddMethodToCache (jclass klass,
-                       _Jv_Method *method)
+_Jv_AddMethodToCache (jclass,
+		      _Jv_Method *)
 {
-  _Jv_MonitorEnter (&java::lang::Class::class$); 
-
-  int index = method->name->hash16 () & MCACHE_SIZE;
-
-  method_cache[index].method = method;
-  method_cache[index].klass = klass;
-
-  _Jv_MonitorExit (&java::lang::Class::class$);
+  // Disabled due to bugginess.  See PR 23367 for details.
 }
 
 void *

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-30 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 21:03 Patch: FYI: PR 23367 on the 4.0 branch Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).