harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjwashb...@apache.org
Subject svn commit: r465102 - in /incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src: common/gc_for_vm.cpp common/interior_pointer.cpp common/interior_pointer.h mark_compact/mspace_collect.cpp trace_forward/fspace_forward.cpp
Date Tue, 17 Oct 2006 23:58:49 GMT
Author: wjwashburn
Date: Tue Oct 17 16:58:48 2006
New Revision: 465102

URL: http://svn.apache.org/viewvc?view=rev&rev=465102
Log:
HARMONY-1886, GCV5 interior pointer support.  This builds on both windows and linux.  Since
GCV5 is not part of smoke test, smoke test was not run to completion

Added:
    incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.h
Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp?view=diff&rev=465102&r1=465101&r2=465102
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_for_vm.cpp Tue Oct 17 16:58:48
2006
@@ -22,6 +22,8 @@
 
 #include "../gen/gen.h"
 
+#include "../common/interior_pointer.h"
+
 static GC* p_global_gc = NULL;
 
 void gc_init() 
@@ -108,4 +110,4 @@
 {  assert(0); return 0; }
 
 void gc_add_root_set_entry_interior_pointer (void **slot, int offset, Boolean is_pinned)

-{  assert(0); }
+{	add_root_set_entry_interior_pointer(slot, offset, is_pinned); }

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp?view=auto&rev=465102
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.cpp Tue Oct
17 16:58:48 2006
@@ -0,0 +1,49 @@
+
+#include "interior_pointer.h"
+void gc_add_root_set_entry(Managed_Object_Handle *ref, Boolean is_pinned);
+
+typedef struct slot_offset_entry_struct{
+	void** slot;
+	unsigned int offset;
+} slot_offset_entry;
+
+static std::vector<slot_offset_entry> interior_pointer_set;
+
+static const  int initial_vector_size = 100;
+static unsigned int interior_pointer_num_count = 0;
+
+
+void add_root_set_entry_interior_pointer(void **slot, int offset, Boolean is_pinned)
+{
+	//check size;
+	if( interior_pointer_set.size() == interior_pointer_num_count ) 
+	{
+		unsigned int size = interior_pointer_num_count == 0 ? initial_vector_size : interior_pointer_set.size()*2;
+		interior_pointer_set.resize(size);
+	}
+
+	Partial_Reveal_Object* p_obj = (Partial_Reveal_Object*) ((Byte*)*slot - offset);
+	assert(p_obj->vt_raw);
+	slot_offset_entry* push_back_entry = (slot_offset_entry*)&interior_pointer_set[interior_pointer_num_count++];
+	push_back_entry->offset = offset;
+	push_back_entry->slot   = slot;
+	*slot = p_obj;
+	gc_add_root_set_entry((Managed_Object_Handle*)slot, is_pinned);	
+}
+
+void update_rootset_interior_pointer()
+{
+	unsigned int i;
+	for( i = 0; i<interior_pointer_num_count; i++)
+	{
+		slot_offset_entry* entry_traverser = (slot_offset_entry*)&interior_pointer_set[i];
+		void** root_slot = entry_traverser->slot;
+		Partial_Reveal_Object* root_base = (Partial_Reveal_Object*)*root_slot;//entry_traverser->base;
+		unsigned int root_offset = entry_traverser->offset;
+		void *new_slot_contents = (void *)((Byte*)root_base + root_offset);	
+		*root_slot = new_slot_contents;
+	}
+	interior_pointer_set.clear();
+	assert(interior_pointer_set.size()==0);
+	interior_pointer_num_count = 0;
+}

Added: incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.h?view=auto&rev=465102
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.h (added)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/interior_pointer.h Tue Oct
17 16:58:48 2006
@@ -0,0 +1,9 @@
+#ifndef INTERIOR_POINTER_H
+#define INTERIOR_POINTER_H 
+
+#include "gc_common.h"
+
+void add_root_set_entry_interior_pointer(void **slot, int offset, Boolean is_pinned);
+void update_rootset_interior_pointer();
+
+#endif //INTERIOR_POINTER_H

Modified: 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=diff&rev=465102&r1=465101&r2=465102
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect.cpp Tue
Oct 17 16:58:48 2006
@@ -21,6 +21,7 @@
 #include "mspace_collect.h"
 #include "../thread/collector.h"
 #include "../trace_forward/fspace.h"
+#include "../common/interior_pointer.h"
 struct GC_Gen;
 Space* gc_get_nos(GC_Gen* gc);
 Space* gc_get_mos(GC_Gen* gc);
@@ -211,6 +212,7 @@
   space_update_remsets((Fspace*)gc_get_nos(gc));
   
   /* FIXME:: interior table */
+  update_rootset_interior_pointer();
   return;
 }
 
@@ -329,4 +331,4 @@
   collector_execute_task(gc, (TaskType)mark_compact_mspace, (Space*)mspace);
   
   return;  
-} 
\ No newline at end of file
+} 

Modified: 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=diff&rev=465102&r1=465101&r2=465102
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/trace_forward/fspace_forward.cpp
Tue Oct 17 16:58:48 2006
@@ -20,6 +20,7 @@
 
 #include "fspace.h"
 #include "../thread/collector.h"
+#include "../common/interior_pointer.h"
 
 static Boolean fspace_object_to_be_forwarded(Partial_Reveal_Object *p_obj, Fspace *fspace)
 {
@@ -221,6 +222,11 @@
   return;
 }
 
+static void update_relocated_refs(Collector* collector)
+{
+	update_rootset_interior_pointer();
+}
+
 static void trace_forward_fspace(Collector* collector) 
 {  
   GC* gc = collector->gc;
@@ -230,7 +236,7 @@
 
   space->remslot_sets->push_back(gc->root_set);
   collector_scan_remsets(collector);
-    
+  update_relocated_refs(collector);  
   reset_fspace_for_allocation(space);  
 
   return;



Mime
View raw message