[kaffe] CVS kaffe (robilad): kaffe/kaffevm/reference.c (KaffeVM_registerObjectReference,

Kaffe CVS cvs-commits at kaffe.org
Wed Aug 8 07:54:11 PDT 2007


PatchSet 7525 
Date: 2007/08/08 14:52:34
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
2007-08-08  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffevm/reference.c (KaffeVM_registerObjectReference,
        defaultObjectFinalizer): Added debug code.

        * kaffe/kaffevm/kaffe-gc/gc-refs.c (resizeWeakReferenceObject,
        KaffeGC_addWeakRef): Mark weak references correctly.

Members: 
	ChangeLog:1.5023->1.5024 
	kaffe/kaffevm/reference.c:1.9->1.10 
	kaffe/kaffevm/kaffe-gc/gc-refs.c:1.16->1.17 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5023 kaffe/ChangeLog:1.5024
--- kaffe/ChangeLog:1.5023	Wed Aug  8 00:33:52 2007
+++ kaffe/ChangeLog	Wed Aug  8 14:52:34 2007
@@ -1,3 +1,11 @@
+2007-08-08  Dalibor Topic  <robilad at kaffe.org>
+
+	* kaffe/kaffevm/reference.c (KaffeVM_registerObjectReference,
+	defaultObjectFinalizer): Added debug code.
+
+	* kaffe/kaffevm/kaffe-gc/gc-refs.c (resizeWeakReferenceObject,
+	KaffeGC_addWeakRef): Mark weak references correctly.
+
 2007-08-07  Kazuyuki Shudo  <2006 at shudo.net>
 
 	Down to 19 failures from 25 in jit mode with jthreads 
Index: kaffe/kaffe/kaffevm/reference.c
diff -u kaffe/kaffe/kaffevm/reference.c:1.9 kaffe/kaffe/kaffevm/reference.c:1.10
--- kaffe/kaffe/kaffevm/reference.c:1.9	Sat Apr 22 01:53:41 2006
+++ kaffe/kaffe/kaffevm/reference.c	Wed Aug  8 14:52:35 2007
@@ -117,6 +117,10 @@
       referentOffset = FIELD_BOFFSET(referent_field);
     }
 
+  DBG(REFERENCE, dprintf("Reference %p (%s) added for object %p (%s)\n",
+                 reference, CLASS_CNAME(OBJECT_CLASS((Hjava_lang_Object *)reference)),
+                 obj, CLASS_CNAME(OBJECT_CLASS((Hjava_lang_Object *)obj))); );
+
   KGC_addWeakRef(main_collector, obj,
 		 (void **)((char *)reference + referentOffset));
 }
@@ -142,6 +146,9 @@
   Method* final;
   
   objclass = OBJECT_CLASS(obj);
+
+  DBG(REFERENCE, dprintf("Calling default finalizer for object %p (%s)\n",
+                 obj, CLASS_CNAME(objclass)); );
 
   final = objclass->finalizer;
   
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.16 kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.17
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.16	Sun Nov 27 18:19:08 2005
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c	Wed Aug  8 14:52:35 2007
@@ -153,7 +153,7 @@
     {
       previousSize = obj->allRefSize;
       unlockStaticMutex(&weakRefLock);
-      refs = KGC_malloc(collector, size * sizeof(void **), KGC_ALLOC_REF);
+      refs = KGC_malloc(collector, size * sizeof(void **), KGC_ALLOC_VMWEAKREF);
       lockStaticMutex(&weakRefLock);
       if (refs == NULL)
 	{
@@ -238,13 +238,13 @@
 
   /* Not found - create a new one */
   unlockStaticMutex(&weakRefLock);
-  obj = (weakRefObject*)KGC_malloc(collector, sizeof(weakRefObject), KGC_ALLOC_REF);
+  obj = (weakRefObject*)KGC_malloc(collector, sizeof(weakRefObject), KGC_ALLOC_VMWEAKREF);
   if (obj == NULL)
     return false;
 
   obj->mem = mem;
   obj->ref = 1;
-  obj->allRefs = (void ***)KGC_malloc(collector, sizeof(void ***), KGC_ALLOC_REF);
+  obj->allRefs = (void ***)KGC_malloc(collector, sizeof(void ***), KGC_ALLOC_VMWEAKREF);
   lockStaticMutex(&weakRefLock);
   obj->allRefs[0] = refobj;
 




More information about the kaffe mailing list