gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11692: Move mark scanning of stack


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11692: Move mark scanning of stack and call stack where it belong (VM).
Date: Sun, 13 Dec 2009 23:08:27 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 11692
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Sun 2009-12-13 23:08:27 +0100
message:
  Move mark scanning of stack and call stack where it belong (VM).
  as_environment is only keeping aliases to those elements which are really
  owned by the VM ...
modified:
  libcore/as_environment.cpp
  libcore/vm/VM.cpp
=== modified file 'libcore/as_environment.cpp'
--- a/libcore/as_environment.cpp        2009-12-13 20:25:51 +0000
+++ b/libcore/as_environment.cpp        2009-12-13 22:08:27 +0000
@@ -985,23 +985,7 @@
     if (m_target) m_target->setReachable();
     if (_original_target) _original_target->setReachable();
 
-#ifdef ALLOW_GC_RUN_DURING_ACTIONS_EXECUTION
-    /// Mark all (including unreachable) stack elements
-    for (SafeStack<as_value>::StackSize i=0, n=_stack.totalSize(); i<n; ++i)
-    {
-        _stack.at(i).setReachable();
-    }
-
-    /// Mark call stack 
-    for (CallStack::size_type i=0, n=_localFrames.size(); i<n; ++i)
-    {
-        _localFrames[i].markReachableResources();
-    }
-
-#else
-    assert (_localFrames.empty());
-    assert (_stack.empty());
-#endif
+    // _localFrames and _stack are taken care of by VM
 
 }
 #endif // GNASH_USE_GC

=== modified file 'libcore/vm/VM.cpp'
--- a/libcore/vm/VM.cpp 2009-12-08 08:47:03 +0000
+++ b/libcore/vm/VM.cpp 2009-12-13 22:08:27 +0000
@@ -242,7 +242,6 @@
 void
 VM::markReachableResources() const
 {
-#ifdef GNASH_USE_GC
 
        _rootMovie.markReachableResources();
 
@@ -259,6 +258,23 @@
        }
 
     if (_shLib.get()) _shLib->markReachableResources();
+
+#ifdef ALLOW_GC_RUN_DURING_ACTIONS_EXECUTION
+    /// Mark all (including unreachable) stack elements
+    for (SafeStack<as_value>::StackSize i=0, n=_stack.totalSize(); i<n; ++i)
+    {
+        _stack.at(i).setReachable();
+    }
+
+    /// Mark call stack 
+    for (CallStack::size_type i=0, n=_callStack.size(); i<n; ++i)
+    {
+        _callStack[i].markReachableResources();
+    }
+
+#else
+    assert (_callStack.empty());
+    assert (_stack.totalSize() == 0);
 #endif
 
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]