harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjwashb...@apache.org
Subject svn commit: r454390 [2/2] - in /incubator/harmony/enhanced/drlvm/trunk: build/make/ build/make/components/ build/make/components/vm/ vm/gc/ vm/gc_cc/ vm/gc_cc/build/ vm/gc_cc/src/ vm/gc_gen/ vm/gc_gen/src/ vm/gc_gen/src/common/ vm/gc_gen/src/gen/ vm/gc...
Date Mon, 09 Oct 2006 14:18:31 GMT
Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_alloc.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,91 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "mspace_collect.h"
+
+static Boolean mspace_alloc_block(Mspace* mspace, Alloc_Context* alloc_ctx)
+{
+  int old_free_idx = mspace->free_block_idx;
+  int new_free_idx = old_free_idx+1;
+
+  Block_Info* curr_alloc_block = (Block_Info* )alloc_ctx->curr_alloc_block;
+  if(curr_alloc_block != NULL){ /* it is NULL at first time */
+    assert(curr_alloc_block->status == BLOCK_IN_USE);
+    curr_alloc_block->status = BLOCK_USED;
+    curr_alloc_block->block->free = alloc_ctx->free;
+  }
+
+  while( mspace_has_free_block(mspace)){
+    
+    unsigned int allocated_idx = atomic_cas32(&mspace->free_block_idx, new_free_idx, old_free_idx);
+      
+    if(allocated_idx != (POINTER_SIZE_INT)old_free_idx){
+      old_free_idx = mspace->free_block_idx;
+      new_free_idx = old_free_idx+1;
+      continue;
+    }
+  
+    Block_Info* curr_alloc_block = &(mspace->block_info[allocated_idx]);
+
+    assert(curr_alloc_block->status == BLOCK_FREE);
+    curr_alloc_block->status = BLOCK_IN_USE;
+    mspace->num_used_blocks++;
+
+    alloc_ctx->curr_alloc_block = curr_alloc_block; 
+    Block_Header* block = curr_alloc_block->block;
+    memset(block->free, 0, (unsigned int)block->ceiling - (unsigned int)block->free);
+    alloc_ctx->free = block->free;
+    alloc_ctx->ceiling = block->ceiling;
+    
+    return TRUE;
+  }
+  
+  /* FIXME:: collect Mspace if for mutator, else assert(0) */
+  assert(0);
+  return FALSE;
+  
+}
+
+struct GC_Gen;
+Space* gc_get_mos(GC_Gen* gc);
+void* mspace_alloc(unsigned int size, Alloc_Context* alloc_ctx)
+{
+  void *p_return = NULL;
+ 
+  Mspace* mspace = (Mspace*)gc_get_mos((GC_Gen*)alloc_ctx->gc);
+  
+  /* All chunks of data requested need to be multiples of GC_OBJECT_ALIGNMENT */
+  assert((size % GC_OBJECT_ALIGNMENT) == 0);
+  assert( size <= GC_OBJ_SIZE_THRESHOLD );
+
+  /* check if collector local alloc block is ok. If not, grab a new block */
+  p_return = thread_local_alloc(size, alloc_ctx);
+  if(p_return) return p_return;
+  
+  /* grab a new block */
+  Boolean ok = mspace_alloc_block(mspace, alloc_ctx);
+  assert(ok);
+  
+  p_return = thread_local_alloc(size, alloc_ctx);
+  assert(p_return);
+    
+  return p_return;
+}
+

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,332 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "mspace_collect.h"
+#include "../thread/collector.h"
+#include "../trace_forward/fspace.h"
+struct GC_Gen;
+Space* gc_get_nos(GC_Gen* gc);
+Space* gc_get_mos(GC_Gen* gc);
+Space* gc_get_los(GC_Gen* gc);
+
+void mspace_save_reloc(Mspace* mspace, Partial_Reveal_Object** p_ref)
+{
+  Block_Info* block_info = GC_BLOCK_INFO_ADDRESS(mspace, p_ref);
+  block_info->reloc_table->push_back(p_ref);
+  return;
+}
+
+void  mspace_update_reloc(Mspace* mspace)
+{
+  SlotVector* reloc_table;
+  /* update refs in mspace */
+  for(unsigned int i=0; i < mspace->num_used_blocks; i++){
+    Block_Info* block_info = &(mspace->block_info[i]);
+    reloc_table = block_info->reloc_table;
+    for(unsigned int j=0; j < reloc_table->size(); j++){
+      Partial_Reveal_Object** p_ref = (*reloc_table)[j];
+      Partial_Reveal_Object* p_target_obj = get_forwarding_pointer_in_obj_info(*p_ref);
+      *p_ref = p_target_obj;
+    }
+    reloc_table->clear();
+  }
+  
+  return;  
+}  
+
+Boolean mspace_mark_object(Mspace* mspace, Partial_Reveal_Object *p_obj)
+{  
+  obj_mark_in_vt(p_obj);
+
+  unsigned int obj_word_index = OBJECT_WORD_INDEX_TO_MARKBIT_TABLE(p_obj);
+  unsigned int obj_offset_in_word = OBJECT_WORD_OFFSET_IN_MARKBIT_TABLE(p_obj); 	
+	
+  unsigned int *p_word = &(GC_BLOCK_HEADER(p_obj)->mark_table[obj_word_index]);
+  unsigned int word_mask = (1<<obj_offset_in_word);
+	
+  unsigned int result = (*p_word)|word_mask;
+	
+  if( result==(*p_word) ) return FALSE;
+  
+  *p_word = result; 
+  
+   return TRUE;
+}
+
+Boolean mspace_object_is_marked(Partial_Reveal_Object *p_obj, Mspace* mspace)
+{
+  assert(p_obj);
+  
+#ifdef _DEBUG //TODO:: Cleanup
+  unsigned int obj_word_index = OBJECT_WORD_INDEX_TO_MARKBIT_TABLE(p_obj);
+  unsigned int obj_offset_in_word = OBJECT_WORD_OFFSET_IN_MARKBIT_TABLE(p_obj); 	
+	
+  unsigned int *p_word = &(GC_BLOCK_HEADER(p_obj)->mark_table[obj_word_index]);
+  unsigned int word_mask = (1<<obj_offset_in_word);
+	
+  unsigned int result = (*p_word)|word_mask;
+	
+  if( result==(*p_word) )
+    assert( obj_is_marked_in_vt(p_obj));
+  else 
+    assert(!obj_is_marked_in_vt(p_obj));
+    
+#endif
+
+  return (obj_is_marked_in_vt(p_obj));
+    
+}
+
+static Boolean mspace_compute_object_target(Mspace* mspace)
+{  
+  unsigned int target_blk_idx;
+  Block_Header* dest_block = mspace_get_first_target_block(mspace, &target_blk_idx);    
+
+  unsigned int compact_blk_idx;
+  Block_Header* curr_block = mspace_get_first_compact_block(mspace, &compact_blk_idx);
+
+  void* dest_addr = GC_BLOCK_BODY(dest_block);
+ 
+  while( curr_block ){
+    unsigned int mark_bit_idx;
+    Partial_Reveal_Object* p_obj = block_get_first_marked_object(curr_block, &mark_bit_idx);
+    
+    while( p_obj ){
+      assert( obj_is_marked_in_vt(p_obj));
+            
+      unsigned int obj_size = vm_object_size(p_obj);
+      
+      if( ((unsigned int)dest_addr + obj_size) > (unsigned int)GC_BLOCK_END(dest_block)){
+        dest_block->free = dest_addr;
+        dest_block = mspace_get_next_target_block(mspace, &target_blk_idx);
+        dest_addr = GC_BLOCK_BODY(dest_block);
+      }
+      assert(((unsigned int)dest_addr + obj_size) <= (unsigned int)GC_BLOCK_END(dest_block));
+      
+      Obj_Info_Type obj_info = get_obj_info(p_obj);
+      if( obj_info != 0 ) {
+        mspace->obj_info_map->insert(ObjectMap::value_type((Partial_Reveal_Object*)dest_addr, obj_info));
+      }
+      
+      //FIXME: should use alloc to handle alignment requirement
+      set_forwarding_pointer_in_obj_info(p_obj, dest_addr);
+
+      dest_addr = (void *) WORD_SIZE_ROUND_UP((unsigned int) dest_addr + obj_size);
+      p_obj = block_get_next_marked_object(curr_block, &mark_bit_idx);
+  
+    }
+    curr_block = mspace_get_next_compact_block(mspace, &compact_blk_idx);
+  }
+
+
+  mspace->free_block_idx = dest_block->block_idx+1;
+
+  /* fail to evacuate any room, FIXME:: do nothing at the moment */
+  if( mspace->free_block_idx == mspace->num_current_blocks) 
+    return FALSE;
+  
+  return TRUE;
+}   
+
+static Boolean fspace_compute_object_target(Collector* collector, Fspace* fspace)
+{  
+  Mspace* mspace = (Mspace*)collector->collect_space;
+  unsigned int target_blk_idx;
+  Block_Header* dest_block = mspace_get_first_block_for_nos(mspace, &target_blk_idx);    
+  void* dest_addr = GC_BLOCK_BODY(dest_block);
+
+  unsigned int* mark_table = fspace->mark_table;
+  unsigned int* table_end = (unsigned int*)((POINTER_SIZE_INT)mark_table + fspace->mark_table_size);
+  unsigned int* fspace_start = (unsigned int*)fspace->heap_start;
+  Partial_Reveal_Object* p_obj = NULL;
+    
+  unsigned j=0;
+  while( (mark_table + j) < table_end){
+    unsigned int markbits = *(mark_table+j);
+    if(!markbits){ j++; continue; }
+    unsigned int k=0;
+    while(k<32){
+      if( !(markbits& (1<<k)) ){ k++; continue;}
+      p_obj = (Partial_Reveal_Object*)(fspace_start + (j<<5) + k);
+      assert( obj_is_marked_in_vt(p_obj));
+      
+      unsigned int obj_size = vm_object_size(p_obj);
+
+      if( ((unsigned int)dest_addr + obj_size) > (unsigned int)GC_BLOCK_END(dest_block)){
+        dest_block->free = dest_addr;
+        dest_block = mspace_get_next_block_for_nos(mspace, &target_blk_idx);
+        
+        if(dest_block == NULL) return FALSE;
+        dest_addr = GC_BLOCK_BODY(dest_block);
+      }
+      assert(((unsigned int)dest_addr + obj_size) <= (unsigned int)GC_BLOCK_END(dest_block));
+      
+      Obj_Info_Type obj_info = get_obj_info(p_obj);
+      if( obj_info != 0 ) {
+        fspace->obj_info_map->insert(ObjectMap::value_type((Partial_Reveal_Object*)dest_addr, obj_info));
+      }
+      
+      //FIXME: should use alloc to handle alignment requirement
+      set_forwarding_pointer_in_obj_info(p_obj, dest_addr);
+
+      dest_addr = (void *) WORD_SIZE_ROUND_UP((unsigned int) dest_addr + obj_size);
+      
+      k++;
+    }   
+    j++;;
+  }
+
+  mspace->free_block_idx = dest_block->block_idx+1;
+  
+  return TRUE;
+}   
+
+static void update_relocated_refs(Collector* collector)
+{
+  GC_Gen* gc = (GC_Gen*)collector->gc;
+  Space* space;
+  space = gc_get_nos(gc);  space->update_reloc_func(space);
+  space = gc_get_mos(gc);  space->update_reloc_func(space);
+  space = gc_get_los(gc);  space->update_reloc_func(space);
+
+  gc_update_rootset((GC*)gc);  
+
+  space_update_remsets((Fspace*)gc_get_nos(gc));
+  
+  /* FIXME:: interior table */
+  return;
+}
+
+static void mspace_restore_obj_info(Mspace* mspace)
+{
+  ObjectMap* objmap = mspace->obj_info_map;
+  ObjectMap::iterator obj_iter;
+  for( obj_iter=objmap->begin(); obj_iter!=objmap->end(); obj_iter++){
+    Partial_Reveal_Object* p_target_obj = obj_iter->first;
+    Obj_Info_Type obj_info = obj_iter->second;
+    set_obj_info(p_target_obj, obj_info);     
+  }
+  objmap->clear();
+  return;  
+}
+
+static void restore_saved_obj_info(Collector* collector)
+{
+  GC_Gen* gc = (GC_Gen*)collector->gc;
+  Space* space;
+  space = gc_get_nos(gc);  fspace_restore_obj_info((Fspace*)space);
+  space = gc_get_mos(gc);  mspace_restore_obj_info((Mspace*)space);
+
+  return;
+}   
+
+static void reset_mspace_for_allocation(Mspace* mspace)
+{ 
+  unsigned int num_used = mspace->num_used_blocks;
+  unsigned int num_free = mspace->free_block_idx;
+  unsigned int index = num_used>num_free? num_used:num_free;
+  
+  for(unsigned int i=0; i < index; i++){
+    Block_Info* block_info = &(mspace->block_info[i]);
+    block_clear_markbits(block_info->block); /* only needed for i<num_used_blocks */
+    block_info->status = BLOCK_USED;
+
+    if(i >= mspace->free_block_idx){
+      block_info->status = BLOCK_FREE; 
+      block_info->block->free = GC_BLOCK_BODY(block_info->block);
+    }
+  }
+  mspace->num_used_blocks = mspace->free_block_idx;
+}
+
+#include "../verify/verify_live_heap.h"
+
+static void mspace_sliding_compact(Collector* collector, Mspace* mspace)
+{
+  unsigned int compact_blk_idx;
+  Block_Header* curr_block = mspace_get_first_compact_block(mspace, &compact_blk_idx);
+  
+  while( curr_block ){
+    unsigned int mark_bit_idx;
+    Partial_Reveal_Object* p_obj = block_get_first_marked_object(curr_block, &mark_bit_idx);
+    
+    while( p_obj ){
+      assert( obj_is_marked_in_vt(p_obj));
+      obj_unmark_in_vt(p_obj);
+      
+      unsigned int obj_size = vm_object_size(p_obj);
+      Partial_Reveal_Object *p_target_obj = get_forwarding_pointer_in_obj_info(p_obj);
+      if( p_obj != p_target_obj){
+        memmove(p_target_obj, p_obj, obj_size);
+
+        if (verify_live_heap)
+          /* we forwarded it, we need remember it for verification */
+          event_collector_move_obj(p_obj, p_target_obj, collector);
+      }
+     
+      set_obj_info(p_target_obj, 0);
+ 
+      p_obj = block_get_next_marked_object(curr_block, &mark_bit_idx);  
+    }
+        
+    curr_block = mspace_get_next_compact_block(mspace, &compact_blk_idx);
+  }
+
+  reset_mspace_for_allocation(mspace);
+  
+  return;
+} 
+
+static void mark_compact_mspace(Collector* collector) 
+{
+  /* Pass 1: mark all live objects in heap, and save all the outgoing pointers */
+  mark_scan_heap(collector);
+  
+  /* Pass 2: assign target addresses for all to-be-moved objects */
+  Boolean ok;
+  ok = mspace_compute_object_target((Mspace*)gc_get_mos((GC_Gen*)collector->gc)); 
+  assert(ok); /* free at least one block */
+
+  ok = fspace_compute_object_target(collector, (Fspace*)gc_get_nos((GC_Gen*)collector->gc)); 
+  assert(ok); /* FIXME:: throw out-of-memory exception if not ok */
+  
+  /* Pass 3: update all references whose objects are to be moved */  
+  update_relocated_refs(collector);
+    
+  /* Pass 4: do the compaction and reset blocks */  
+  mspace_sliding_compact(collector, (Mspace*)collector->collect_space);
+  GC_Gen* gc = (GC_Gen*)collector->gc;
+  fspace_copy_collect(collector, (Fspace*)gc_get_nos(gc));
+  
+  restore_saved_obj_info(collector);
+  
+  return;
+}
+
+void mspace_collection(Mspace* mspace) 
+{
+  mspace->num_collections++;
+
+  GC* gc = mspace->gc;  
+
+  collector_execute_task(gc, (TaskType)mark_compact_mspace, (Space*)mspace);
+  
+  return;  
+} 
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,148 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _MSC_COLLECT_H_
+#define _MSC_COLLECT_H_
+
+#include "mspace.h"
+
+inline Block_Header* mspace_get_first_block_for_nos(Mspace* mspace, unsigned int* target_blk_idx)
+{  
+  unsigned int index = mspace->free_block_idx;
+  *target_blk_idx = index;
+  return mspace->block_info[index].block;
+}
+
+inline Block_Header* mspace_get_next_block_for_nos(Mspace* mspace, unsigned int* target_blk_idx)
+{  
+  unsigned int index = *target_blk_idx;
+
+  *target_blk_idx = ++index;
+  
+  if( index >= mspace->num_current_blocks) return NULL;
+  
+  return mspace->block_info[index].block; 
+}
+
+inline void block_clear_markbits(Block_Header* block)
+{
+  unsigned int* mark_table = block->mark_table;
+  memset(mark_table, 0, MARKBIT_TABLE_SIZE_WORDS*BYTES_PER_WORD);
+  return;
+}
+
+inline Block_Header* mspace_get_first_compact_block(Mspace* mspace, unsigned int* compact_blk_idx)
+{  
+  assert( mspace->block_info[0].status != BLOCK_FREE );
+
+  *compact_blk_idx = 0;
+  return mspace->block_info[0].block;
+}
+
+inline Block_Header* mspace_get_next_compact_block(Mspace* mspace, unsigned int* compact_blk_idx)
+{  
+  unsigned int index = *compact_blk_idx;
+ 
+  if( ++index == mspace->num_used_blocks ) return NULL;
+
+  *compact_blk_idx = index;
+  assert( mspace->block_info[index].status != BLOCK_FREE );
+
+  return mspace->block_info[index].block; 
+}
+
+inline Block_Header* mspace_get_first_target_block(Mspace* mspace, unsigned int* target_blk_idx)
+{  
+  assert( mspace->block_info[0].status != BLOCK_FREE);
+
+  *target_blk_idx = 0;
+  return mspace->block_info[0].block;
+}
+
+inline Block_Header* mspace_get_next_target_block(Mspace* mspace, unsigned int* target_blk_idx)
+{  
+  unsigned int index = *target_blk_idx;
+
+  *target_blk_idx = ++index;
+  /* trick! free_block_idx is changed after computing target addresses */
+  assert( mspace->block_info[index].status != BLOCK_FREE && (index < mspace->free_block_idx));
+  
+  return mspace->block_info[index].block; 
+  
+}
+
+inline Partial_Reveal_Object* block_get_first_marked_object(Block_Header* block, unsigned int* mark_bit_idx)
+{
+  unsigned int* mark_table = block->mark_table;
+  unsigned int* table_end = mark_table + MARKBIT_TABLE_SIZE_WORDS;
+  
+  unsigned j=0;
+  unsigned int k=0;
+  while( (mark_table + j) < table_end){
+    unsigned int markbits = *(mark_table+j);
+    if(!markbits){ j++; continue; }
+    while(k<32){
+        if( !(markbits& (1<<k)) ){ k++; continue;}
+        unsigned int word_index = (j<<BIT_SHIFT_TO_BITS_PER_WORD) + k;
+        Partial_Reveal_Object* p_obj = (Partial_Reveal_Object*)((unsigned int*)GC_BLOCK_BODY(block) + word_index);
+        /* only valid before compaction: assert(obj_is_marked_in_vt(p_obj)); */
+        
+        *mark_bit_idx = word_index;
+      return p_obj;
+    }
+    j++;
+    k=0;
+  }          
+  *mark_bit_idx = 0;
+  return NULL;   
+}
+
+inline Partial_Reveal_Object* block_get_next_marked_object(Block_Header* block, unsigned int* mark_bit_idx)
+{
+  unsigned int* mark_table = block->mark_table;
+  unsigned int* table_end = mark_table + MARKBIT_TABLE_SIZE_WORDS;
+  unsigned int bit_index = *mark_bit_idx;
+  
+  unsigned int j = bit_index >> BIT_SHIFT_TO_BITS_PER_WORD;
+  unsigned int k = (bit_index & BIT_MASK_TO_BITS_PER_WORD) + 1;  
+     
+  while( (mark_table + j) < table_end){
+    unsigned int markbits = *(mark_table+j);
+    if(!markbits){ j++; continue; }
+    while(k<32){
+      if( !(markbits& (1<<k)) ){ k++; continue;}
+      
+      unsigned int word_index = (j<<BIT_SHIFT_TO_BITS_PER_WORD) + k;
+      Partial_Reveal_Object* p_obj = (Partial_Reveal_Object*)((unsigned int*)GC_BLOCK_BODY(block) + word_index);      
+      /* only valid before compaction: assert(obj_is_marked_in_vt(p_obj)); */
+      
+      *mark_bit_idx = word_index;
+      return p_obj;
+    }
+    j++;
+    k=0;
+  }        
+  
+  *mark_bit_idx = 0;
+  return NULL;   
+
+}
+
+#endif /* #ifndef _MSC_COLLECT_H_ */
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,147 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "lspace.h"
+
+void* los_boundary = NULL;
+struct GC_Gen;
+Space* gc_get_los(GC_Gen* gc);
+void gc_set_los(GC_Gen* gc, Space* lspace);
+void* lspace_alloc(unsigned int size, Alloc_Context *alloc_ctx)
+{  
+  Lspace* lspace = (Lspace*)gc_get_los((GC_Gen*)alloc_ctx->gc);
+  
+  unsigned int old_free = (unsigned int)lspace->alloc_free;
+  unsigned int new_free = old_free + size;
+
+  while(new_free <= (unsigned int)lspace->heap_end){
+    unsigned int temp = atomic_cas32((volatile unsigned int *)&lspace->alloc_free, new_free, old_free);
+    if (temp != old_free) {
+      old_free = (unsigned int)lspace->alloc_free;
+      new_free = old_free + size;
+      continue;
+    }
+    /* successfully allocate an object */
+    Partial_Reveal_Object* p_return_object = (Partial_Reveal_Object*)old_free;
+    lspace->alloc_free = (void*)new_free;
+
+    /* TODO: should moved to better location */
+    memset(p_return_object, 0, size);
+    
+    return (void*)old_free;
+  }
+
+  /* FIXME:: trigger collection */
+  assert(0);
+  return NULL;
+
+}
+
+void lspace_initialize(GC* gc, void* start, unsigned int lspace_size)
+{
+  Lspace* lspace = (Lspace*)STD_MALLOC( sizeof(Lspace));
+  assert(lspace);
+  memset(lspace, 0, sizeof(Lspace));
+  
+  void* reserved_base = start;
+  unsigned int committed_size = lspace_size >> 1;
+  int status = port_vmem_commit(&reserved_base, committed_size, gc->allocated_memory); 
+  assert(status == APR_SUCCESS && reserved_base == start);
+  
+  memset(reserved_base, 0, committed_size);
+  lspace->committed_heap_size = committed_size;
+  lspace->reserved_heap_size = lspace_size - committed_size;
+  lspace->heap_start = reserved_base;
+  lspace->heap_end = (void *)((unsigned int)reserved_base + committed_size);
+  lspace->alloc_free = reserved_base;
+  
+  unsigned int num_bits = lspace_size >> BIT_SHIFT_TO_KILO;
+  unsigned int num_words = (num_bits >> BIT_SHIFT_TO_BITS_PER_WORD)+1;
+  lspace->mark_table = (unsigned int*)STD_MALLOC( num_words*BYTES_PER_WORD );
+  memset(lspace->mark_table, 0, num_words*BYTES_PER_WORD);
+  
+  lspace->reloc_table = new SlotVector();
+  lspace->mark_object_func = lspace_mark_object;
+  lspace->save_reloc_func = lspace_save_reloc;
+  lspace->update_reloc_func = lspace_update_reloc;
+  
+  lspace->move_object = FALSE;
+  lspace->gc = gc;
+  gc_set_los((GC_Gen*)gc, (Space*)lspace);
+  
+  los_boundary = start;
+  
+  return;
+}
+
+void lspace_destruct(Lspace* lspace)
+{
+  //FIXME:: decommit lspace space
+  STD_FREE(lspace->mark_table);
+  STD_FREE(lspace);
+  lspace = NULL;
+  return;
+}
+
+void lspace_collection(Lspace* lspace)
+{
+  /* FIXME:: collection */
+  unsigned int used_size = (unsigned int)lspace->alloc_free - (unsigned int)lspace->heap_start;
+  memset(lspace->mark_table, 0, (used_size>>BIT_SHIFT_TO_KILO)>>BIT_SHIFT_TO_BITS_PER_BYTE );
+  
+  return;
+}
+
+Boolean lspace_mark_object(Lspace* lspace, Partial_Reveal_Object* p_obj)
+{
+  assert( obj_belongs_to_space(p_obj, (Space*)lspace));
+  unsigned int word_index = OBJECT_WORD_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj);
+  unsigned int bit_offset_in_word = OBJECT_WORD_OFFSET_IN_LSPACE_MARKBIT_TABLE(lspace, p_obj);
+ 
+  unsigned int* p_markbits = &(lspace->mark_table[word_index]);
+  unsigned int word_mask = (1<<bit_offset_in_word);
+	
+  unsigned int result = (*p_markbits)|word_mask;
+	
+  if( result==(*p_markbits) ) return FALSE;
+  
+  *p_markbits = result; 
+      
+  return TRUE;
+}
+
+void lspace_save_reloc(Lspace* lspace, Partial_Reveal_Object** p_ref)
+{
+  lspace->reloc_table->push_back(p_ref);
+}
+
+void lspace_update_reloc(Lspace* lspace)
+{
+  SlotVector* reloc_table;
+  
+  reloc_table = lspace->reloc_table;
+  for(unsigned int j=0; j < reloc_table->size(); j++){
+    Partial_Reveal_Object** p_ref = (*reloc_table)[j];
+    Partial_Reveal_Object* p_target_obj = get_forwarding_pointer_in_obj_info(*p_ref);
+    *p_ref = p_target_obj;
+  }
+  reloc_table->clear();
+  return;
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_sweep/lspace.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,77 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _LSPACE_H_
+#define _LSPACE_H_
+
+#include "../common/gc_common.h"
+#include "../thread/thread_alloc.h"
+
+typedef struct Lspace{
+  /* <-- first couple of fields are overloadded as Space */
+  void* heap_start;
+  void* heap_end;
+  unsigned int reserved_heap_size;
+  unsigned int committed_heap_size;
+  unsigned int num_collections;
+  GC* gc;
+  Boolean move_object;
+  Boolean (*mark_object_func)(Lspace* space, Partial_Reveal_Object* p_obj);
+  void (*save_reloc_func)(Lspace* space, Partial_Reveal_Object** p_ref);
+  void (*update_reloc_func)(Lspace* space);
+  /* END of Space --> */
+
+  void* alloc_free;
+    
+  unsigned int* mark_table;
+
+  /* support other space moving collection */
+  SlotVector* reloc_table;
+
+}Lspace;
+
+void lspace_initialize(GC* gc, void* reserved_base, unsigned int lspace_size);
+void lspace_destruct(Lspace* lspace);
+Managed_Object_Handle lspace_alloc(unsigned int size, Alloc_Context* alloc_ctx);
+void lspace_collection(Lspace* lspace);
+
+inline unsigned int lspace_free_memory_size(Lspace* lspace){ /* FIXME:: */ return 0; }
+
+/* The assumption is the offset below is always aligned at word size, because both numbers are aligned */
+#define ADDRESS_OFFSET_IN_LSPACE_BODY(lspace, p_obj) ((unsigned int)p_obj - (unsigned int)space_heap_start((Space*)lspace))
+#define OBJECT_BIT_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj)    (ADDRESS_OFFSET_IN_LSPACE_BODY(lspace, p_obj) >> BIT_SHIFT_TO_KILO)
+#define OBJECT_WORD_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj)   (OBJECT_BIT_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj) >> BIT_SHIFT_TO_BITS_PER_WORD)
+#define OBJECT_WORD_OFFSET_IN_LSPACE_MARKBIT_TABLE(lspace, p_obj)  (OBJECT_BIT_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj) & BIT_MASK_TO_BITS_PER_WORD)
+
+inline Boolean lspace_object_is_marked(Lspace* lspace, Partial_Reveal_Object* p_obj)
+{
+  assert( obj_belongs_to_space(p_obj, (Space*)lspace));
+  unsigned int word_index = OBJECT_WORD_INDEX_TO_LSPACE_MARKBIT_TABLE(lspace, p_obj);
+  unsigned int bit_offset_in_word = OBJECT_WORD_OFFSET_IN_LSPACE_MARKBIT_TABLE(lspace, p_obj);
+ 
+  unsigned int markbits = lspace->mark_table[word_index];
+  return markbits & (1<<bit_offset_in_word);
+}
+
+Boolean lspace_mark_object(Lspace* lspace, Partial_Reveal_Object* p_obj);
+void lspace_save_reloc(Lspace* space, Partial_Reveal_Object** p_ref);
+void lspace_update_reloc(Lspace* lspace);
+
+#endif /*_LSPACE_H_ */
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,196 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "open/vm_util.h"
+
+#include "collector.h"
+#include "../mark_compact/mspace.h"
+
+static void collector_reset_thread(Collector *collector) 
+{
+  collector->task_func = NULL;
+
+	vm_reset_event(collector->task_assigned_event);
+	vm_reset_event(collector->task_finished_event);
+	
+	alloc_context_reset((Alloc_Context*)collector);
+	
+	return;
+}
+
+static void wait_collector_to_finish(Collector *collector) 
+{
+	vm_wait_event(collector->task_finished_event);
+}
+
+static void notify_collector_to_work(Collector* collector)
+{
+	vm_set_event(collector->task_assigned_event);  
+}
+
+static void collector_wait_for_task(Collector *collector) 
+{
+	vm_wait_event(collector->task_assigned_event);
+}
+
+static void collector_notify_work_done(Collector *collector) 
+{
+	vm_set_event(collector->task_finished_event);
+}
+
+void gc_preprocess_collector(Collector*);
+void gc_postprocess_collector(Collector*);
+static void assign_collector_with_task(GC* gc, TaskType task_func, Space* space)
+{
+  unsigned int num_collectors_to_activate = gc->num_collectors;
+  for(unsigned int i=0; i<num_collectors_to_activate; i++)
+  {
+    Collector* collector = gc->collectors[i];
+    
+    gc_preprocess_collector(collector);
+    collector_reset_thread(collector);
+    collector->task_func = task_func;
+    collector->collect_space = space;
+    notify_collector_to_work(collector);
+  }
+  gc->num_active_collectors = num_collectors_to_activate;
+
+}
+
+static void wait_collection_finish(GC* gc)
+{
+  unsigned int num_active_collectors = gc->num_active_collectors;
+  for(unsigned int i=0; i<num_active_collectors; i++)
+  {
+    Collector* collector = gc->collectors[i];
+    wait_collector_to_finish(collector);
+    gc_postprocess_collector(collector);
+  }
+  gc->num_active_collectors = 0;
+
+}
+
+static int collector_thread_func(void *arg) 
+{
+	Collector *collector = (Collector *)arg;
+	assert(collector);
+	
+	while(true){
+		/* Waiting for newly assigned task */
+		collector_wait_for_task(collector);	
+		
+		/* waken up and check for new task */
+    TaskType task_func = collector->task_func;
+    if(task_func == NULL) return 1;
+      
+    task_func(collector);
+    
+		collector_notify_work_done(collector);
+	}
+
+	return 0;
+}
+
+static void collector_init_thread(Collector *collector) 
+{
+	collector->trace_stack = new TraceStack(); /* only for MINOR_COLLECTION */
+	collector->mark_stack = new MarkStack(); /* only for MAJOR_COLLECTION */
+
+	collector->last_cycle_remset = new RemslotSet();
+  collector->last_cycle_remset->reserve(GC_NUM_ROOTS_HINT);
+	collector->last_cycle_remset->clear();
+
+	collector->this_cycle_remset = new RemslotSet();
+  collector->this_cycle_remset->reserve(GC_NUM_ROOTS_HINT);
+	collector->this_cycle_remset->clear();
+
+	int status = vm_create_event(&collector->task_assigned_event,0,1);
+	assert(status == THREAD_OK);
+
+	status = vm_create_event(&collector->task_finished_event,0,1);
+	assert(status == THREAD_OK);
+
+	status = (unsigned int)vm_create_thread(NULL,
+                            			0, 0, 0,
+                            			collector_thread_func,
+                            			(void*)collector);
+
+	assert(status == THREAD_OK);
+	
+	return;
+}
+
+static void collector_terminate_thread(Collector* collector)
+{
+  collector->task_func = NULL; /* NULL to notify thread exit */
+	notify_collector_to_work(collector);
+  vm_thread_yield(); /* give collector time to die */
+  
+  delete collector->trace_stack;
+	delete collector->last_cycle_remset;
+	delete collector->this_cycle_remset;
+	
+	return;
+}
+
+void collector_destruct(GC* gc) 
+{
+  for(unsigned int i=0; i<gc->num_collectors; i++)
+  {
+    Collector* collector = gc->collectors[i];
+		collector_terminate_thread(collector);
+  	STD_FREE(collector);
+   
+  }
+  
+  STD_FREE(gc->collectors);
+  return;
+}
+
+struct GC_Gen;
+unsigned int gc_get_processor_num(GC_Gen*);
+void collector_initialize(GC* gc)
+{
+ 	unsigned int nthreads = gc_get_processor_num((GC_Gen*)gc);
+	
+	gc->num_collectors = 1; //FIXME:: nthreads;
+	gc->collectors = (Collector **) STD_MALLOC(sizeof(Collector *) * nthreads);	
+	assert(gc->collectors);
+
+	for (unsigned int i = 0; i < nthreads; i++) {
+		Collector* collector = (Collector *)STD_MALLOC(sizeof(Collector));
+		assert(collector);
+		
+		collector->gc = gc;
+		collector_init_thread(collector);
+		
+		gc->collectors[i] = collector;
+	}
+
+  return;
+}
+
+void collector_execute_task(GC* gc, TaskType task_func, Space* space)
+{
+  assign_collector_with_task(gc, task_func, space);
+  wait_collection_finish(gc);
+  
+  return;
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,59 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _COLLECTOR_H_
+#define _COLLECTOR_H_
+
+#include "../common/gc_common.h"
+
+typedef struct Collector{
+  /* <-- first couple of fields are overloaded as Alloc_Context */
+  void *free;
+  void *ceiling;
+  void *curr_alloc_block;
+  Space* alloc_space;
+  GC* gc;
+  VmThreadHandle thread_handle;   /* This thread; */
+  /* End of Alloc_Context --> */
+
+  Space* collect_space;
+  /* collector has remsets to remember those stored during copying */  
+  RemslotSet* last_cycle_remset;   /* remembered in last cycle, used in this cycle as roots */
+  RemslotSet* this_cycle_remset;   /* remembered in this cycle, will switch with last_remslot */
+
+  TraceStack *trace_stack;
+  MarkStack *mark_stack;
+  
+  VmEventHandle task_assigned_event;
+  VmEventHandle task_finished_event;
+  
+  void(*task_func)(void*) ;   /* current task */
+ 
+}Collector;
+
+void collector_destruct(GC* gc);
+void collector_initialize(GC* gc);
+void collector_reset(GC* gc);
+
+void collector_execute_task(GC* gc, TaskType task_func, Space* space);
+
+Partial_Reveal_Object* collector_forward_object(Collector* collector, Partial_Reveal_Object* p_obj);
+
+#endif //#ifndef _COLLECTOR_H_

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/collector_alloc.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,57 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "thread_alloc.h"
+
+void* mos_alloc(unsigned size, Alloc_Context *alloc_ctx);
+
+/* NOS forward obj to MOS in MINOR_COLLECTION */
+Partial_Reveal_Object* collector_forward_object(Collector* collector, Partial_Reveal_Object* p_obj)
+{
+  Partial_Reveal_VTable* vt = obj_get_vtraw(p_obj);
+
+  /* forwarded by somebody else */
+  if ((unsigned int)vt & FORWARDING_BIT_MASK){
+     assert(!obj_is_marked_in_vt(p_obj));
+     return NULL;
+  }
+    
+  /* 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. */
+  if ((unsigned int)vt != atomic_cas32((unsigned int*)obj_get_vtraw_addr(p_obj), ((unsigned int)vt|FORWARDING_BIT_MASK), (unsigned int)vt)) {
+    /* forwarded by other */
+    assert( obj_is_forwarded_in_vt(p_obj) && !obj_is_marked_in_vt(p_obj));
+    return NULL;
+  }
+
+  /* we hold the object, now forward it */
+  unsigned int size = vm_object_size(p_obj);
+  Partial_Reveal_Object* p_targ_obj = (Partial_Reveal_Object*)mos_alloc(size, (Alloc_Context*)collector);  
+  /* mos should always has enough space to hold nos during collection */
+  assert(p_targ_obj); 
+  memcpy(p_targ_obj, p_obj, size);
+
+  /* because p_obj has forwarding flag in its vt, we set it here */
+  obj_set_forwarding_pointer_in_vt(p_obj, p_targ_obj);
+  obj_set_vt(p_targ_obj, (Allocation_Handle)vt);
+  
+  return p_targ_obj;  
+ 
+}
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,85 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "mutator.h"
+#include "../trace_forward/fspace.h"
+
+struct GC_Gen;
+Space* gc_get_nos(GC_Gen* gc);
+void mutator_initialize(GC* gc, void *gc_information) 
+{
+  /* FIXME:: NOTE: gc_info is uncleared */
+  Mutator *mutator = (Mutator *) gc_information;
+  mutator->free = NULL;
+  mutator->ceiling = NULL;
+  mutator->curr_alloc_block = NULL;
+  mutator->alloc_space = gc_get_nos((GC_Gen*)gc);
+  mutator->gc = gc;
+  
+  assert(mutator->remslot == NULL);
+  mutator->remslot = new RemslotSet();
+  mutator->remslot->clear();
+    
+  assert(mutator->remobj == NULL);
+  mutator->remobj = new RemobjSet();
+  mutator->remobj->clear();
+
+  lock(gc->mutator_list_lock);     // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+
+  mutator->next = (Mutator *)gc->mutator_list;
+  gc->mutator_list = mutator;
+
+  unlock(gc->mutator_list_lock); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  
+  gc->num_mutators++;
+  return;
+}
+
+void mutator_destruct(GC* gc, void *gc_information)
+{
+
+  Mutator *mutator = (Mutator *)gc_information;
+
+  lock(gc->mutator_list_lock);     // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+
+  Fspace* fspace = (Fspace*)mutator->alloc_space;
+  fspace->remslot_sets->push_back(mutator->remslot);
+  mutator->remslot = NULL;
+  fspace->remobj_sets->push_back(mutator->remobj);
+  mutator->remobj = NULL;
+
+  volatile Mutator *temp = gc->mutator_list;
+  if (temp == mutator) {  /* it is at the head of the list */
+    gc->mutator_list = temp->next;
+  } else {
+    while (temp->next != mutator) {
+      temp = temp->next;
+      assert(temp);
+    }
+    temp->next = mutator->next;
+  }
+
+  unlock(gc->mutator_list_lock); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+  gc->num_mutators--;
+  return;
+}
+
+

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,46 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _MUTATOR_H_
+#define _MUTATOR_H_
+
+#include "../common/gc_common.h"
+
+/* Mutator thread local information for GC */
+typedef struct Mutator {
+  /* <-- first couple of fields are overloaded as Alloc_Context */
+	void*	free;
+	void*	ceiling;
+  void* curr_alloc_block;
+  Space* alloc_space;
+  GC* gc;
+  VmThreadHandle thread_handle;   /* This thread; */
+  /* END of Alloc_Context --> */
+  
+  RemslotSet *remslot;
+  RemobjSet *remobj;
+  Mutator *next;  /* The gc info area associated with the next active thread. */
+} Mutator;
+
+void mutator_initialize(GC* gc, void* tls_gc_info);
+void mutator_destruct(GC* gc, void* tls_gc_info); 
+void mutator_reset(GC *gc);
+
+#endif /*ifndef _MUTATOR_H_ */
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/mutator_alloc.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,64 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "thread_alloc.h"
+
+#include "../gen/gen.h"
+
+Managed_Object_Handle gc_alloc(unsigned size, Allocation_Handle ah, void *gc_tls) 
+{
+  Managed_Object_Handle p_obj = NULL;
+ 
+  /* All requests for space should be multiples of 4 (IA32) or 8(IPF) */
+  assert((size % GC_OBJECT_ALIGNMENT) == 0);
+  assert(gc_tls == vm_get_gc_thread_local());
+  assert(ah);
+
+  if ( size > GC_OBJ_SIZE_THRESHOLD )
+    p_obj = (Managed_Object_Handle)los_alloc(size, (Alloc_Context*)gc_tls);
+  else
+    p_obj = (Managed_Object_Handle)nos_alloc(size, (Alloc_Context*)gc_tls);
+  
+  assert(p_obj);
+  obj_set_vt((Partial_Reveal_Object*)p_obj, ah);
+    
+  return (Managed_Object_Handle)p_obj;
+}
+
+
+Managed_Object_Handle gc_alloc_fast (unsigned size, Allocation_Handle ah, void *gc_tls) 
+{
+  /* All requests for space should be multiples of 4 (IA32) or 8(IPF) */
+  assert((size % GC_OBJECT_ALIGNMENT) == 0);
+  assert(gc_tls == vm_get_gc_thread_local());
+  assert(ah);
+  
+  /* object shoud be handled specially */
+  if ( size > GC_OBJ_SIZE_THRESHOLD ) return NULL;
+  
+  /* Try to allocate an object from the current Thread Local Block */
+  Managed_Object_Handle p_obj = NULL;
+  p_obj = (Managed_Object_Handle)thread_local_alloc(size, (Alloc_Context*)gc_tls);
+  if(p_obj == NULL) return NULL;
+   
+  obj_set_vt((Partial_Reveal_Object*)p_obj, ah);
+  
+  return p_obj;
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/thread_alloc.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/thread_alloc.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/thread_alloc.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/thread/thread_alloc.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,57 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _THREAD_ALLOC_H_
+#define _THREAD_ALLOC_H_
+
+#include "../common/gc_common.h"
+
+typedef struct Alloc_Context{
+  void *free;
+  void *ceiling;
+  void *curr_alloc_block;
+  Space* alloc_space;
+  GC   *gc;
+  VmThreadHandle thread_handle;   /* This thread; */
+}Alloc_Context;
+
+inline Partial_Reveal_Object* thread_local_alloc(unsigned int size, Alloc_Context* alloc_ctx)
+{
+    Partial_Reveal_Object* p_return_obj=(Partial_Reveal_Object*)alloc_ctx->free;
+    unsigned int new_free = size+(unsigned int)p_return_obj;
+		    
+    if (new_free <= (unsigned int)alloc_ctx->ceiling){
+    	alloc_ctx->free=(void*)new_free;
+    	return p_return_obj;
+    }
+
+    return NULL;
+}
+
+inline void alloc_context_reset(Alloc_Context* alloc_ctx)
+{
+  alloc_ctx->free = NULL;
+  alloc_ctx->ceiling = NULL;
+  alloc_ctx->curr_alloc_block = NULL;
+  
+  return;
+}
+
+#endif /* #ifndef _THREAD_ALLOC_H_ */
\ No newline at end of file

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,179 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "platform.h"
+
+#include "fspace.h"
+
+float NURSERY_OBJECT_FORWARDING_RATIO = FORWARD_ALL;
+//float NURSERY_OBJECT_FORWARDING_RATIO = FORWARD_HALF;
+
+void* nos_boundary = null; /* this is only for speeding up write barrier */
+
+Boolean forward_first_half;;
+void* object_forwarding_boundary=NULL;
+
+
+void fspace_destruct(Fspace *fspace) 
+{
+  port_vmem_decommit(fspace->heap_start, fspace->committed_heap_size, fspace->gc->allocated_memory);
+  STD_FREE(fspace->mark_table);
+  STD_FREE(fspace);  
+ 
+}
+
+struct GC_Gen;
+void gc_set_nos(GC_Gen* gc, Space* space);
+void fspace_initialize(GC* gc, void* start, unsigned int fspace_size) 
+{    
+  assert( (fspace_size%GC_BLOCK_SIZE_BYTES) == 0 );
+  Fspace* fspace = (Fspace *)STD_MALLOC(sizeof(Fspace));
+  assert(fspace);
+  memset(fspace, 0, sizeof(Fspace));
+
+  void* reserved_base = start;
+  int status = port_vmem_commit(&reserved_base, fspace_size, gc->allocated_memory); 
+  assert(status == APR_SUCCESS && reserved_base == start);
+  
+  memset(reserved_base, 0, fspace_size);
+
+  fspace->block_size_bytes = GC_BLOCK_SIZE_BYTES;
+  fspace->committed_heap_size = fspace->reserved_heap_size = fspace_size;
+  
+  fspace->heap_start = (void *)start;
+  fspace->heap_end = (void *)((POINTER_SIZE_INT) start + fspace_size);
+
+  fspace->num_collections = 0;
+    
+  fspace->alloc_free = fspace->heap_start;
+  fspace->alloc_ceiling = fspace->heap_end;
+  forward_first_half = TRUE;
+  object_forwarding_boundary = (void *)((((POINTER_SIZE_INT)start + (unsigned int)(fspace_size*NURSERY_OBJECT_FORWARDING_RATIO))>>7)<<7);
+
+  /* mark_table: 1. MAJOR_COLLECTION mark and copy nursery, 2. MINOR_COLLECTION mark non-forwarded part */
+  fspace->mark_table_size = fspace_size>>5;
+  fspace->mark_table = (unsigned int*)STD_MALLOC(fspace->mark_table_size); 
+  fspace->mark_table_half_boundary = fspace->mark_table + (((unsigned int)(fspace_size*NURSERY_OBJECT_FORWARDING_RATIO))>>7);
+  memset(fspace->mark_table, 0, fspace->mark_table_size);
+
+  fspace->mark_object_func = fspace_mark_object;
+  fspace->save_reloc_func = fspace_save_reloc;
+  fspace->update_reloc_func = fspace_update_reloc;
+
+  fspace->remslot_sets = new std::vector<RemslotSet *>();
+  fspace->remobj_sets = new std::vector<RemobjSet *>();
+  fspace->rem_sets_lock = FREE_LOCK;
+
+  fspace->reloc_table = new SlotVector();
+  fspace->obj_info_map = new ObjectMap();
+
+  fspace->move_object = TRUE;
+  fspace->gc = gc;
+  gc_set_nos((GC_Gen*)gc, (Space*)fspace);
+
+  nos_boundary = fspace->heap_end;
+
+  return;
+}
+
+Boolean fspace_mark_object(Fspace* fspace, Partial_Reveal_Object *p_obj)
+{
+  assert(obj_belongs_to_space(p_obj, (Space*)fspace));
+  
+  //offset in byte
+  unsigned int offset = (POINTER_SIZE_INT)p_obj - (POINTER_SIZE_INT)fspace->heap_start; 
+  assert( ((offset>>2)<<2)==offset);
+  
+  offset >>= 2; //offset in word
+  unsigned int bit_off_in_word = offset - ((offset>>5)<<5);
+  unsigned int* pos = fspace->mark_table + (offset>>5);
+
+  if( NURSERY_OBJECT_FORWARDING_RATIO != FORWARD_ALL && fspace->gc->collect_kind != MAJOR_COLLECTION )
+    assert(forward_first_half?(pos >= fspace->mark_table_half_boundary):(pos<fspace->mark_table_half_boundary));
+  
+  unsigned int word = *pos;
+  unsigned int result = word | (1<<bit_off_in_word);
+  if(word == result) return FALSE;
+
+  *pos = result;
+  obj_mark_in_vt(p_obj);
+  
+  return TRUE;
+}
+
+void fspace_clear_mark_bits(Fspace* fspace)
+{
+  unsigned int* mark_table = fspace->mark_table;
+  unsigned int* fspace_marked_half = (unsigned int*)fspace->heap_start;
+  unsigned int* table_end = fspace->mark_table_half_boundary;
+  Partial_Reveal_Object* p_obj = NULL;
+  
+  if( forward_first_half ){
+    //forward frist half, so the second half is marked
+    table_end = (unsigned int*)((POINTER_SIZE_INT)mark_table + fspace->mark_table_size);
+    mark_table = fspace->mark_table_half_boundary; 
+    fspace_marked_half = (unsigned int*)object_forwarding_boundary;
+  }
+  
+  unsigned j=0;
+  while( (mark_table + j) < table_end){
+    unsigned int markbits = *(mark_table+j);
+    if(!markbits){ j++; continue; }
+    unsigned int k=0;
+    while(k<32){
+      if( !(markbits& (1<<k)) ){ k++; continue;}
+      p_obj = (Partial_Reveal_Object*)(fspace_marked_half + (j<<5) + k);
+      
+      Partial_Reveal_VTable* vt = obj_get_vtraw(p_obj);
+      Allocation_Handle ah = (Allocation_Handle)vt;
+      assert(!(ah & FORWARDING_BIT_MASK));
+      assert(ah & MARK_BIT_MASK);
+      
+      obj_unmark_in_vt(p_obj);
+      //*(mark_table+j) &= ~(1<<k); //we do it in chunck
+      
+      k++;
+    }   
+    j++;;
+  }
+
+  memset(mark_table, 0, (POINTER_SIZE_INT)table_end-(POINTER_SIZE_INT)mark_table);
+}
+ 
+void reset_fspace_for_allocation(Fspace* fspace)
+{ 
+  if( NURSERY_OBJECT_FORWARDING_RATIO == FORWARD_ALL ||
+            fspace->gc->collect_kind == MAJOR_COLLECTION ){
+    fspace->alloc_free = fspace->heap_start;
+    fspace->alloc_ceiling = fspace->heap_end;    
+    forward_first_half = TRUE; /* only useful for not-FORWARD_ALL*/
+  }else{    
+    if(forward_first_half){
+      fspace->alloc_free = fspace->heap_start;
+      fspace->alloc_ceiling = object_forwarding_boundary;
+    }else{
+      fspace->alloc_free = object_forwarding_boundary;
+      fspace->alloc_ceiling = fspace->heap_end;
+    }
+    forward_first_half = ~forward_first_half;
+    /* clear all the marking bits of the remaining objects in fspace */
+    fspace_clear_mark_bits(fspace); 
+  }
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,106 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _FROM_SPACE_H_
+#define _FROM_SPACE_H_
+
+#include "../thread/thread_alloc.h"
+
+/*
+ * In our Gen GC, not all live objects are copied to tspace space, the newer baby will
+ * still be preserved in  fspace, that means give them time to die.
+ */
+#define FORWARD_ALL 1.0
+#define FORWARD_HALF 0.5
+
+extern float NURSERY_OBJECT_FORWARDING_RATIO;
+extern Boolean forward_first_half;
+extern void* object_forwarding_boundary; //objects allocated before this boundary remain in fspace
+
+typedef struct Fspace {
+  /* <-- first couple of fields are overloadded as Space */
+  void* heap_start;
+  void* heap_end;
+  unsigned int reserved_heap_size;
+  unsigned int committed_heap_size;
+  unsigned int num_collections;
+  GC* gc;
+  Boolean move_object;
+  Boolean (*mark_object_func)(Fspace* space, Partial_Reveal_Object* p_obj);
+  void (*save_reloc_func)(Fspace* space, Partial_Reveal_Object** p_ref);
+  void (*update_reloc_func)(Fspace* space);
+  /* END of Space --> */
+    
+  /* places to start and stop alloc */
+  volatile void* alloc_free;
+  void* alloc_ceiling;
+    
+  unsigned int block_size_bytes;
+  
+  unsigned int* mark_table; //table to keep mark_bits of fspace
+  unsigned int mark_table_size;
+  unsigned int* mark_table_half_boundary;
+  
+  /* saved remsets of collectors */
+  /* saved remsets of exited mutators */
+  std::vector<RemslotSet *> *remslot_sets;
+  std::vector<RemobjSet *> *remobj_sets;
+  SpinLock rem_sets_lock;
+
+  /* support other space moving collection */
+  SlotVector* reloc_table;
+  ObjectMap*  obj_info_map; 
+  
+} Fspace;
+
+void fspace_initialize(GC* gc, void* start, unsigned int fspace_size);
+void fspace_destruct(Fspace *fspace);
+
+inline unsigned int fspace_free_memory_size(Fspace* fspace)
+{ return (unsigned int)fspace->alloc_ceiling - (unsigned int)fspace->alloc_free; }
+
+inline unsigned int fspace_used_memory_size(Fspace* fspace)
+{ return (unsigned int)fspace->alloc_free - (unsigned int)fspace->heap_start; }
+
+void* fspace_alloc(unsigned size, Alloc_Context *alloc_ctx);
+
+Boolean fspace_mark_object(Fspace* fspace, Partial_Reveal_Object *p_obj);
+void fspace_clear_mark_bits(Fspace* fspace);
+
+void fspace_save_reloc(Fspace* fspace, Partial_Reveal_Object** p_ref);
+void fspace_update_reloc(Fspace* fspace);
+void fspace_restore_obj_info(Fspace* fspace);
+void fspace_copy_collect(Collector* collector, Fspace* fspace); 
+void space_copy_remset_slots(Fspace* space, RootSet* copy_rootset);
+void space_update_remsets(Fspace* space);
+
+void fspace_collection(Fspace* fspace);
+void reset_fspace_for_allocation(Fspace* fspace);
+
+inline unsigned int fspace_allocated_size(Fspace* fspace)
+{ 
+  return (unsigned int)fspace->alloc_ceiling - (unsigned int)fspace->alloc_free;
+}
+  
+inline Boolean fspace_has_free_block(Fspace* fspace)
+{
+  return ((POINTER_SIZE_INT)fspace->alloc_free + fspace->block_size_bytes) <= (POINTER_SIZE_INT)fspace->alloc_ceiling;  
+}
+#endif // _FROM_SPACE_H_

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_alloc.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,85 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "fspace.h"
+
+static Boolean fspace_alloc_block(Fspace* fspace, Alloc_Context *alloc_ctx)
+{
+         
+  void* old_free_pos = (void*)fspace->alloc_free;
+  void* new_free_pos = (void*)((POINTER_SIZE_INT)old_free_pos + fspace->block_size_bytes);
+  while ( fspace_has_free_block(fspace) ){
+    /* There are enough space to hold a TLB in fspace, try to get it */
+    POINTER_SIZE_INT temp = atomic_cas32((volatile uint32 *)&fspace->alloc_free, \
+                            (POINTER_SIZE_INT)new_free_pos, (POINTER_SIZE_INT)old_free_pos);
+      
+    if(temp != (POINTER_SIZE_INT)old_free_pos){
+      old_free_pos = (void*)fspace->alloc_free;
+      new_free_pos = (void*)((POINTER_SIZE_INT)old_free_pos + fspace->block_size_bytes);
+      continue;
+    }
+    
+    alloc_ctx->free = (char*)old_free_pos;
+    alloc_ctx->ceiling = (char*)old_free_pos + fspace->block_size_bytes;
+    memset(old_free_pos, 0, fspace->block_size_bytes);
+    
+    return TRUE;
+  }
+  
+  return FALSE;      
+}
+/* FIXME:: the collection should be seperated from the alloation */
+struct GC_Gen;
+Space* gc_get_nos(GC_Gen* gc);
+void gc_gen_reclaim_heap(GC_Gen* gc, unsigned int cause);
+
+void* fspace_alloc(unsigned size, Alloc_Context *alloc_ctx) 
+{
+  void*  p_return = NULL;
+
+  /* First, try to allocate object from TLB (thread local block) */
+  p_return = thread_local_alloc(size, alloc_ctx);
+  if (p_return)  return p_return;
+  
+  /* grab another TLB */
+  Fspace* fspace = (Fspace*)alloc_ctx->alloc_space;
+
+retry_grab_block:
+  if ( !fspace_has_free_block(fspace)) {    /* can not get a new TLB, activate GC */ 
+    vm_gc_lock_enum();
+    /* after holding lock, try if other thread collected already */
+    if ( !fspace_has_free_block(fspace) ) {  
+      gc_gen_reclaim_heap((GC_Gen*)alloc_ctx->gc, GC_CAUSE_NOS_IS_FULL); 
+    }    
+    vm_gc_unlock_enum();  
+  }
+
+  Boolean ok = fspace_alloc_block(fspace, alloc_ctx);
+  if(ok){
+    p_return = thread_local_alloc(size, alloc_ctx);
+    assert(p_return);              
+    return p_return;
+  }
+
+  /* failed to get a TLB atomically */
+  goto retry_grab_block;
+  
+}
+

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_copy.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_copy.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_copy.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_copy.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,174 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "fspace.h"
+
+/* copying of fspace is only for MAJOR_COLLECTION */
+
+static void slot_update_to_forwarding_pointer(Partial_Reveal_Object **p_ref, Partial_Reveal_Object *p_obj)
+{
+  /* if obj is marked in MAJOR_COLLECTION, it is alive, and has forwarding pointer */
+  if(!obj_is_marked_in_vt(p_obj)) return;
+    
+  *p_ref = get_forwarding_pointer_in_obj_info(p_obj);  
+}
+
+static void object_update_slots(Fspace* space, Partial_Reveal_Object *p_obj) 
+{
+  if(obj_belongs_to_space(p_obj, (Space*)space)) return;
+  
+  if(!object_has_slots(p_obj)) return;
+
+  if(object_is_array(p_obj)){
+    assert(!obj_is_primitive_array(p_obj));
+
+    int32 array_length = vector_get_length((Vector_Handle) p_obj);
+    for (int i = 0; i < array_length; i++) {
+      Partial_Reveal_Object** p_ref = (Partial_Reveal_Object**)vector_get_element_address_ref((Vector_Handle) p_obj, i);
+      Partial_Reveal_Object* p_obj = *p_ref;
+      if(p_obj == NULL) continue;
+      if (obj_belongs_to_space(p_obj, (Space*)space)){
+        slot_update_to_forwarding_pointer(p_ref, p_obj);
+      }
+    }
+  }else{
+    int *offset_scanner = init_object_scanner(p_obj);
+    while (true) {
+      Partial_Reveal_Object** p_ref = (Partial_Reveal_Object**)offset_get_ref(offset_scanner, p_obj);
+      if (p_ref == NULL) break;
+      Partial_Reveal_Object* p_obj = *p_ref;
+      if(p_obj != NULL && obj_belongs_to_space(p_obj, (Space*)space)){
+        slot_update_to_forwarding_pointer(p_ref, p_obj);
+      }
+      offset_scanner = offset_next_ref(offset_scanner);
+    }
+  }
+}
+
+void space_update_remsets(Fspace* space)
+{
+  
+  for(unsigned int i=0; i< space->remslot_sets->size(); i++) {
+    RemslotSet* remslot = (*space->remslot_sets)[i];
+    for (unsigned int j = 0; j < remslot->size(); j++) {
+      Partial_Reveal_Object** p_ref = (*remslot)[j];
+      assert(p_ref);
+      Partial_Reveal_Object* p_obj = *p_ref;
+      if(p_obj == NULL) continue;  
+      if (obj_belongs_to_space(p_obj, (Space*)space)){
+        /* if obj is marked in MAJOR_COLLECTION, it is alive, and has forwarding pointer */
+        if(obj_is_marked_in_vt(p_obj)){
+          *p_ref = get_forwarding_pointer_in_obj_info(p_obj);
+        }
+      }
+    }
+    remslot->clear();
+  }
+  space->remslot_sets->clear();
+
+  for(unsigned int i=0; i<space->remobj_sets->size(); i++) {
+    RemobjSet *remobj = (*space->remobj_sets)[i];
+    for(unsigned int j=0; j<remobj->size(); j++) {
+      Partial_Reveal_Object *obj = (*remobj)[j];
+      object_update_slots(space, obj);
+    }
+    remobj->clear();
+  }
+  space->remobj_sets->clear();
+
+  return;
+
+}
+
+void fspace_save_reloc(Fspace* fspace, Partial_Reveal_Object** p_ref)
+{
+    fspace->reloc_table->push_back(p_ref);  
+}
+
+void fspace_update_reloc(Fspace* fspace)
+{
+  SlotVector* reloc_table;
+  
+  reloc_table = fspace->reloc_table;
+  for(unsigned int j=0; j < reloc_table->size(); j++){
+    Partial_Reveal_Object** p_ref = (*reloc_table)[j];
+    Partial_Reveal_Object* p_target_obj = get_forwarding_pointer_in_obj_info(*p_ref);
+    *p_ref = p_target_obj;
+  }
+  reloc_table->clear();
+  return;
+}
+
+void fspace_restore_obj_info(Fspace* fspace)
+{
+  ObjectMap* objmap = fspace->obj_info_map;
+  ObjectMap::iterator obj_iter;
+  for( obj_iter=objmap->begin(); obj_iter!=objmap->end(); obj_iter++){
+    Partial_Reveal_Object* p_target_obj = obj_iter->first;
+    Obj_Info_Type obj_info = obj_iter->second;
+    set_obj_info(p_target_obj, obj_info);     
+  }
+  objmap->clear();
+  return;  
+}
+
+#include "../verify/verify_live_heap.h"
+
+void fspace_copy_collect(Collector* collector, Fspace* fspace) 
+{  
+  unsigned int* mark_table = fspace->mark_table;
+  unsigned int* table_end = (unsigned int*)((POINTER_SIZE_INT)mark_table + fspace->mark_table_size);
+  unsigned int* fspace_start = (unsigned int*)fspace->heap_start;
+  Partial_Reveal_Object* p_obj = NULL;
+    
+  unsigned j=0;
+  while( (mark_table + j) < table_end){
+    unsigned int markbits = *(mark_table+j);
+    if(!markbits){ j++; continue; }
+    unsigned int k=0;
+    while(k<32){
+      if( !(markbits& (1<<k)) ){ k++; continue;}
+      p_obj = (Partial_Reveal_Object*)(fspace_start + (j<<5) + k);
+      assert(obj_is_marked_in_vt(p_obj));
+      obj_unmark_in_vt(p_obj);
+      Partial_Reveal_Object* p_target_obj = get_forwarding_pointer_in_obj_info(p_obj);
+      unsigned int obj_size = vm_object_size(p_obj);
+      memmove(p_target_obj, p_obj, obj_size);
+
+      if (verify_live_heap){
+          /* we forwarded it, we need remember it for verification */
+          event_collector_move_obj(p_obj, p_target_obj, collector);
+      }
+     
+      set_obj_info(p_target_obj, 0);
+ 
+      k++;
+    }   
+    j++;;
+  }
+
+  /* different from partial trace_forwarding, we clear the mark bits 
+    (both in vt and table) in this function */
+  memset(mark_table, 0, fspace->mark_table_size);  
+    
+  reset_fspace_for_allocation(fspace);  
+
+  return;
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,250 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "fspace.h"
+#include "../thread/collector.h"
+
+static Boolean fspace_object_to_be_forwarded(Partial_Reveal_Object *p_obj, Fspace *fspace)
+{
+  assert(obj_belongs_to_space(p_obj, (Space*)fspace));  
+  return forward_first_half? (p_obj < object_forwarding_boundary):(p_obj>=object_forwarding_boundary);
+}
+
+static void scan_slot(Collector* collector, Partial_Reveal_Object **p_ref) 
+{
+  Partial_Reveal_Object *p_obj = *p_ref;
+  TraceStack *ts = collector->trace_stack;
+
+  if (p_obj == NULL) return;  
+    
+  /* the slot can be in tspace or fspace, we don't care.
+     we care only if the reference in the slot is pointing to fspace */
+  if (obj_belongs_to_space(p_obj, collector->collect_space)) {
+    ts->push(p_ref);
+  } 
+
+  return;
+}
+
+static void scan_object(Collector* collector, Partial_Reveal_Object *p_obj) 
+{
+  if (!object_has_slots(p_obj)) return;
+  
+  void *slot;
+  
+  /* scan array object */
+  if (object_is_array(p_obj)) {
+    Partial_Reveal_Object* array = p_obj;
+    assert(!obj_is_primitive_array(array));
+    
+    int32 array_length = vector_get_length((Vector_Handle) array);
+    for (int i = 0; i < array_length; i++) {
+      slot = vector_get_element_address_ref((Vector_Handle) array, i);
+      scan_slot(collector, (Partial_Reveal_Object **)slot);
+    }   
+    return;
+  }
+
+  /* scan non-array object */
+  int *offset_scanner = init_object_scanner(p_obj);
+  while (true) {
+    slot = offset_get_ref(offset_scanner, p_obj);
+    if (slot == NULL) break;
+  
+    scan_slot(collector, (Partial_Reveal_Object **)slot);
+    offset_scanner = offset_next_ref(offset_scanner);
+  }
+
+  return;
+}
+
+/*  At this point, p_ref can be in anywhere like root, and other spaces,  
+ *  but *p_ref must be in fspace, since only slot which points to 
+ *  object in fspace could be added into TraceStack */
+#include "../verify/verify_live_heap.h"
+
+static void trace_object(Collector* collector, Partial_Reveal_Object **p_ref) 
+{
+  Space* space = collector->collect_space; 
+  Partial_Reveal_Object *p_obj = *p_ref;
+
+  assert(p_obj); 
+  assert(obj_belongs_to_space(p_obj, space));
+
+  /* Fastpath: object has already been forwarded, update the ref slot */
+  if(obj_is_forwarded_in_vt(p_obj)) {
+    assert(!obj_is_marked_in_vt(p_obj));
+    *p_ref = obj_get_forwarding_pointer_in_vt(p_obj);    
+    return;
+  }
+
+  /* only mark the objects that will remain in fspace */
+  if (!fspace_object_to_be_forwarded(p_obj, (Fspace*)space)) {
+    assert(!obj_is_forwarded_in_vt(p_obj));
+    /* this obj remains in fspace, remember its ref slot for next GC. */
+    if( !address_belongs_to_space(p_ref, space) ){
+      collector->this_cycle_remset->push_back(p_ref); 
+    }
+
+    if(!obj_is_marked_in_vt(p_obj)){ 
+      fspace_mark_object((Fspace*)space, p_obj); 
+      scan_object(collector, p_obj);
+    }
+    return;
+  }
+    
+  /* following is the logic for forwarding */  
+  Partial_Reveal_Object* p_target_obj = collector_forward_object(collector, p_obj);
+  
+  /* if it is forwarded by other already, it is ok */
+  if(!p_target_obj){
+    *p_ref = obj_get_forwarding_pointer_in_vt(p_obj);  
+     return;
+  }  
+  /* otherwise, we successfully forwarded */
+  *p_ref = p_target_obj;  
+
+  /* we forwarded it, we need remember it for verification. FIXME:: thread id */
+  if(verify_live_heap) {
+    event_collector_move_obj(p_obj, p_target_obj, collector);
+  }
+
+  scan_object(collector, p_target_obj); 
+  return;
+}
+
+/* trace the root references from root set and remember sets */
+void trace_root(Collector* collector, Partial_Reveal_Object **ref) 
+{   
+  assert(*ref); 
+  assert(obj_belongs_to_space(*ref, collector->collect_space));
+
+  TraceStack *ts = collector->trace_stack;   
+  ts->push(ref);
+
+  while(!ts->empty()) {
+    Partial_Reveal_Object **p_ref = ts->top();
+    ts->pop();
+    assert(p_ref);
+    trace_object(collector, p_ref);   
+  }
+}
+
+static void scan_object_slot(Collector* collector, Partial_Reveal_Object *p_obj) 
+{
+  Space* space = collector->collect_space;
+  
+  if ( obj_belongs_to_space(p_obj, space)) return;
+  
+  if (!object_has_slots(p_obj)) return;
+
+  if (object_is_array(p_obj)) {
+    assert(!obj_is_primitive_array(p_obj));
+
+    int32 array_length = vector_get_length((Vector_Handle) p_obj);
+    for (int i = 0; i < array_length; i++) {
+      Partial_Reveal_Object** slot = (Partial_Reveal_Object**)vector_get_element_address_ref((Vector_Handle) p_obj, i);
+      if (obj_belongs_to_space(*slot, space))
+        trace_root(collector, slot);
+    } 
+  } else {
+    int *offset_scanner = init_object_scanner(p_obj);
+    while (true) {
+      Partial_Reveal_Object** slot = (Partial_Reveal_Object**)offset_get_ref(offset_scanner, p_obj);
+      if (slot == NULL) break;
+      if ((*slot != NULL) && (obj_belongs_to_space(*slot, space)))
+        trace_root(collector, slot);
+
+      offset_scanner = offset_next_ref(offset_scanner);
+    }
+  }
+  return;
+}
+
+static void collector_scan_remsets(Collector* collector)
+{
+  Fspace* fspace = (Fspace*)collector->collect_space;
+  
+  HashSet remslot_hash;
+
+  /* find root slots saved by 1. active mutators, 2. exited mutators, 3. last cycle collectors */
+  for(unsigned int i=0; i< fspace->remslot_sets->size(); i++) {
+    RemslotSet* remslot = (*fspace->remslot_sets)[i];
+    for (unsigned int j = 0; j < remslot->size(); j++) {
+      Partial_Reveal_Object **ref = (*remslot)[j];
+      assert(ref);
+      if(*ref == NULL) continue;  
+      if (obj_belongs_to_space(*ref, (Space*)fspace)) {
+        if (remslot_hash.find(ref) == remslot_hash.end()) {
+          remslot_hash.insert(ref);
+          trace_root(collector, ref);
+        }
+      }
+    }
+    remslot->clear();  
+  }
+  fspace->remslot_sets->clear();
+
+  HashSet remobj_hash;
+
+  /* find root slots from the remobjs saved by 1. active mutators 2. exited mutators */
+  for(unsigned int i=0; i<fspace->remobj_sets->size(); i++) {
+    RemobjSet *remobj = (*fspace->remobj_sets)[i];
+    for(unsigned int j=0; j<remobj->size(); j++) {
+      Partial_Reveal_Object *obj = (*remobj)[j];
+      if (remobj_hash.find(obj) == remobj_hash.end()) {
+        remobj_hash.insert(obj);
+        scan_object_slot(collector, obj);
+      }
+    }
+    remobj->clear();
+  }
+  fspace->remobj_sets->clear();
+    
+  return;
+}
+
+static void trace_forward_fspace(Collector* collector) 
+{  
+  GC* gc = collector->gc;
+  Fspace* space = (Fspace*)collector->collect_space;
+  
+  /* FIXME:: Single-threaded trace-forwarding for fspace currently */
+
+  space->remslot_sets->push_back(gc->root_set);
+  collector_scan_remsets(collector);
+    
+  reset_fspace_for_allocation(space);  
+
+  return;
+  
+}
+
+/* world is stopped when starting fspace_collection */      
+void fspace_collection(Fspace *fspace)
+{
+  fspace->num_collections++;  
+  
+  GC* gc = fspace->gc;
+  
+  collector_execute_task(gc, (TaskType)trace_forward_fspace, (Space*)fspace);
+  
+  return; 
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.cpp Mon Oct  9 07:18:29 2006
@@ -0,0 +1,36 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#include "verify_live_heap.h"
+
+Boolean verify_live_heap;
+
+void gc_verify_heap(GC* gc, Boolean is_before_gc)
+{ return; }
+
+void gc_init_heap_verification(GC* gc)
+{ return; }
+
+void gc_terminate_heap_verification(GC* gc)
+{ return; }
+
+void event_collector_move_obj(Partial_Reveal_Object *p_old, Partial_Reveal_Object *p_new, Collector* collector)
+{ return; }
+

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.h?view=auto&rev=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/verify/verify_live_heap.h Mon Oct  9 07:18:29 2006
@@ -0,0 +1,32 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Xiao-Feng Li, 2006/10/05
+ */
+
+#ifndef _VERIFY_LIVE_HEAP_H_
+#define _VERIFY_LIVE_HEAP_H_
+
+#include "../common/gc_common.h"
+
+extern Boolean verify_live_heap;
+void gc_init_heap_verification(GC* gc);
+void gc_terminate_heap_verification(GC* gc);
+void event_collector_move_obj(Partial_Reveal_Object *p_old, Partial_Reveal_Object *p_new, Collector* collector);
+void gc_verify_heap(GC* gc, Boolean is_before_gc);
+
+#endif

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp?view=diff&rev=454390&r1=454389&r2=454390
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp Mon Oct  9 07:18:29 2006
@@ -150,7 +150,7 @@
 #define API_DLLA "hyluni"
 #define API_DLLB "hyarchive"
 
-#define GC_DLL "gc"
+#define GC_DLL "gc_cc"
 #define EM_DLL "em"
 
 /**



Mime
View raw message