harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r542844 - in /harmony/enhanced/drlvm/trunk/vm/gc_gen/src: common/space_tuner.cpp mark_sweep/free_area_pool.h mark_sweep/lspace.cpp mark_sweep/lspace_alloc_collect.cpp
Date Wed, 30 May 2007 15:38:50 GMT
Author: xli
Date: Wed May 30 08:38:49 2007
New Revision: 542844

URL: http://svn.apache.org/viewvc?view=rev&rev=542844
Log:
fix the failure of gc.SynchronizedFinalizersTest

Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/free_area_pool.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp

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?view=diff&rev=542844&r1=542843&r2=542844
==============================================================================
--- 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 May 30 08:38:49
2007
@@ -335,6 +335,7 @@
       tuner->wast_mos = 0;
     }
     tuner->kind = TRANS_NOTHING;    
+    tuner->reverse = 0;
   }
   
   return;  
@@ -407,5 +408,6 @@
   STD_FREE(tuner->interim_blocks);
   return;
 }
+
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/free_area_pool.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/free_area_pool.h?view=diff&rev=542844&r1=542843&r2=542844
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/free_area_pool.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/free_area_pool.h Wed May 30 08:38:49
2007
@@ -49,20 +49,19 @@
   POINTER_SIZE_INT size;
 }Free_Area;
 
-/* this is the only interface for new area creation */
+/* this is the only interface for new area creation. If the new area size is smaller than
threshold, return NULL*/
 inline Free_Area* free_area_new(void* start, POINTER_SIZE_INT size)
 {
   assert(ADDRESS_IS_KB_ALIGNED(start));
   assert(ADDRESS_IS_KB_ALIGNED(size));
 
-  //memset(start, 0, size);
- 
-  if( size < GC_OBJ_SIZE_THRESHOLD) return NULL;
   Free_Area* area = (Free_Area*)start;
   area->zero = 0;
   area->next = area->prev = (Bidir_List*)area;
   area->size = size;
-  return area;
+  
+  if( size < GC_OBJ_SIZE_THRESHOLD) return NULL;
+  else return area;
 }
 
 #define NUM_FLAG_WORDS (NUM_FREE_LIST >> BIT_SHIFT_TO_BITS_PER_WORD)

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp?view=diff&rev=542844&r1=542843&r2=542844
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp Wed May 30 08:38:49 2007
@@ -110,6 +110,7 @@
   What's more, the assumption that the first word of one KB must be zero when iterating 
   lspace in that function lspace_get_next_marked_object is not true*/  
   if(!lspace->move_object) lspace_sweep(lspace);
+  else lspace->surviving_size = (POINTER_SIZE_INT)lspace->scompact_fa_start - (POINTER_SIZE_INT)lspace->heap_start;
   lspace->move_object = FALSE;
   return;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp?view=diff&rev=542844&r1=542843&r2=542844
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp Wed May
30 08:38:49 2007
@@ -404,13 +404,18 @@
   cur_area_end = (void*)ALIGN_DOWN_TO_KILO(p_next_obj);
   unsigned int hash_extend_size = 0;
 
+  Free_Area* cur_area = NULL;
   while(cur_area_end){
+    cur_area = NULL;
     cur_size = (POINTER_SIZE_INT)cur_area_end - (POINTER_SIZE_INT)cur_area_start;
       
-    Free_Area* cur_area = free_area_new(cur_area_start, cur_size);
+    if(cur_size){
+      //debug
+      assert(cur_size >= KB);
+      cur_area = free_area_new(cur_area_start, cur_size);
+      if( cur_area ) free_pool_add_area(lspace->free_pool, cur_area);
+    }
     /* successfully create an area */
-    if( cur_area )
-      free_pool_add_area(lspace->free_pool, cur_area);
 
     p_prev_obj = p_next_obj;
     p_next_obj = lspace_get_next_marked_object(lspace, &mark_bit_idx);
@@ -436,10 +441,12 @@
    /* cur_area_end == NULL */
   cur_area_end = (void*)ALIGN_DOWN_TO_KILO(lspace->heap_end);
   cur_size = (POINTER_SIZE_INT)cur_area_end - (POINTER_SIZE_INT)cur_area_start;
-  Free_Area* cur_area = free_area_new(cur_area_start, cur_size);
-  /* successfully create an area */
-  if( cur_area )
-    free_pool_add_area(lspace->free_pool, cur_area);
+  if(cur_size){
+    //debug
+    assert(cur_size >= KB);
+    cur_area = free_area_new(cur_area_start, cur_size);
+    if( cur_area ) free_pool_add_area(lspace->free_pool, cur_area);
+  }  
 
    mark_bit_idx = 0;
    assert(!lspace_get_first_marked_object(lspace, &mark_bit_idx));



Mime
View raw message