* src/vm/jit/replace.c (replace_gc_into_native): Implemented.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 28 Sep 2007 14:42:22 +0000 (16:42 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 28 Sep 2007 14:42:22 +0000 (16:42 +0200)
* src/mm/cacao-gc/rootset.c (rootset_writeback): Use above function.

src/mm/cacao-gc/rootset.c
src/vm/jit/replace.c

index edcd892ce0c09adc91d6b3e46788cd769d76aa8b..4dce00d9822d6eba5ebaf23b7fce29cd6ef3cc4e 100644 (file)
@@ -362,8 +362,6 @@ rootset_t *rootset_readout()
 void rootset_writeback(rootset_t *rs)
 {
        threadobject     *thread;
-       sourcestate_t    *ss;
-       executionstate_t *es;
 
        /* walk through all rootsets */
        while (rs) {
@@ -379,10 +377,8 @@ void rootset_writeback(rootset_t *rs)
                        GC_LOG( dolog("GC: Writing back Root-Set to single-thread ..."); );
 #endif
 
-                       /* now write back the modified sourcestate */
-                       ss = GC_SOURCESTATE;
-                       es = GC_EXECUTIONSTATE;
-                       replace_build_execution_state_intern(ss, es);
+                       /* now rebuild the stack of the thread */
+                       replace_gc_into_native(thread);
                }
 
                rs = rs->next;
index dc65d9afd3a532912bf9dcd0b45643d637d3d766..0770c6bb876ca771256489690a82ba6da7881629 100644 (file)
@@ -2986,6 +2986,21 @@ void replace_gc_from_native(threadobject *thread, u1 *pc, u1 *sp)
 }
 #endif
 
+#if defined(ENABLE_GC_CACAO)
+void replace_gc_into_native(threadobject *thread)
+{
+       executionstate_t *es;
+       sourcestate_t    *ss;
+
+       /* get the executionstate and sourcestate for the given thread */
+       es = GC_EXECUTIONSTATE;
+       ss = GC_SOURCESTATE;
+
+       /* rebuild the stack of the given thread */
+       replace_build_execution_state(ss, es);
+}
+#endif
+
 
 /******************************************************************************/
 /* NOTE: No important code below.                                             */