gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...
Date: Fri, 16 Nov 2007 13:24:31 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/11/16 13:24:31

Modified files:
        .              : ChangeLog 
        server         : movie_root.cpp movie_root.h 
        server/vm      : ActionExec.cpp 
        testsuite/misc-swfc.all: action_execution_order_test12.sc 
                                 movieclip_destruction_test1.sc 

Log message:
        Process higher-priority action queues at end of every execution context.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4877&r2=1.4878
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.123&r2=1.124
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfc.all/action_execution_order_test12.sc?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfc.all/movieclip_destruction_test1.sc?cvsroot=gnash&r1=1.30&r2=1.31

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4877
retrieving revision 1.4878
diff -u -b -r1.4877 -r1.4878
--- ChangeLog   16 Nov 2007 09:45:53 -0000      1.4877
+++ ChangeLog   16 Nov 2007 13:24:29 -0000      1.4878
@@ -1,3 +1,14 @@
+2007-11-16 Sandro Santilli <address@hidden>
+
+       * server/movie_root.{cpp,h}: Add a flushHigherPriorityActionQueue
+         method to be called at the end of every action block execution
+         (including end of function calls).
+       * server/vm/ActionExec.cpp: flush higher priority actions at end
+         of execution.
+       * testsuite/misc-swfc.all/: action_execution_order_test12.sc,
+         movieclip_destruction_test1.sc: fixed two cases.
+
+
 2007-11-16 Zou Lunkai <address@hidden>
 
        * testsuite/misc-swfc.all/action_execution_order_test12.sc: add tests 

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- server/movie_root.cpp       16 Nov 2007 07:43:53 -0000      1.123
+++ server/movie_root.cpp       16 Nov 2007 13:24:30 -0000      1.124
@@ -1073,8 +1073,8 @@
        while ( ! q.empty() )
        {
                ExecutableCode* code = q.front();
-               code->execute();
                q.pop_front(); 
+               code->execute();
                delete code;
 
                int minLevel = minPopulatedPriorityQueue();
@@ -1101,6 +1101,25 @@
 }
 
 void
+movie_root::flushHigherPriorityActionQueues()
+{
+       if ( _disableScripts )
+       {
+               //log_debug(_("Scripts are disabled, global instance list has 
%d elements"), _liveChars.size());
+               /// cleanup anything pushed later..
+               clearActionQueue();
+               return;
+       }
+
+       int lvl=minPopulatedPriorityQueue();
+       while ( lvl<_processingActionLevel )
+       {
+               lvl = processActionQueue(lvl);
+       }
+
+}
+
+void
 movie_root::processActionQueue()
 {
        if ( _disableScripts )
@@ -1124,6 +1143,7 @@
 {
        assert(lvl >= 0 && lvl < apSIZE);
 
+#if 0
        // Immediately execute code targetted at a lower level while processing
        // an higher level.
        if ( processingActions() && lvl < _processingActionLevel )
@@ -1132,6 +1152,7 @@
                code->execute();
                return;
        }
+#endif
 
        _actionQueue[lvl].push_back(code.release());
 }
@@ -1146,6 +1167,7 @@
 
        std::auto_ptr<ExecutableCode> code ( new GlobalCode(buf, target) );
 
+#if 0
        // Immediately execute code targetted at a lower level while processing
        // an higher level.
        if ( processingActions() && lvl < _processingActionLevel )
@@ -1154,6 +1176,7 @@
                code->execute();
                return;
        }
+#endif
 
        _actionQueue[lvl].push_back(code.release());
 }
@@ -1168,6 +1191,7 @@
 
        std::auto_ptr<ExecutableCode> code ( new FunctionCode(func, target) );
 
+#if 0
        // Immediately execute code targetted at a lower level while processing
        // an higher level.
        if ( processingActions() && lvl < _processingActionLevel )
@@ -1176,6 +1200,8 @@
                code->execute();
                return;
        }
+#endif
+
        _actionQueue[lvl].push_back(code.release());
 }
 

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- server/movie_root.h 16 Nov 2007 07:43:53 -0000      1.88
+++ server/movie_root.h 16 Nov 2007 13:24:30 -0000      1.89
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: movie_root.h,v 1.88 2007/11/16 07:43:53 zoulunkai Exp $ */
+/* $Id: movie_root.h,v 1.89 2007/11/16 13:24:30 strk Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -547,10 +547,15 @@
     /// Return true if scripts execution is disabled
     bool scriptsDisabled() const { return _disableScripts; };
 
-    bool processingActions() const
-    {
-        return (_processingActionLevel < apSIZE);
-    }
+    /// Process action queues with higher priority then the priority
+    /// of the action queue currently being processed.
+    //
+    /// This is intended to be called at the end of any function call
+    /// and at the end of an action block.
+    ///
+    /// TODO: be aware of infinite loops !
+    ///
+    void flushHigherPriorityActionQueues();
 
 private:
 
@@ -769,6 +774,12 @@
     int processActionQueue(int lvl);
 
     int _processingActionLevel;
+
+    bool processingActions() const
+    {
+        return (_processingActionLevel < apSIZE);
+    }
+
 };
 
 

Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- server/vm/ActionExec.cpp    9 Oct 2007 08:12:26 -0000       1.57
+++ server/vm/ActionExec.cpp    16 Nov 2007 13:24:30 -0000      1.58
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: ActionExec.cpp,v 1.57 2007/10/09 08:12:26 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.58 2007/11/16 13:24:30 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -496,6 +496,9 @@
        env.drop(env.stack_size()-_initial_stack_size);
     }
 
+    // Have movie_root flush any newly pushed actions in higher priority queues
+    VM::get().getRoot().flushHigherPriorityActionQueues();
+
     //log_debug("After cleanup of ActionExec %p, env %p has stack size of %d 
and callStackDepth of %d", (void*)this, (void*)&env, env.stack_size(), 
env.callStackDepth());
 }
 

Index: testsuite/misc-swfc.all/action_execution_order_test12.sc
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-swfc.all/action_execution_order_test12.sc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/misc-swfc.all/action_execution_order_test12.sc    16 Nov 2007 
09:45:54 -0000      1.3
+++ testsuite/misc-swfc.all/action_execution_order_test12.sc    16 Nov 2007 
13:24:30 -0000      1.4
@@ -199,7 +199,7 @@
     
 .frame 11
     .action:
-        xcheck_equals(asOrder, '0+1+2+3+4+');
+        check_equals(asOrder, '0+1+2+3+4+');
     .end
 
 .frame 15

Index: testsuite/misc-swfc.all/movieclip_destruction_test1.sc
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-swfc.all/movieclip_destruction_test1.sc,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- testsuite/misc-swfc.all/movieclip_destruction_test1.sc      16 Nov 2007 
08:56:17 -0000      1.30
+++ testsuite/misc-swfc.all/movieclip_destruction_test1.sc      16 Nov 2007 
13:24:30 -0000      1.31
@@ -126,8 +126,9 @@
     .end
   
   .initaction mc3: // Add initactions for mc3(mc3 is not placed)
+     note("initaction mc3 in root frame4");
     _root.initActionExecuted += ", mc3";
-    _root.xcheck_equals(typeof(mc1), 'undefined'); // Gnash fails as it 
execute these immediately , so before mc1 is removed below
+    _root.check_equals(typeof(mc1), 'undefined'); 
     _root.check_equals(typeof(_root.getInstanceAtDepth(-16386)), 'undefined');
   .end
 
@@ -237,8 +238,8 @@
 
     // Due to a bug in the proprietary player, we need to trace(__proto__) to
     // force proper construction of the sprites.
-    _root.xcheck_equals(mc6.__proto__, Object.prototype); 
-    _root.xcheck_equals(mc7.__proto__, Object.prototype); 
+    _root.xcheck_equals(mc6.__proto__, Object.prototype); // returns wrong 
answer at first, gnash does the right thing here
+    _root.xcheck_equals(mc7.__proto__, Object.prototype); // returns wrong 
answer at first, gnash does the right thing here
     trace(mc6.__proto__); trace(mc7.__proto__);
     _root.check_equals(mc6.__proto__, MovieClip.prototype); 
     _root.check_equals(mc7.__proto__, MovieClip.prototype); 




reply via email to

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