This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix pr16789 failures on the SPARC


Hi,

First of all, SPARC doesn't enable hash synchronization (I don't remember 
exactly the details, David S. Miller is the right person to ask about this).  
On this kind of platforms, we have:

FAIL: Thread_HoldsLock execution - source compiled test
FAIL: Thread_HoldsLock execution - gij test
FAIL: Thread_HoldsLock execution - bytecode->native test
FAIL: Thread_HoldsLock -O3 execution - source compiled test
FAIL: Thread_HoldsLock execution - gij test
FAIL: Thread_HoldsLock -O3 execution - bytecode->native test
FAIL: pr16789 execution - source compiled test
FAIL: pr16789 execution - gij test
FAIL: pr16789 execution - bytecode->native test
FAIL: pr16789 -O3 execution - source compiled test
FAIL: pr16789 execution - gij test
FAIL: pr16789 -O3 execution - bytecode->native test

because obj->sync_info is NULL in:

bool
_Jv_ObjectCheckMonitor (jobject obj)
{
  _Jv_SyncInfo *si = (_Jv_SyncInfo *) obj->sync_info;
  return _Jv_MutexCheckMonitor (&si->mutex);
}

Fixed by invoking obj->sync_init if needed.  Tested on sparc64-sun-solaris2.9 
and sparc-sun-solaris2.8.  OK for mainline?


2005-01-03  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* java/lang/natObject.cc (_Jv_ObjectCheckMonitor): Initialize the
	sync_info element of the object if needed.


-- 
Eric Botcazou
Index: java/lang/natObject.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natObject.cc,v
retrieving revision 1.32
diff -u -p -r1.32 natObject.cc
--- java/lang/natObject.cc	28 Aug 2004 00:45:56 -0000	1.32
+++ java/lang/natObject.cc	3 Jan 2005 18:14:41 -0000
@@ -267,6 +267,8 @@ _Jv_MonitorExit (jobject obj)
 bool
 _Jv_ObjectCheckMonitor (jobject obj)
 {
+  if (__builtin_expect (INIT_NEEDED (obj), false))
+    obj->sync_init ();
   _Jv_SyncInfo *si = (_Jv_SyncInfo *) obj->sync_info;
   return _Jv_MutexCheckMonitor (&si->mutex);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]