harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r543467 - in /harmony/enhanced/drlvm/trunk/vm/gc_gen/src: common/mark_scan_pool.cpp finalizer_weakref/finalizer_weakref.cpp mark_compact/los_extention_mark_scan.cpp mark_compact/mspace_slide_compact.cpp
Date Fri, 01 Jun 2007 11:41:19 GMT
Author: xli
Date: Fri Jun  1 04:41:18 2007
New Revision: 543467

URL: http://svn.apache.org/viewvc?view=rev&rev=543467
Log:
Fix of the test_CtorLjava_io_ByteArrayInputStream failure of org.apache.harmony.security.tests.asn1.der.BerInputStreamTest.
The fix is to include the object size info of those resurrected finalizable objects.

Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/mark_scan_pool.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/finalizer_weakref/finalizer_weakref.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/los_extention_mark_scan.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/mark_scan_pool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/mark_scan_pool.cpp?view=diff&rev=543467&r1=543466&r2=543467
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/mark_scan_pool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/mark_scan_pool.cpp Fri Jun  1 04:41:18
2007
@@ -37,7 +37,6 @@
 static FORCE_INLINE void scan_object(Collector* collector, Partial_Reveal_Object *p_obj)
 {
   vm_notify_obj_alive( (void *)p_obj);
-
   if( !object_has_ref_field(p_obj) ) return;
   
   REF *p_ref;
@@ -189,7 +188,7 @@
   return;
 }
 
-void trace_obj_in_marking(Collector *collector, void *p_obj)
+void trace_obj_in_normal_marking(Collector *collector, void *p_obj)
 {
   trace_object(collector, (Partial_Reveal_Object *)p_obj);
 }

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?view=diff&rev=543467&r1=543466&r2=543467
==============================================================================
--- 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 Fri
Jun  1 04:41:18 2007
@@ -26,6 +26,7 @@
 #include "../trace_forward/fspace.h"
 #include "../mark_sweep/lspace.h"
 #include "../gen/gen.h"
+#include "../common/space_tuner.h"
 
 Boolean IGNORE_FINREF = FALSE;
 Boolean DURING_RESURRECTION = FALSE;
@@ -151,8 +152,10 @@
 
 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_marking(Collector *collector, void *p_obj);
+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_space_tune_marking(Collector *collector, void *p_obj);
+
 
 typedef void (* Trace_Object_Func)(Collector *collector, void *p_ref_or_obj);
 // clear the two least significant bits of p_obj first
@@ -175,7 +178,19 @@
       trace_object = trace_obj_in_nongen_fw;
   } else if(gc_match_kind(gc, MAJOR_COLLECTION)){
     p_ref_or_obj = p_obj;
-    trace_object = trace_obj_in_marking;
+    if(gc->tuner->kind != TRANS_NOTHING){
+      trace_object = trace_obj_in_space_tune_marking;
+      unsigned int obj_size = vm_object_size(p_obj);
+#ifdef USE_32BITS_HASHCODE
+      obj_size += (hashcode_is_set(p_obj))?GC_OBJECT_ALIGNMENT:0;
+#endif
+      if(!obj_belongs_to_space(p_obj, gc_get_los((GC_Gen*)gc)))
+        collector->non_los_live_obj_size += obj_size;
+      else
+        collector->los_live_obj_size += round_up_to_size(obj_size, KB); 
+    }else{  
+      trace_object = trace_obj_in_normal_marking;
+    }
     obj_mark_in_vt(p_obj);
   } else {
     assert(gc_match_kind(gc, FALLBACK_COLLECTION));

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/los_extention_mark_scan.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/los_extention_mark_scan.cpp?view=diff&rev=543467&r1=543466&r2=543467
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/los_extention_mark_scan.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/los_extention_mark_scan.cpp Fri
Jun  1 04:41:18 2007
@@ -202,5 +202,7 @@
   return;
 }
 
-
-
+void trace_obj_in_space_tune_marking(Collector *collector, void *p_obj)
+{
+  trace_object(collector, (Partial_Reveal_Object *)p_obj);
+}

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp?view=diff&rev=543467&r1=543466&r2=543467
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp Fri Jun
 1 04:41:18 2007
@@ -427,11 +427,6 @@
 
    /* last collector's world here */
   if( ++old_num == num_active_collectors ){
-    if( gc->tuner->kind != TRANS_NOTHING ) gc_compute_space_tune_size_after_marking(gc);
-    assert(!(gc->tuner->tuning_size % GC_BLOCK_SIZE_BYTES));
-    /* prepare for next phase */
-    gc_init_block_for_collectors(gc, mspace);
-    
     if(!IGNORE_FINREF )
       collector_identify_finref(collector);
 #ifndef BUILD_IN_REFERENT
@@ -441,6 +436,11 @@
     }
 #endif
 
+    if( gc->tuner->kind != TRANS_NOTHING ) gc_compute_space_tune_size_after_marking(gc);
+    assert(!(gc->tuner->tuning_size % GC_BLOCK_SIZE_BYTES));
+    /* prepare for next phase */
+    gc_init_block_for_collectors(gc, mspace);
+    
 #ifdef USE_32BITS_HASHCODE
     if(gc_match_kind(gc, FALLBACK_COLLECTION))
       fallback_clear_fwd_obj_oi_init(collector);



Mime
View raw message