harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r614520 - in /harmony/enhanced/drlvm/trunk/vm/gc_gen/src: common/ finalizer_weakref/ gen/ los/ mark_compact/ mark_sweep/ semi_space/ thread/ trace_forward/ verify/
Date Wed, 23 Jan 2008 12:25:21 GMT
Author: xli
Date: Wed Jan 23 04:25:17 2008
New Revision: 614520

URL: http://svn.apache.org/viewvc?rev=614520&view=rev
Log:
HARMONY-5367: semispace GC implementation. This patch implements the finalizer and weakref
supports, and also fixed a couple of bugs in corner cases.

Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_block.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_concurrent.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_barrier.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/object_status.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref_metadata.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/fallback_mark_scan.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_chunk.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_concurrent_gc_stats.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_sweep_concurrent.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace_gen_ss_pool.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_common.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_scanner.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_gc_effect.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.cpp Wed Jan 23
04:25:17 2008
@@ -257,4 +257,3 @@
 
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/collection_scheduler.h Wed Jan 23 04:25:17
2008
@@ -52,4 +52,3 @@
 
 #endif
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_block.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_block.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_block.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_block.h Wed Jan 23 04:25:17 2008
@@ -282,4 +282,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp Wed Jan 23 04:25:17 2008
@@ -527,4 +527,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_concurrent.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_concurrent.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_concurrent.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_concurrent.cpp Wed Jan 23 04:25:17
2008
@@ -341,4 +341,3 @@
     }
   }
 }
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_barrier.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_barrier.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_barrier.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_barrier.h Wed Jan 23 04:25:17
2008
@@ -42,4 +42,3 @@
 
 #endif /* _GC_FOR_BARRIER_H_ */
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.cpp Wed Jan 23 04:25:17
2008
@@ -50,8 +50,7 @@
 
 
 /* A comparison function for qsort() called below to order offset slots. */
-static int
-intcompare(const void *vi, const void *vj)
+static int intcompare(const void *vi, const void *vj)
 {
   const int *i = (const int *) vi;
   const int *j = (const int *) vj;
@@ -106,7 +105,7 @@
     if(field_is_reference(fh)) {
       int offset = field_get_offset(fh);
 #ifndef BUILD_IN_REFERENT
-      if(is_reference && offset == gc_referent_offset) continue;
+      if(is_reference && (offset == gc_referent_offset)) continue;
 #endif
       *new_ref_array = field_get_offset(fh);
       new_ref_array++;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_class.h Wed Jan 23 04:25:17 2008
@@ -324,4 +324,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp Wed Jan 23 04:25:17 2008
@@ -163,6 +163,8 @@
     gc_terminate_heap_verification(gc);
   }
 
+  STD_FREE(gc->tuner);
+  
   STD_FREE(p_global_gc);
 
   p_global_gc = NULL;
@@ -445,5 +447,4 @@
 {
   return address_belongs_to_gc_heap(p_obj, p_global_gc);  
 }
-
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp Wed Jan 23 04:25:17
2008
@@ -658,4 +658,3 @@
 void free_set_pool_put_entry(Vector_Block* block, GC_Metadata *metadata)
 { pool_put_entry(metadata->free_set_pool, block); }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp Wed Jan 23 04:25:17
2008
@@ -93,4 +93,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/object_status.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/object_status.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/object_status.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/object_status.h Wed Jan 23 04:25:17
2008
@@ -31,8 +31,10 @@
    * With this kind of switch dead objects in MOS & LOS may be set the mark or fw bit
in oi.
    * The second condition is for supporting partially forwarding NOS.
    * In partially forwarding situation live objects in the non-forwarding half NOS will only
be marked but not forwarded.
+   * FIXME:: new implementation of partial forwarding does not use MARK_BIT for non-fw objects.

+   * so I changed the original  obj_is_marked_or_fw_in_oi(p_obj) to obj_is_fw_in_oi(p_obj).
    */
-  return obj_belongs_to_nos(p_obj) && !obj_is_marked_or_fw_in_oi(p_obj);
+  return obj_belongs_to_nos(p_obj) && !obj_is_fw_in_oi(p_obj);
 }
 
 inline Boolean obj_is_dead_in_nongen_minor_gc(Partial_Reveal_Object *p_obj)

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp Wed Jan 23 04:25:17
2008
@@ -537,4 +537,3 @@
   return;
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp Wed
Jan 23 04:25:17 2008
@@ -111,6 +111,8 @@
 
 extern void trace_obj_in_gen_fw(Collector *collector, void *p_ref);
 extern void trace_obj_in_nongen_fw(Collector *collector, void *p_ref);
+extern void trace_obj_in_gen_ss(Collector *collector, void *p_ref);
+extern void trace_obj_in_nongen_ss(Collector *collector, void *p_ref);
 extern void trace_obj_in_normal_marking(Collector *collector, void *p_obj);
 extern void trace_obj_in_fallback_marking(Collector *collector, void *p_ref);
 extern void trace_obj_in_ms_fallback_marking(Collector *collector, void *p_ref);
@@ -134,10 +136,21 @@
   
   /* set trace_object() function */
   if(gc_match_kind(gc, MINOR_COLLECTION)){
-    if(gc_is_gen_mode())
-      trace_object = trace_obj_in_gen_fw;
-    else
+    switch( MINOR_ALGO ){
+    case MINOR_NONGEN_FORWARD_POOL:
       trace_object = trace_obj_in_nongen_fw;
+      break;
+    case MINOR_GEN_FORWARD_POOL:
+      trace_object = trace_obj_in_gen_fw;
+      break;
+    case MINOR_NONGEN_SEMISPACE_POOL:
+      trace_object = trace_obj_in_nongen_ss;
+      break;
+    case MINOR_GEN_SEMISPACE_POOL:
+      trace_object = trace_obj_in_gen_ss;
+      break;
+    default: assert(0);
+    }
   } else if(gc_match_kind(gc, NORMAL_MAJOR_COLLECTION)){
     p_ref_or_obj = p_obj;
     if(gc_has_space_tuner(gc) && (gc->tuner->kind != TRANS_NOTHING)){
@@ -260,6 +273,7 @@
 {
   if(gc_match_either_kind(gc, MAJOR_COLLECTION|MS_COMPACT_COLLECTION))
     finref_reset_repset(gc);
+
   pool_iterator_init(pool);
   Vector_Block *block = pool_iterator_next(pool);
   while(block){
@@ -271,9 +285,13 @@
       REF *p_referent_field = obj_get_referent_field(p_obj);
       if(IS_FALLBACK_COMPACTION)
         fallback_update_fw_ref(p_referent_field);
+        
       Partial_Reveal_Object *p_referent = read_slot(p_referent_field);
       
-      if(!p_referent){  // referent field has been cleared
+      if(!p_referent){  
+        /* referent field has been cleared. I forgot why we set p_ref with NULL here. 
+           I guess it's because this ref_obj was processed in abother p_ref already, so
+           there is no need to keep same ref_obj in this p_ref. */
         *p_ref = (REF)NULL;
         continue;
       }
@@ -281,16 +299,27 @@
         if(obj_need_move(gc, p_referent)){
           if(gc_match_kind(gc, MINOR_COLLECTION)){
             assert(obj_is_fw_in_oi(p_referent));
-            write_slot(p_referent_field, (obj_get_fw_in_oi(p_referent)));
+            Partial_Reveal_Object* p_new_referent = obj_get_fw_in_oi(p_referent);
+            write_slot(p_referent_field, p_new_referent);
+            /* if it's gen mode, and referent stays in NOS, we need keep p_referent_field
in collector remset.
+               This leads to the ref obj live even it is actually only weakly-reachable in
next gen-mode collection. 
+               This simplifies the design. Otherwise, we need remember the refobj in MOS
seperately and process them seperately. */
+            if(gc_is_gen_mode())
+              if(addr_belongs_to_nos(p_new_referent) && !addr_belongs_to_nos(p_obj))
+                collector_remset_add_entry(gc->collectors[0], ( Partial_Reveal_Object**)p_referent_field);

+
           } else if(!gc_match_kind(gc, MS_COLLECTION)){
             finref_repset_add_entry(gc, p_referent_field);
           }
         }
         *p_ref = (REF)NULL;
-        continue;
+      }else{
+	      /* else, the referent is dead (weakly reachable), clear the referent field */
+	      *p_referent_field = (REF)NULL; 
+	      /* for dead referent, p_ref is not set NULL. p_ref keeps the ref object, which
+	         will be moved to VM for enqueueing. */
       }
-      *p_referent_field = (REF)NULL; /* referent is weakly reachable: clear the referent
field */
-    }
+    }/* for each ref object */
     
     block = pool_iterator_next(pool);
   }
@@ -355,7 +384,12 @@
         if(obj_need_move(gc, p_referent))
           if(gc_match_kind(gc, MINOR_COLLECTION)){
             assert(obj_is_fw_in_oi(p_referent));
-            write_slot(p_referent_field, (obj_get_fw_in_oi(p_referent)));
+            Partial_Reveal_Object* p_new_referent = obj_get_fw_in_oi(p_referent);
+            write_slot(p_referent_field, p_new_referent);
+            if(gc_is_gen_mode())
+              if(addr_belongs_to_nos(p_new_referent) && !addr_belongs_to_nos(p_obj))
+                collector_remset_add_entry(gc->collectors[0], ( Partial_Reveal_Object**)p_referent_field);

+
           } else if(!gc_match_kind(gc, MS_COLLECTION)){
             finref_repset_add_entry(gc, p_referent_field);
           }
@@ -458,9 +492,11 @@
       REF *p_ref = (REF*)iter;
       Partial_Reveal_Object *p_obj = read_slot(p_ref);
       assert(p_obj);
-      /* Perhaps obj has been resurrected by previous resurrections */
+      /* Perhaps obj has been resurrected by previous resurrections. If the fin-obj was resurrected,
we need put it back to obj_with_fin pool.
+         For minor collection, the resurrected obj was forwarded, so we need use the new
copy.*/
       if(!gc_obj_is_dead(gc, p_obj) && obj_belongs_to_nos(p_obj)){
-        if(!gc_is_gen_mode() || fspace_obj_to_be_forwarded(p_obj)){
+        /* Even in NOS, not all live objects are forwarded due to the partial-forward algortihm
*/ 
+        if(!NOS_PARTIAL_FORWARD || fspace_obj_to_be_forwarded(p_obj)){
           write_slot(p_ref , obj_get_fw_in_oi(p_obj));
           p_obj = read_slot(p_ref);
         }
@@ -626,7 +662,12 @@
         if(obj_need_move(gc, p_referent))
           if(gc_match_kind(gc, MINOR_COLLECTION)){
             assert(obj_is_fw_in_oi(p_referent));
-            write_slot(p_referent_field , obj_get_fw_in_oi(p_referent));
+            Partial_Reveal_Object* p_new_referent = obj_get_fw_in_oi(p_referent);
+            write_slot(p_referent_field, p_new_referent);
+            if(gc_is_gen_mode())
+              if(addr_belongs_to_nos(p_new_referent) && !addr_belongs_to_nos(p_obj))
+                collector_remset_add_entry(gc->collectors[0], ( Partial_Reveal_Object**)p_referent_field);

+
           } else {
             finref_repset_add_entry(gc, p_referent_field);
           }
@@ -810,7 +851,6 @@
   finref_copy_pool(finalizable_obj_pool, finalizable_obj_pool_copy, gc);
   finref_copy_pool_to_rootset(gc, finalizable_obj_pool_copy);
 }
-
 
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref_metadata.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref_metadata.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref_metadata.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref_metadata.cpp
Wed Jan 23 04:25:17 2008
@@ -441,4 +441,3 @@
  return TRUE;
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp Wed Jan 23 04:25:17 2008
@@ -1068,4 +1068,3 @@
     STD_FREE(collector->backup_allocator);  
   }
 }
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h Wed Jan 23 04:25:17 2008
@@ -243,4 +243,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.cpp Wed Jan 23 04:25:17 2008
@@ -77,6 +77,7 @@
 void lspace_destruct(Lspace* lspace)
 {
   /* we don't free the real space here, the heap will be freed altogether */
+  STD_FREE(lspace->free_pool);
   STD_FREE(lspace);
   lspace = NULL;
   return;
@@ -129,5 +130,4 @@
 {
   return lspace->failure_size;
 }
-
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp Wed Jan 23 04:25:17
2008
@@ -481,4 +481,3 @@
 }
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/fallback_mark_scan.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/fallback_mark_scan.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/fallback_mark_scan.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/fallback_mark_scan.cpp Wed Jan
23 04:25:17 2008
@@ -258,4 +258,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp Wed Jan 23 04:25:17
2008
@@ -91,6 +91,7 @@
 #endif
 
   /* we don't free the real space here, the heap will be freed altogether */
+  STD_FREE(mspace->space_statistic);
   STD_FREE(mspace);  
   mspace = NULL;
 }
@@ -174,5 +175,4 @@
 {
     return mspace->expected_threshold_ratio;
 }
-
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp Wed Jan 23 04:25:17
2008
@@ -73,4 +73,3 @@
 }
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp Wed
Jan 23 04:25:17 2008
@@ -284,7 +284,7 @@
        WARN2("gc.process", "GC: collector["<<((POINTER_SIZE_INT)collector->thread_handle)<<"]:
MOS is overflowed, have to reduce NOS size.");
      Block *old_nos_boundary = nspace->blocks;
      nos_boundary = &mspace->blocks[mspace->free_block_idx - mspace->first_block_idx];
-     if(nspace->num_managed_blocks != 0) /* FIXME:: why can it be 0 here?? */
+     if(nspace->num_managed_blocks != 0) /* FIXME:: why can it be 0 here?? Because mspace
extend can't happen is NOS is zero size */
        assert(nos_boundary > old_nos_boundary);
      POINTER_SIZE_INT mem_change_size = ((Block *)nos_boundary - old_nos_boundary) <<
GC_BLOCK_SHIFT_COUNT;
      nspace->heap_start = nos_boundary;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_chunk.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_chunk.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_chunk.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_chunk.cpp Wed Jan 23 04:25:17
2008
@@ -911,4 +911,3 @@
 #endif
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_concurrent_gc_stats.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_concurrent_gc_stats.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_concurrent_gc_stats.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_concurrent_gc_stats.cpp Wed
Jan 23 04:25:17 2008
@@ -199,4 +199,3 @@
 }
 #endif
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_sweep_concurrent.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_sweep_concurrent.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_sweep_concurrent.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/wspace_sweep_concurrent.cpp Wed
Jan 23 04:25:17 2008
@@ -381,4 +381,3 @@
   while(num_sweeping_collectors != num_active_collectors + 1);
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp Wed Jan 23 04:25:17 2008
@@ -50,7 +50,6 @@
 
 static void sspace_config_after_clean(Sspace* sspace)
 {
-  
   unsigned int num_tospace_blocks = sspace_compute_num_tospace_blocks(sspace);
   unsigned int num_fromspace_blocks = sspace->num_managed_blocks - num_tospace_blocks;
   unsigned int sspace_first_idx = sspace->first_block_idx;
@@ -148,7 +147,7 @@
     cur_free_block = cur_free_block->next;  
   }
   fromspace_free_size = num_free_blocks << GC_BLOCK_SHIFT_COUNT;
-  
+ 
   return tospace_free_size + fromspace_free_size;
 }
 
@@ -160,6 +159,9 @@
 /* adjust the next pointer of block to point correctly to its adjacent next */
 void sspace_prepare_for_collection(Sspace* sspace)
 {  
+  if(sspace->num_managed_blocks == 0)
+    return;
+  
   unsigned int tospace_first_idx = sspace->tospace_first_idx;
   unsigned int sspace_last_idx = sspace->first_block_idx + sspace->num_managed_blocks
- 1;
 
@@ -196,14 +198,25 @@
 
 void sspace_reset_after_collection(Sspace* sspace)
 { 
+  /* the space is zero size after major (or variant) collection. No need
+     to reset its tospace and fromspace, but still we still set its allocation
+     pointer to NULL so that nothing can be allocated. And we need set 
+     num_used_blocks to 0 in case GC need the data for space tuning whatever. */
+  if(sspace->num_managed_blocks == 0) {
+    sspace->cur_free_block = NULL;
+    sspace->num_used_blocks = 0;
+    return;
+  }
+  
   Block* blocks = (Block*)sspace->blocks;
- 
    /* During LOS extension, NOS last block points back to MOS first block, so that,
      the first couple blocks of MOS are compacted to NOS end. We need reset the NOS last
block next pointer.
      This is needed for next collection. And it's needed for from-space setup, 
-     so that the last block of from-space points to NULL. 
-   */
-  Block_Header *sspace_last_block = (Block_Header*)&blocks[sspace->num_managed_blocks
- 1];
+     so that the last block of from-space points to NULL. */
+  Block_Header *sspace_last_block = (Block_Header*)((Block*)sspace->heap_end - 1);
+
+  assert(sspace_last_block);
+
   sspace_last_block->next = NULL;
 
   unsigned int sspace_first_idx = sspace->first_block_idx;
@@ -219,7 +232,7 @@
       Block_Header* block = (Block_Header*)&(blocks[i - sspace_first_idx]);
       block_reset(block);
     }
-  
+
     return;          
   }
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace_gen_ss_pool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace_gen_ss_pool.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace_gen_ss_pool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace_gen_ss_pool.cpp Wed Jan 23
04:25:17 2008
@@ -68,7 +68,7 @@
       p_ref= (REF *)vector_get_element_address_ref((Vector_Handle) array, i);
       scan_slot(collector, p_ref);
     }   
-    return;
+    return; /* array can't be a reference object, directly return. */
   }
 
   /* scan non-array object */
@@ -103,7 +103,13 @@
   Partial_Reveal_Object *p_obj = read_slot(p_ref);
 
   /* p_obj can also be in tospace because this p_ref is a redundant one in mutator remset.

-     We don't rem p_ref because it was remembered in first time it's met. */   
+     We don't rem p_ref because it was remembered in first time it's met. 
+     FIXME:: the situation obj_belongs_to_tospace() should never be true if we
+     remember object rather than slot. Currently, mutator remembers objects, and
+     collector remembers slots. Although collectors remember slots, we are sure 
+     there are no chances to have repetitive p_ref because an object is scanned only
+     when it is marked or forwarded atomically, hence only one collector has chance
+     to do the scanning. */   
   if(!obj_belongs_to_nos(p_obj) || obj_belongs_to_tospace(p_obj)) return; 
 
   Partial_Reveal_Object* p_target_obj = NULL;
@@ -295,7 +301,7 @@
     TRACE2("gc.process", "GC: collector["<<(POINTER_SIZE_INT)collector->thread_handle<<"]
finished");
     return;
   }
-
+  /* single collector world */
   gc->collect_result = gc_collection_result(gc);
   if(!gc->collect_result){
 #ifndef BUILD_IN_REFERENT

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp Wed Jan 23 04:25:17 2008
@@ -350,4 +350,3 @@
 
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.cpp Wed Jan 23 04:25:17 2008
@@ -277,4 +277,3 @@
   return;
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.h?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/marker.h Wed Jan 23 04:25:17 2008
@@ -100,4 +100,3 @@
 
 #endif //_MARKER_H_
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp Wed Jan 23 04:25:17 2008
@@ -110,7 +110,8 @@
     }
   }
   unlock(mutator->dirty_set_lock);
-  //gc_set_tls(NULL);
+  STD_FREE(mutator);
+  gc_set_tls(NULL);
   
   return;
 }
@@ -171,6 +172,5 @@
   unlock(gc->mutator_list_lock); 
   return NULL;
 }
-
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp Wed Jan 23 04:25:17
2008
@@ -98,4 +98,3 @@
   
 }
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_common.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_common.cpp Wed Jan 23 04:25:17
2008
@@ -270,4 +270,3 @@
 }
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_scanner.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_scanner.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_scanner.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verifier_scanner.cpp Wed Jan 23 04:25:17
2008
@@ -443,4 +443,3 @@
 }
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_gc_effect.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_gc_effect.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_gc_effect.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_gc_effect.cpp Wed Jan 23 04:25:17
2008
@@ -553,4 +553,3 @@
 
 
 
-

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp?rev=614520&r1=614519&r2=614520&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp Wed Jan 23 04:25:17
2008
@@ -152,4 +152,3 @@
 Heap_Verifier* get_heap_verifier()
 { return heap_verifier; }
 
-



Mime
View raw message