harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r519252 - /harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp
Date Sat, 17 Mar 2007 07:17:03 GMT
Author: xli
Date: Sat Mar 17 00:17:03 2007
New Revision: 519252

URL: http://svn.apache.org/viewvc?view=rev&rev=519252
Log:
H3417 - GCv5 64-bit support

Added:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp   (with props)

Added: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp?view=auto&rev=519252
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp (added)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp Sat Mar 17 00:17:03
2007
@@ -0,0 +1,72 @@
+/*
+ *  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, 2007/01/24
+ */
+
+#include "gc_common.h"
+#include "../utils/vector_block.h"
+#include "../utils/sync_pool.h"
+#include "../thread/collector.h"
+#include "../thread/mutator.h"
+#include "compressed_ref.h"
+
+typedef struct Uncompressed_Root{
+  Partial_Reveal_Object **p_ref;   /* pointing to the uncompressed address of the root object
*/
+  REF ref;  /* temporal compressed pointer pointing to the root object */
+}Compressed_Root;
+
+POINTER_SIZE_INT vtable_base = 0;
+POINTER_SIZE_INT HEAP_NULL = 0;
+
+void gc_set_uncompressed_rootset(GC *gc)
+{
+  Pool *rootset_pool = gc->metadata->gc_uncompressed_rootset_pool;
+  
+  pool_put_entry(rootset_pool, gc->uncompressed_root_set);
+  gc->uncompressed_root_set = NULL;
+  
+  pool_iterator_init(rootset_pool);
+  while(Vector_Block *root_set = pool_iterator_next(rootset_pool)){
+    POINTER_SIZE_INT *iter = vector_block_iterator_init(root_set);
+    for(; !vector_block_iterator_end(root_set, iter); iter = vector_block_iterator_advance(root_set,
iter)){
+      iter = vector_block_iterator_advance(root_set, iter);
+      assert(!vector_block_iterator_end(root_set, iter));
+      /* add the pointer to ref of Uncmpressed_Root to rootset */
+      gc_compressed_rootset_add_entry(gc, (REF *)iter);
+    }
+  }
+}
+
+void gc_fix_uncompressed_rootset(GC *gc)
+{
+  Pool *rootset_pool = gc->metadata->gc_uncompressed_rootset_pool;
+  
+  pool_iterator_init(rootset_pool);
+  while(Vector_Block *root_set = pool_iterator_next(rootset_pool)){
+    POINTER_SIZE_INT *iter = vector_block_iterator_init(root_set);
+    for(; !vector_block_iterator_end(root_set, iter); iter = vector_block_iterator_advance(root_set,
iter)){
+      Partial_Reveal_Object **p_ref = (Partial_Reveal_Object **)*iter;
+      iter = vector_block_iterator_advance(root_set, iter);
+      assert(!vector_block_iterator_end(root_set, iter));
+      REF ref = (REF)*iter;
+      Partial_Reveal_Object *p_obj = uncompress_ref(ref);
+      *p_ref = p_obj;
+    }
+  }
+}
+

Propchange: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/compressed_ref.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message