harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r520357 - in /harmony/enhanced/drlvm/trunk/vm/gc_gen/src: common/ gen/ mark_compact/ mark_sweep/ thread/ trace_forward/ utils/
Date Tue, 20 Mar 2007 11:13:51 GMT
Author: xli
Date: Tue Mar 20 04:13:49 2007
New Revision: 520357

URL: http://svn.apache.org/viewvc?view=rev&rev=520357
Log:
H3421 - to workaround the inline asm support problem in Win64 platform. Also clean up lots
of warning messages.

Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_common.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_platform.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_space.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.h
    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/gen/gen_adapt.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.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/lspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace_alloc_collect.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue Mar 20 04:13:49 2007
@@ -33,9 +33,9 @@
 
 extern Boolean GC_VERIFY;
 
-extern unsigned int NOS_SIZE;
-extern unsigned int MIN_NOS_SIZE;
-extern unsigned int MIN_LOS_SIZE;
+extern POINTER_SIZE_INT NOS_SIZE;
+extern POINTER_SIZE_INT MIN_NOS_SIZE;
+extern POINTER_SIZE_INT MIN_LOS_SIZE;
 
 extern Boolean FORCE_FULL_COMPACT;
 extern Boolean MINOR_ALGORITHM;
@@ -45,9 +45,9 @@
 extern unsigned int MINOR_COLLECTORS;
 extern unsigned int MAJOR_COLLECTORS;
 
-unsigned int HEAP_SIZE_DEFAULT = 256 * MB;
-unsigned int min_heap_size_bytes = 32 * MB;
-unsigned int max_heap_size_bytes = 0;
+POINTER_SIZE_INT HEAP_SIZE_DEFAULT = 256 * MB;
+POINTER_SIZE_INT min_heap_size_bytes = 32 * MB;
+POINTER_SIZE_INT max_heap_size_bytes = 0;
 
 extern Boolean JVMTI_HEAP_ITERATION ;
 
@@ -126,8 +126,8 @@
 
 void gc_parse_options(GC* gc) 
 {
-  unsigned int max_heap_size = HEAP_SIZE_DEFAULT;
-  unsigned int min_heap_size = min_heap_size_bytes;
+  POINTER_SIZE_INT max_heap_size = HEAP_SIZE_DEFAULT;
+  POINTER_SIZE_INT min_heap_size = min_heap_size_bytes;
   
   if (is_property_set("gc.mx", VM_PROPERTIES) == 1) {
     max_heap_size = get_size_property("gc.mx");

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_platform.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_platform.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_platform.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_platform.h Tue Mar 20 04:13:49 2007
@@ -63,22 +63,22 @@
 #define THREAD_OK       TM_ERROR_NONE
 
 inline int vm_wait_event(VmEventHandle event)
-{   IDATA stat = hysem_wait(event);
-    assert(stat == TM_ERROR_NONE); return stat;
+{   int stat = (int)hysem_wait(event);
+    assert(stat == THREAD_OK); return stat;
 }
 
 inline int vm_set_event(VmEventHandle event)
-{   IDATA stat = hysem_post(event);
-    assert(stat == TM_ERROR_NONE); return stat;
+{   int stat = (int)hysem_post(event);
+    assert(stat == THREAD_OK); return stat;
 }
 
 inline int vm_reset_event(VmEventHandle event)
-{   IDATA stat = hysem_set(event,0);
-    assert(stat == TM_ERROR_NONE); return stat;
+{   int stat = (int)hysem_set(event,0);
+    assert(stat == THREAD_OK); return stat;
 }
 
 inline int vm_create_event(VmEventHandle* event)
-{  return hysem_create(event, 0, 1); }
+{  return (int)hysem_create(event, 0, 1); }
 
 inline void vm_thread_yield()
 {  hythread_yield(); }
@@ -93,7 +93,7 @@
   UDATA priority = 0;
   UDATA suspend = 0;
   
-  return hythread_create(ret_thread, stacksize, priority, suspend, 
+  return (int)hythread_create(ret_thread, stacksize, priority, suspend, 
                              (hythread_entrypoint_t)func, data);
 }
 
@@ -136,7 +136,7 @@
 #endif
 }
 
-inline void *vm_map_mem(void* start, unsigned int size) 
+inline void *vm_map_mem(void* start, POINTER_SIZE_INT size) 
 {
   void* address;
 #ifdef _WINDOWS_
@@ -150,7 +150,7 @@
   return address;
 }
 
-inline Boolean vm_unmap_mem(void* start, unsigned int size) 
+inline Boolean vm_unmap_mem(void* start, POINTER_SIZE_INT size) 
 {
   unsigned int result;
 #ifdef _WINDOWS_
@@ -164,7 +164,7 @@
   return result;
 }
 
-inline void *vm_alloc_mem(void* start, unsigned int size) 
+inline void *vm_alloc_mem(void* start, POINTER_SIZE_INT size) 
 {
   void* address;
 #ifdef _WINDOWS_
@@ -178,12 +178,12 @@
   return address;
 }
 
-inline Boolean vm_free_mem(void* start, unsigned int size) 
+inline Boolean vm_free_mem(void* start, POINTER_SIZE_INT size) 
 {
   return vm_unmap_mem(start, size);
 }
 
-inline void *vm_reserve_mem(void* start, unsigned int size) 
+inline void *vm_reserve_mem(void* start, POINTER_SIZE_INT size) 
 {
   void* address;
 #ifdef _WINDOWS_
@@ -201,12 +201,12 @@
   return address;
 }
 
-inline Boolean vm_release_mem(void* start, unsigned int size) 
+inline Boolean vm_release_mem(void* start, POINTER_SIZE_INT size) 
 {
   return vm_unmap_mem(start, size);
 }
 
-inline void *vm_commit_mem(void* start, unsigned int size) 
+inline void *vm_commit_mem(void* start, POINTER_SIZE_INT size) 
 {
   void* address;
 #ifdef _WINDOWS_
@@ -220,7 +220,7 @@
   return address;
 }
 
-inline Boolean vm_decommit_mem(void* start, unsigned int size) 
+inline Boolean vm_decommit_mem(void* start, POINTER_SIZE_INT size) 
 {
   unsigned int result;
 #ifdef _WINDOWS_

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_space.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_space.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_space.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_space.h Tue Mar 20 04:13:49 2007
@@ -30,8 +30,8 @@
 typedef struct Space{
   void* heap_start;
   void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
+  POINTER_SIZE_INT reserved_heap_size;
+  POINTER_SIZE_INT committed_heap_size;
   unsigned int num_collections;
   int64 time_collections;
   float survive_ratio;
@@ -39,12 +39,12 @@
   GC* gc;
   Boolean move_object;
   /*Size allocted after last collection. */
-  unsigned int alloced_size;
+  POINTER_SIZE_INT alloced_size;
   /*For_statistic*/  
-  unsigned int surviving_size;
+  POINTER_SIZE_INT surviving_size;
 }Space;
 
-inline unsigned int space_committed_size(Space* space){ return space->committed_heap_size;}
+inline POINTER_SIZE_INT space_committed_size(Space* space){ return space->committed_heap_size;}
 inline void* space_heap_start(Space* space){ return space->heap_start; }
 inline void* space_heap_end(Space* space){ return space->heap_end; }
 
@@ -63,8 +63,8 @@
   /* <-- first couple of fields are overloadded as Space */
   void* heap_start;
   void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
+  POINTER_SIZE_INT reserved_heap_size;
+  POINTER_SIZE_INT committed_heap_size;
   unsigned int num_collections;
   int64 time_collections;
   float survive_ratio;
@@ -72,9 +72,9 @@
   GC* gc;
   Boolean move_object;
   /*Size allocted after last collection. */
-  unsigned int alloced_size;
+  POINTER_SIZE_INT alloced_size;
   /*For_statistic*/  
-  unsigned int surviving_size;
+  POINTER_SIZE_INT surviving_size;
   /* END of Space --> */
 
   Block* blocks; /* short-cut for mpsace blockheader access, not mandatory */
@@ -123,14 +123,14 @@
   assert( ((Block_Header*)decommit_base)->block_idx >= space->free_block_idx);
   
   void* old_end = (void*)&space->blocks[space->num_managed_blocks];
-  unsigned int decommit_size = (POINTER_SIZE_INT)old_end - (POINTER_SIZE_INT)decommit_base;
+  POINTER_SIZE_INT decommit_size = (POINTER_SIZE_INT)old_end - (POINTER_SIZE_INT)decommit_base;
   assert(decommit_size && !(decommit_size%GC_BLOCK_SIZE_BYTES));
   
   Boolean result = vm_decommit_mem(decommit_base, decommit_size);
   assert(result == TRUE);
   
   space->committed_heap_size = (POINTER_SIZE_INT)decommit_base - (POINTER_SIZE_INT)space->heap_start;
-  space->num_managed_blocks = space->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+  space->num_managed_blocks = (unsigned int)(space->committed_heap_size >> GC_BLOCK_SHIFT_COUNT);
   
   Block_Header* new_last_block = (Block_Header*)&space->blocks[space->num_managed_blocks
- 1];
   space->ceiling_block_idx = new_last_block->block_idx;
@@ -143,10 +143,10 @@
   
   void* old_base = (void*)&space->blocks[space->num_managed_blocks];
   void* commit_base = (void*)round_down_to_size((POINTER_SIZE_INT)old_base, SPACE_ALLOC_UNIT);
-  unsigned int block_diff_count = ((POINTER_SIZE_INT)old_base - (POINTER_SIZE_INT)commit_base)
>> GC_BLOCK_SHIFT_COUNT;
+  unsigned int block_diff_count = (unsigned int)(((POINTER_SIZE_INT)old_base - (POINTER_SIZE_INT)commit_base)
>> GC_BLOCK_SHIFT_COUNT);
   block_inc_count += block_diff_count;
   
-  unsigned int commit_size = block_inc_count << GC_BLOCK_SHIFT_COUNT;
+  POINTER_SIZE_INT commit_size = block_inc_count << GC_BLOCK_SHIFT_COUNT;
   void* result = vm_commit_mem(commit_base, commit_size);
   assert(result == commit_base);
 
@@ -167,7 +167,7 @@
   }
   last_block->next = NULL;
   space->ceiling_block_idx = last_block->block_idx;
-  space->num_managed_blocks = space->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+  space->num_managed_blocks = (unsigned int)(space->committed_heap_size >> GC_BLOCK_SHIFT_COUNT);
 }
 
 #endif //#ifndef _GC_SPACE_H_

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=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue Mar 20 04:13:49
2007
@@ -28,7 +28,7 @@
 Space* gc_get_mos(GC_Gen* gc);
 Space* gc_get_nos(GC_Gen* gc);
 Space* gc_get_los(GC_Gen* gc);
-unsigned int mspace_get_expected_threshold(Mspace* mspace);
+POINTER_SIZE_INT mspace_get_expected_threshold(Mspace* mspace);
 unsigned int lspace_get_failure_size(Lspace* lspace);
     
 /*Now just prepare the alloc_size field of mspace, used to compute new los size.*/
@@ -52,12 +52,12 @@
   tuner->speed_mos += mspace->alloced_size;
 
   /*For_statistic wasted memory*/
-  unsigned int curr_used_los = lspace->surviving_size + lspace->alloced_size;
+  POINTER_SIZE_INT curr_used_los = lspace->surviving_size + lspace->alloced_size;
   assert(curr_used_los < lspace->committed_heap_size);
-  unsigned int curr_wast_los = lspace->committed_heap_size - curr_used_los;
+  POINTER_SIZE_INT curr_wast_los = lspace->committed_heap_size - curr_used_los;
   tuner->wast_los += curr_wast_los;
-  unsigned int curr_used_mos = mspace->surviving_size + mspace->alloced_size;
-  unsigned int curr_wast_mos = mspace_get_expected_threshold((Mspace*)mspace) - curr_used_mos;
+  POINTER_SIZE_INT curr_used_mos = mspace->surviving_size + mspace->alloced_size;
+  POINTER_SIZE_INT curr_wast_mos = mspace_get_expected_threshold((Mspace*)mspace) - curr_used_mos;
   tuner->wast_mos += curr_wast_mos;
   tuner->current_dw = abs((int)tuner->wast_mos - (int)tuner->wast_los);
 
@@ -90,24 +90,25 @@
   Blocked_Space* fspace = (Blocked_Space*)gc_get_nos((GC_Gen*)gc);
   Space* lspace = (Space*)gc_get_los((GC_Gen*)gc);
 
-  unsigned int los_expect_survive_sz = (unsigned int)((float)(lspace->surviving_size +
lspace->alloced_size) * lspace->survive_ratio);
-  unsigned int los_expect_free_sz = lspace->committed_heap_size - los_expect_survive_sz;
+  POINTER_SIZE_INT los_expect_survive_sz = (POINTER_SIZE_INT)((float)(lspace->surviving_size
+ lspace->alloced_size) * lspace->survive_ratio);
+  POINTER_SIZE_INT los_expect_free_sz = lspace->committed_heap_size - los_expect_survive_sz;
   
-  unsigned int mos_expect_survive_sz = (unsigned int)((float)(mspace->surviving_size +
mspace->alloced_size) * mspace->survive_ratio);
-  unsigned int mos_expect_free_sz = mspace_get_expected_threshold((Mspace*)mspace) - mos_expect_survive_sz;
+  POINTER_SIZE_INT mos_expect_survive_sz = (POINTER_SIZE_INT)((float)(mspace->surviving_size
+ mspace->alloced_size) * mspace->survive_ratio);
+  POINTER_SIZE_INT mos_expect_free_sz = mspace_get_expected_threshold((Mspace*)mspace) -
mos_expect_survive_sz;
   
-  unsigned int total_free = los_expect_free_sz + mos_expect_free_sz;
+  POINTER_SIZE_INT total_free = los_expect_free_sz + mos_expect_free_sz;
 
   float new_los_ratio = (float)tuner->speed_los / (float)(tuner->speed_los  + tuner->speed_mos);
-  unsigned int new_free_los_sz = (unsigned int)((float)total_free * new_los_ratio);
+  POINTER_SIZE_INT new_free_los_sz = (POINTER_SIZE_INT)((float)total_free * new_los_ratio);
   
-  if((int)new_free_los_sz - (int)los_expect_free_sz > (int)tuner->min_tuning_size){
+  if(new_free_los_sz > los_expect_free_sz && 
+         (new_free_los_sz - los_expect_free_sz > tuner->min_tuning_size)){
     tuner->kind = TRANS_FROM_MOS_TO_LOS;
     tuner->tuning_size = round_up_to_size(new_free_los_sz - los_expect_free_sz, SPACE_ALLOC_UNIT);
     tuner->least_tuning_size = round_up_to_size(lspace_get_failure_size((Lspace*)lspace),
SPACE_ALLOC_UNIT);
     tuner->conservative_tuning_size = round_up_to_size(((tuner->tuning_size + tuner->least_tuning_size)
>> 1), SPACE_ALLOC_UNIT);
     
-     unsigned int none_los_size;
+     POINTER_SIZE_INT none_los_size;
  #ifdef STATIC_NOS_MAPPING
      none_los_size = mspace->committed_heap_size;
  #else
@@ -174,7 +175,7 @@
       tuner->conservative_tuning_size = ((tuner->tuning_size + tuner->min_tuning_size)
>> 1);
     }
     
-    unsigned int none_los_size;
+    POINTER_SIZE_INT none_los_size;
 #ifdef STATIC_NOS_MAPPING
     none_los_size = mspace->committed_heap_size;
 #else

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/space_tuner.h Tue Mar 20 04:13:49 2007
@@ -37,29 +37,29 @@
 typedef struct Space_Tuner{
     Transform_Kind kind;
 
-    unsigned int tuning_size;
-    unsigned int conservative_tuning_size;
-    unsigned int least_tuning_size;
+    POINTER_SIZE_INT tuning_size;
+    POINTER_SIZE_INT conservative_tuning_size;
+    POINTER_SIZE_INT least_tuning_size;
     unsigned int force_tune;
     
     /*LOS alloc speed sciecne last los variation*/    
-    unsigned int speed_los;
+    POINTER_SIZE_INT speed_los;
     /*MOS alloc speed sciecne last los variation*/    
-    unsigned int speed_mos;
+    POINTER_SIZE_INT speed_mos;
 
     /*Total wasted memory of los science last los variation*/
-    unsigned int wast_los;
+    POINTER_SIZE_INT wast_los;
     /*Total wasted memory of mos science last los variation*/
-    unsigned int wast_mos;
+    POINTER_SIZE_INT wast_mos;
 
-    unsigned int current_dw;
+    POINTER_SIZE_INT current_dw;
     /*NOS survive size of last minor, this could be the least meaningful space unit when
talking about tuning.*/
-    unsigned int current_ds;
+    POINTER_SIZE_INT current_ds;
 
     /*Threshold for deta wast*/
-    unsigned int threshold;
+    POINTER_SIZE_INT threshold;
     /*Minimun tuning size for los variation*/
-    unsigned int min_tuning_size;
+    POINTER_SIZE_INT min_tuning_size;
 
     /*Cost of normal major compaction*/
     unsigned int fast_cost;

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp Tue Mar 20 04:13:49 2007
@@ -27,13 +27,13 @@
 #include "../common/compressed_ref.h"
 
 /* fspace size limit is not interesting. only for manual tuning purpose */
-unsigned int min_nos_size_bytes = 16 * MB;
-unsigned int max_nos_size_bytes = 256 * MB;
-unsigned int min_los_size_bytes = 4*MB;
-unsigned int NOS_SIZE = 0;
-unsigned int MIN_LOS_SIZE = 0;
-unsigned int MIN_NOS_SIZE = 0;
-unsigned int MAX_NOS_SIZE = 0;
+POINTER_SIZE_INT min_nos_size_bytes = 16 * MB;
+POINTER_SIZE_INT max_nos_size_bytes = 256 * MB;
+POINTER_SIZE_INT min_los_size_bytes = 4*MB;
+POINTER_SIZE_INT NOS_SIZE = 0;
+POINTER_SIZE_INT MIN_LOS_SIZE = 0;
+POINTER_SIZE_INT MIN_NOS_SIZE = 0;
+POINTER_SIZE_INT MAX_NOS_SIZE = 0;
 
 static unsigned int MINOR_ALGO = 0;
 static unsigned int MAJOR_ALGO = 0;
@@ -50,7 +50,7 @@
 
 static void gc_gen_get_system_info(GC_Gen *gc_gen) 
 {
-  gc_gen->_machine_page_size_bytes = port_vmem_page_sizes()[0];
+  gc_gen->_machine_page_size_bytes = (unsigned int)port_vmem_page_sizes()[0];
   gc_gen->_num_processors = port_CPUs_number();
   gc_gen->_system_alloc_unit = vm_get_system_alloc_unit();
   SPACE_ALLOC_UNIT = max(gc_gen->_system_alloc_unit, GC_BLOCK_SIZE_BYTES);
@@ -58,7 +58,7 @@
 
 void* alloc_large_pages(size_t size, const char* hint);
 
-void gc_gen_initialize(GC_Gen *gc_gen, unsigned int min_heap_size, unsigned int max_heap_size)

+void gc_gen_initialize(GC_Gen *gc_gen, POINTER_SIZE_INT min_heap_size, POINTER_SIZE_INT max_heap_size)

 {
   assert(gc_gen); 
   gc_gen_get_system_info(gc_gen); 
@@ -70,14 +70,14 @@
 
   min_nos_size_bytes *=  gc_gen->_num_processors;
 
-  unsigned int min_nos_size_threshold = max_heap_size>>5;
+  POINTER_SIZE_INT min_nos_size_threshold = max_heap_size>>5;
   if(min_nos_size_bytes  > min_nos_size_threshold){
     min_nos_size_bytes = round_down_to_size(min_nos_size_threshold,SPACE_ALLOC_UNIT);
   }
   
   if( MIN_NOS_SIZE )  min_nos_size_bytes = MIN_NOS_SIZE;
 
-  unsigned int los_size = max_heap_size >> 7;
+  POINTER_SIZE_INT los_size = max_heap_size >> 7;
   if(MIN_LOS_SIZE) min_los_size_bytes = MIN_LOS_SIZE;
   if(los_size < min_los_size_bytes ) 
     los_size = min_los_size_bytes ;
@@ -87,9 +87,9 @@
   /* let's compute and reserve the space for committing */
   
   /* heuristic nos + mos + LOS = max, and nos*ratio = mos */
-  unsigned int nos_reserve_size,  nos_commit_size; 
-  unsigned int mos_reserve_size, mos_commit_size; 
-  unsigned int los_mos_size;
+  POINTER_SIZE_INT nos_reserve_size,  nos_commit_size; 
+  POINTER_SIZE_INT mos_reserve_size, mos_commit_size; 
+  POINTER_SIZE_INT los_mos_size;
   
   /*Give GC a hint of gc survive ratio.*/
   gc_gen->survive_ratio = 0.2f;
@@ -104,7 +104,7 @@
   }else{  
     los_mos_size = max_heap_size;
     mos_reserve_size = los_mos_size - los_size;
-    nos_commit_size = (unsigned int)(((float)(max_heap_size - los_size))/(1.0f + gc_gen->survive_ratio));
+    nos_commit_size = (POINTER_SIZE_INT)(((float)(max_heap_size - los_size))/(1.0f + gc_gen->survive_ratio));
     nos_reserve_size = mos_reserve_size;
   }
     
@@ -438,7 +438,7 @@
     }else{
       cont = vm_iterate_object((Managed_Object_Handle)lspace_obj);
       if (!cont) return;
-      unsigned int obj_size = ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object *)lspace_obj));
+      unsigned int obj_size = (unsigned int)ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object
*)lspace_obj));
       lspace_obj = lspace_obj + obj_size;
     }
   }

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.h Tue Mar 20 04:13:49 2007
@@ -21,7 +21,6 @@
 #ifndef _GC_GEN_H_
 #define _GC_GEN_H_
 
-extern unsigned int NOS_SIZE;
 
 #include "../common/gc_common.h"
 #include "../thread/gc_thread.h"
@@ -38,14 +37,15 @@
 }; 
 
 /* some globals */
+extern POINTER_SIZE_INT NOS_SIZE;
 
 /* heap size limit is not interesting. only for manual tuning purpose */
-extern unsigned int min_heap_size_bytes;
-extern unsigned int max_heap_size_bytes;
+extern POINTER_SIZE_INT min_heap_size_bytes;
+extern POINTER_SIZE_INT max_heap_size_bytes;
 
 /* fspace size is variable, adjusted adaptively within the range */
-extern unsigned int min_nos_size_bytes;
-extern unsigned int max_nos_size_bytes;
+extern POINTER_SIZE_INT min_nos_size_bytes;
+extern POINTER_SIZE_INT max_nos_size_bytes;
 
 struct Gen_Mode_Adaptor;
 
@@ -53,8 +53,8 @@
   /* <-- First couple of fields overloaded as GC */
   void* heap_start;
   void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
+  POINTER_SIZE_INT reserved_heap_size;
+  POINTER_SIZE_INT committed_heap_size;
   unsigned int num_collections;
   int64 time_collections;
   float survive_ratio;  
@@ -106,34 +106,34 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
-void gc_gen_initialize(GC_Gen *gc, unsigned int initial_heap_size, unsigned int final_heap_size);
+void gc_gen_initialize(GC_Gen *gc, POINTER_SIZE_INT initial_heap_size, POINTER_SIZE_INT final_heap_size);
 void gc_gen_destruct(GC_Gen *gc);
                         
-inline unsigned int gc_gen_free_memory_size(GC_Gen* gc)
+inline POINTER_SIZE_INT gc_gen_free_memory_size(GC_Gen* gc)
 {  return space_free_memory_size((Blocked_Space*)gc->nos) +
           space_free_memory_size((Blocked_Space*)gc->mos) +
           lspace_free_memory_size(gc->los);  }
                     
-inline unsigned int gc_gen_total_memory_size(GC_Gen* gc)
+inline POINTER_SIZE_INT gc_gen_total_memory_size(GC_Gen* gc)
 {  return space_committed_size((Space*)gc->nos) +
           space_committed_size((Space*)gc->mos) +
           lspace_committed_size(gc->los);  }
 
 /////////////////////////////////////////////////////////////////////////////////////////
 
-inline void gc_nos_initialize(GC_Gen* gc, void* start, unsigned int nos_size, unsigned int
commit_size)
+inline void gc_nos_initialize(GC_Gen* gc, void* start, POINTER_SIZE_INT nos_size, POINTER_SIZE_INT
commit_size)
 { fspace_initialize((GC*)gc, start, nos_size, commit_size); }
 
 inline void gc_nos_destruct(GC_Gen* gc)
 { fspace_destruct(gc->nos); }
 
-inline void gc_mos_initialize(GC_Gen* gc, void* start, unsigned int mos_size, unsigned int
commit_size)
+inline void gc_mos_initialize(GC_Gen* gc, void* start, POINTER_SIZE_INT mos_size, POINTER_SIZE_INT
commit_size)
 { mspace_initialize((GC*)gc, start, mos_size, commit_size); }
 
 inline void gc_mos_destruct(GC_Gen* gc)
 { mspace_destruct(gc->mos); }
 
-inline void gc_los_initialize(GC_Gen* gc, void* start, unsigned int los_size)
+inline void gc_los_initialize(GC_Gen* gc, void* start, POINTER_SIZE_INT los_size)
 { lspace_initialize((GC*)gc, start, los_size); }
 
 inline void gc_los_destruct(GC_Gen* gc)

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen_adapt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen_adapt.cpp?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen_adapt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen_adapt.cpp Tue Mar 20 04:13:49 2007
@@ -338,7 +338,7 @@
 
   POINTER_SIZE_INT curr_nos_size = space_committed_size((Space*)fspace);
 
-  if( abs((POINTER_SIZE_SINT)new_nos_size - (POINTER_SIZE_SINT)curr_nos_size) < NOS_COPY_RESERVE_DELTA
)
+  if( abs((int)(new_nos_size - curr_nos_size)) < NOS_COPY_RESERVE_DELTA )
     return;
   
   /* below are ajustment */  
@@ -348,14 +348,14 @@
   fspace->heap_start = nos_boundary;
   fspace->blocks = (Block*)nos_boundary;
   fspace->committed_heap_size = new_nos_size;
-  fspace->num_managed_blocks = new_nos_size >> GC_BLOCK_SHIFT_COUNT;
+  fspace->num_managed_blocks = (unsigned int)(new_nos_size >> GC_BLOCK_SHIFT_COUNT);
   fspace->num_total_blocks = fspace->num_managed_blocks;
   fspace->first_block_idx = ((Block_Header*)nos_boundary)->block_idx;
   fspace->free_block_idx = fspace->first_block_idx;
 
   mspace->heap_end = nos_boundary;
   mspace->committed_heap_size = new_mos_size;
-  mspace->num_managed_blocks = new_mos_size >> GC_BLOCK_SHIFT_COUNT;
+  mspace->num_managed_blocks = (unsigned int)(new_mos_size >> GC_BLOCK_SHIFT_COUNT);
   mspace->num_total_blocks = mspace->num_managed_blocks;
   mspace->ceiling_block_idx = ((Block_Header*)nos_boundary)->block_idx - 1;
 

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue Mar 20 04:13:49
2007
@@ -31,7 +31,7 @@
 extern void gc_set_mos(GC_Gen* gc, Space* space);
 extern Space* gc_get_nos(GC_Gen* gc);
 
-void mspace_initialize(GC* gc, void* start, unsigned int mspace_size, unsigned int commit_size)
+void mspace_initialize(GC* gc, void* start, POINTER_SIZE_INT mspace_size, POINTER_SIZE_INT
commit_size)
 {
   Mspace* mspace = (Mspace*)STD_MALLOC( sizeof(Mspace));
   assert(mspace);
@@ -99,7 +99,7 @@
 {
   GC* gc = mspace->gc;
   if(gc->tuner->kind == TRANS_FROM_MOS_TO_LOS){
-    unsigned int tuning_blocks = ((mspace->gc)->tuner->tuning_size >> GC_BLOCK_SHIFT_COUNT);
+    unsigned int tuning_blocks = (unsigned int)((mspace->gc)->tuner->tuning_size
>> GC_BLOCK_SHIFT_COUNT);
     mspace->block_iterator = (Block_Header*)&(mspace->blocks[tuning_blocks]);
     return;
   }
@@ -168,7 +168,7 @@
     return;
 }
 
-unsigned int mspace_get_expected_threshold(Mspace* mspace)
+POINTER_SIZE_INT mspace_get_expected_threshold(Mspace* mspace)
 {
     return mspace->expected_threshold;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace.h Tue Mar 20 04:13:49 2007
@@ -28,8 +28,8 @@
   /* <-- first couple of fields are overloadded as Space */
   void* heap_start;
   void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
+  POINTER_SIZE_INT reserved_heap_size;
+  POINTER_SIZE_INT committed_heap_size;
   unsigned int num_collections;
   int64 time_collections;
   float survive_ratio;
@@ -37,9 +37,9 @@
   GC* gc;
   Boolean move_object;
   /*Size allocted after last collection.*/
-  unsigned int alloced_size;
+  POINTER_SIZE_INT alloced_size;
   /*For_statistic: size survived after major*/  
-  unsigned int surviving_size;
+  POINTER_SIZE_INT surviving_size;
   /* END of Space --> */
     
   Block* blocks; /* short-cut for mpsace blockheader access, not mandatory */
@@ -59,7 +59,7 @@
   POINTER_SIZE_INT expected_threshold;
 }Mspace;
 
-void mspace_initialize(GC* gc, void* reserved_base, unsigned int mspace_size, unsigned int
commit_size);
+void mspace_initialize(GC* gc, void* reserved_base, POINTER_SIZE_INT mspace_size, POINTER_SIZE_INT
commit_size);
 void mspace_destruct(Mspace* mspace);
 
 void* mspace_alloc(unsigned size, Allocator *allocator);

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp Tue
Mar 20 04:13:49 2007
@@ -36,8 +36,8 @@
   if(tuner->kind != TRANS_FROM_MOS_TO_LOS)
     return;
   
-  unsigned int tune_size = tuner->tuning_size;
-  unsigned int tune_blocks = tune_size >> GC_BLOCK_SHIFT_COUNT;
+  POINTER_SIZE_INT tune_size = tuner->tuning_size;
+  unsigned int tune_blocks = (unsigned int)(tune_size >> GC_BLOCK_SHIFT_COUNT);
 
   mspace->blocks = &mspace->blocks[tune_blocks];
   mspace->heap_start = mspace->blocks;
@@ -132,7 +132,7 @@
     Blocked_Space* nos = (Blocked_Space*)gc_get_nos((GC_Gen*)gc);
     Block_Header* nos_last_block = (Block_Header*)&nos->blocks[nos->num_managed_blocks-1];
     Block_Header* mos_first_block = (Block_Header*)&mspace->blocks[0];
-    unsigned int trans_blocks = (tuner->tuning_size >> GC_BLOCK_SHIFT_COUNT);
+    unsigned int trans_blocks = (unsigned int)(tuner->tuning_size >> GC_BLOCK_SHIFT_COUNT);
     nos_last_block->next = mos_first_block;
     ((Block_Header*)&(mspace->blocks[trans_blocks - 1]))->next = NULL;
     

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue
Mar 20 04:13:49 2007
@@ -45,7 +45,7 @@
     first_block_to_move = (Block *)space_heap_start((Space *)fspace);
 }
 
-static unsigned int fspace_shrink(Fspace *fspace)
+static POINTER_SIZE_INT fspace_shrink(Fspace *fspace)
 {
   void *committed_nos_end = (void *)((POINTER_SIZE_INT)space_heap_start((Space *)fspace)
+ fspace->committed_heap_size);
   
@@ -65,7 +65,7 @@
   assert(result == TRUE);
   
   fspace->committed_heap_size = (POINTER_SIZE_INT)decommit_base - (POINTER_SIZE_INT)fspace->heap_start;
-  fspace->num_managed_blocks = fspace->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+  fspace->num_managed_blocks = (unsigned int)(fspace->committed_heap_size >>
GC_BLOCK_SHIFT_COUNT);
   
   Block_Header *new_last_block = (Block_Header *)&fspace->blocks[fspace->num_managed_blocks
- 1];
   fspace->ceiling_block_idx = new_last_block->block_idx;
@@ -111,7 +111,7 @@
   }
   last_block->next = NULL;
   mspace->ceiling_block_idx = last_block->block_idx;
-  mspace->num_managed_blocks = mspace->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+  mspace->num_managed_blocks = (unsigned int)(mspace->committed_heap_size >>
GC_BLOCK_SHIFT_COUNT);
   
   return (Block *)commit_base;
 }
@@ -280,18 +280,18 @@
      Block *old_nos_boundary = fspace->blocks;
      nos_boundary = &mspace->blocks[mspace->free_block_idx - mspace->first_block_idx];
      assert(nos_boundary > old_nos_boundary);
-     unsigned int mem_change_size = ((Block *)nos_boundary - old_nos_boundary) << GC_BLOCK_SHIFT_COUNT;
+     POINTER_SIZE_INT mem_change_size = ((Block *)nos_boundary - old_nos_boundary) <<
GC_BLOCK_SHIFT_COUNT;
      fspace->heap_start = nos_boundary;
      fspace->blocks = (Block *)nos_boundary;
      fspace->committed_heap_size -= mem_change_size;
-     fspace->num_managed_blocks = fspace->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+     fspace->num_managed_blocks = (unsigned int)(fspace->committed_heap_size >>
GC_BLOCK_SHIFT_COUNT);
      fspace->num_total_blocks = fspace->num_managed_blocks;
      fspace->first_block_idx = ((Block_Header *)nos_boundary)->block_idx;
      fspace->free_block_idx = fspace->first_block_idx;
      
      mspace->heap_end = nos_boundary;
      mspace->committed_heap_size += mem_change_size;
-     mspace->num_managed_blocks = mspace->committed_heap_size >> GC_BLOCK_SHIFT_COUNT;
+     mspace->num_managed_blocks = (unsigned int)(mspace->committed_heap_size >>
GC_BLOCK_SHIFT_COUNT);
      mspace->num_total_blocks = mspace->num_managed_blocks;
      mspace->ceiling_block_idx = ((Block_Header *)nos_boundary)->block_idx - 1;
 

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=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue Mar 20 04:13:49 2007
@@ -31,7 +31,7 @@
   #define LOS_HEAD_RESERVE_FOR_HEAP_NULL (0*KB)
 #endif
 
-void lspace_initialize(GC* gc, void* start, unsigned int lspace_size)
+void lspace_initialize(GC* gc, void* start, POINTER_SIZE_INT lspace_size)
 {
   Lspace* lspace = (Lspace*)STD_MALLOC( sizeof(Lspace));
   assert(lspace);

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h Tue Mar 20 04:13:49 2007
@@ -29,8 +29,8 @@
   /* <-- first couple of fields are overloadded as Space */
   void* heap_start;
   void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
+  POINTER_SIZE_INT reserved_heap_size;
+  POINTER_SIZE_INT committed_heap_size;
   unsigned int num_collections;
   int64 time_collections;
   float survive_ratio;
@@ -38,9 +38,9 @@
   GC* gc;
   Boolean move_object;
   /*For_statistic: size allocated science last time collect los, ie. last major*/
-  unsigned int alloced_size;
+  POINTER_SIZE_INT alloced_size;
   /*For_statistic: size survived after lspace_sweep*/  
-  unsigned int surviving_size;
+  POINTER_SIZE_INT surviving_size;
   /* END of Space --> */
 
   Free_Area_Pool* free_pool;
@@ -48,15 +48,15 @@
   unsigned int failure_size;
 }Lspace;
 
-void lspace_initialize(GC* gc, void* reserved_base, unsigned int lspace_size);
+void lspace_initialize(GC* gc, void* reserved_base, POINTER_SIZE_INT lspace_size);
 void lspace_destruct(Lspace* lspace);
 Managed_Object_Handle lspace_alloc(unsigned int size, Allocator* allocator);
 void lspace_sweep(Lspace* lspace);
 void lspace_reset_after_collection(Lspace* lspace);
 void lspace_collection(Lspace* lspace);
 
-inline unsigned int lspace_free_memory_size(Lspace* lspace){ /* FIXME:: */ return 0; }
-inline unsigned int lspace_committed_size(Lspace* lspace){ return lspace->committed_heap_size;
}
+inline POINTER_SIZE_INT lspace_free_memory_size(Lspace* lspace){ /* FIXME:: */ return 0;
}
+inline POINTER_SIZE_INT lspace_committed_size(Lspace* lspace){ return lspace->committed_heap_size;
}
 
 inline Partial_Reveal_Object* lspace_get_next_marked_object( Lspace* lspace, unsigned int*
iterate_index)
 {
@@ -71,12 +71,12 @@
         if(next_area_start < (POINTER_SIZE_INT)lspace->heap_end){
             //If there is a living object at this addr, return it, and update iterate_index
             if(obj_is_marked_in_vt((Partial_Reveal_Object*)next_area_start)){
-                unsigned int obj_size = ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object*)next_area_start));
+                unsigned int obj_size = (unsigned int)ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object*)next_area_start));
                 *iterate_index = (unsigned int)((next_area_start + obj_size - (POINTER_SIZE_INT)lspace->heap_start)
>> BIT_SHIFT_TO_KILO);
                 return (Partial_Reveal_Object*)next_area_start;
             //If this is a dead object, go on to find  a living one.
             }else{
-                unsigned int obj_size = ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object*)next_area_start));
+                unsigned int obj_size = (unsigned int)ALIGN_UP_TO_KILO(vm_object_size((Partial_Reveal_Object*)next_area_start));
                 next_area_start += obj_size;
             }
         }else{

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=520357&r1=520356&r2=520357
==============================================================================
--- 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 Tue Mar
20 04:13:49 2007
@@ -44,7 +44,7 @@
     Free_Area* free_area;
     void* p_result;
     int remain_size;
-    unsigned int alloc_size = ALIGN_UP_TO_KILO(size);
+    POINTER_SIZE_INT alloc_size = ALIGN_UP_TO_KILO(size);
     unsigned int new_list_nr = 0;
     Lockable_Bidir_List* head = &pool->sized_area_list[list_hint];
 
@@ -168,7 +168,7 @@
                     memset(p_result, 0, size);
                     unsigned int vold = lspace->alloced_size;
                     unsigned int vnew = vold + alloc_size;
-                    while( vold != atomic_cas32(&lspace->alloced_size, vnew, vold)
){
+                    while( vold != atomic_cas32((volatile unsigned int*)&lspace->alloced_size,
vnew, vold) ){
                         vold = lspace->alloced_size;
                         vnew = vold + alloc_size;
                     }
@@ -187,7 +187,7 @@
                     memset(p_result, 0, size);
                     unsigned int vold = lspace->alloced_size;
                     unsigned int vnew = vold + alloc_size;
-                    while( vold != atomic_cas32(&lspace->alloced_size, vnew, vold)
){
+                    while( vold != atomic_cas32((volatile unsigned int*)&lspace->alloced_size,
vnew, vold) ){
                         vold = lspace->alloced_size;
                         vnew = vold + alloc_size;
                     }

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?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp Tue Mar 20 04:13:49 2007
@@ -26,6 +26,7 @@
 
 unsigned int MINOR_COLLECTORS = 0;
 unsigned int MAJOR_COLLECTORS = 0;
+static volatile unsigned int live_collector_num = 0;
 
 void collector_restore_obj_info(Collector* collector)
 {
@@ -144,7 +145,10 @@
     
     /* waken up and check for new task */
     TaskType task_func = collector->task_func;
-    if(task_func == NULL) return 1;
+    if(task_func == NULL){
+      atomic_dec32(&live_collector_num);
+      return 1;
+    }
       
     task_func(collector);
 
@@ -176,9 +180,12 @@
 
 static void collector_terminate_thread(Collector* collector)
 {
+  assert(live_collector_num);
+  unsigned int old_live_collector_num = live_collector_num;
   collector->task_func = NULL; /* NULL to notify thread exit */
   notify_collector_to_work(collector);
-  vm_thread_yield(); /* give collector time to die */
+  while(old_live_collector_num == live_collector_num)
+    vm_thread_yield(); /* give collector time to die */
   
   delete collector->trace_stack;  
   return;
@@ -193,6 +200,7 @@
     STD_FREE(collector);
    
   }
+  assert(live_collector_num == 0);
   
   STD_FREE(gc->collectors);
   return;
@@ -227,7 +235,8 @@
     gc->collectors[i] = collector;
   }
 
-  gc->num_collectors = NUM_COLLECTORS? NUM_COLLECTORS:num_processors; 
+  gc->num_collectors = NUM_COLLECTORS? NUM_COLLECTORS:num_processors;
+  live_collector_num = gc->num_collectors;
 
   return;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.h Tue Mar 20 04:13:49
2007
@@ -51,7 +51,7 @@
   /* else, take the obj by setting the forwarding flag atomically 
      we don't put a simple bit in vt because we need compute obj size later. */
   REF target = compress_ref(p_targ_obj);
-  if (oi != (Obj_Info_Type)atomic_cas32(get_obj_info_addr(p_obj), ( ( (POINTER_SIZE_INT)target
|FORWARD_BIT)), oi)) {
+  if (oi != (Obj_Info_Type)atomic_cas32(get_obj_info_addr(p_obj), ( ( (unsigned int)target
|FORWARD_BIT)), oi)) {
     /* forwarded by other, we need unalloc the allocated obj. We may waste some space if
the allocation switched
        block. The remaining part of the switched block cannot be revivied for next allocation
of 
        object that has smaller size than this one. */

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp Tue Mar 20 04:13:49
2007
@@ -33,7 +33,7 @@
 struct GC_Gen;
 void gc_set_nos(GC_Gen* gc, Space* space);
 
-void fspace_initialize(GC* gc, void* start, unsigned int fspace_size, unsigned int commit_size)

+void fspace_initialize(GC* gc, void* start, POINTER_SIZE_INT fspace_size, POINTER_SIZE_INT
commit_size) 
 {    
   assert( (fspace_size%GC_BLOCK_SIZE_BYTES) == 0 );
   Fspace* fspace = (Fspace *)STD_MALLOC(sizeof(Fspace));

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h Tue Mar 20 04:13:49
2007
@@ -33,39 +33,9 @@
 /* boundary splitting fspace into forwarding part and remaining part */
 extern void* object_forwarding_boundary; 
 
-typedef struct Fspace {
-  /* <-- first couple of fields are overloaded as Space */
-  void* heap_start;
-  void* heap_end;
-  unsigned int reserved_heap_size;
-  unsigned int committed_heap_size;
-  unsigned int num_collections;
-  int64 time_collections;
-  float survive_ratio;
-  unsigned int collect_algorithm;
-  GC* gc;
-  Boolean move_object;
-  /*Size allocted after last collection. Not available in fspace now.*/
-  unsigned int alloced_size;
-  /*For_statistic: not available now for fspace*/  
-  unsigned int surviving_size;
-  /* END of Space --> */
+typedef Blocked_Space Fspace;
 
-  Block* blocks; /* short-cut for mpsace blockheader access, not mandatory */
-  
-  /* FIXME:: the block indices should be replaced with block header addresses */
-  unsigned int first_block_idx;
-  unsigned int ceiling_block_idx;
-  volatile unsigned int free_block_idx;
-  
-  unsigned int num_used_blocks;
-  unsigned int num_managed_blocks;
-  unsigned int num_total_blocks;
-  /* END of Blocked_Space --> */
-      
-} Fspace;
-
-void fspace_initialize(GC* gc, void* start, unsigned int fspace_size, unsigned int commit_size);
+void fspace_initialize(GC* gc, void* start, POINTER_SIZE_INT fspace_size, POINTER_SIZE_INT
commit_size);
 void fspace_destruct(Fspace *fspace);
 
 void* fspace_alloc(unsigned size, Allocator *allocator);

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h?view=diff&rev=520357&r1=520356&r2=520357
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/utils/bit_ops.h Tue Mar 20 04:13:49 2007
@@ -34,13 +34,21 @@
       :"=r"(bit_offset)
       :"m"(target_word)
     );
-#else /*WIN32 Platform*/
+#else /* Windows Platform*/
+#if defined(WIN32) && !defined(_WIN64)
     __asm{
       bsf eax, target_word
       mov bit_offset, eax
     }
+#else /* _WIN64 */
+    bit_offset = 0;
+    while( ! (target_word & ((POINTER_SIZE_INT)1 << bit_offset)) ){
+    	bit_offset++;
+    }
+#endif /* _WIN64 */
 #endif /* ifdef PLATFORM_POSIX else*/
 
+  assert(bit_offset < BITS_PER_WORD);
   return (unsigned int)bit_offset;
 
 }



Mime
View raw message