gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_function.cpp server/v...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog server/as_function.cpp server/v...
Date: Sat, 24 Mar 2007 11:35:02 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/03/24 11:35:02

Modified files:
        .              : ChangeLog 
        server         : as_function.cpp 
        server/vm      : fn_call.h 

Log message:
                * server/as_function.cpp: Partially revert changes related to 
fn_call
                which mysteriously broke the testsuite.
                * server/vm/fn_call.h: Make nargs non-const and add a setter 
for offset
                so as_function can modify them.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2679&r2=1.2680
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/fn_call.h?cvsroot=gnash&r1=1.5&r2=1.6

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2679
retrieving revision 1.2680
diff -u -b -r1.2679 -r1.2680
--- ChangeLog   23 Mar 2007 07:52:07 -0000      1.2679
+++ ChangeLog   24 Mar 2007 11:35:01 -0000      1.2680
@@ -1,3 +1,10 @@
+2007-03-24 Bastiaan Jacques <address@hidden>
+
+       * server/as_function.cpp: Partially revert changes related to fn_call
+       which mysteriously broke the testsuite.
+       * server/vm/fn_call.h: Make nargs non-const and add a setter for offset
+       so as_function can modify them.
+
 2007-03-23 Tomas Groth Christensen <address@hidden>
 
        * server/asobj/NetStreamFfmpeg.cpp: Fixed getting time when

Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- server/as_function.cpp      22 Mar 2007 22:37:45 -0000      1.27
+++ server/as_function.cpp      24 Mar 2007 11:35:02 -0000      1.28
@@ -187,9 +187,10 @@
        // Get function body 
        boost::intrusive_ptr<as_function> function_obj = 
ensureType<as_function>(fn.this_ptr);
 
-       unsigned int nargs = fn.nargs;
-       boost::intrusive_ptr<as_object> this_ptr = fn.this_ptr;
-       int offset = fn.offset();
+       // Copy new function call from old one, we'll modify 
+       // the copy only if needed
+       fn_call new_fn_call(fn);
+       new_fn_call.nargs=0; 
 
        if ( ! fn.nargs )
        {
@@ -200,12 +201,12 @@
        else
        {
                // Get the object to use as 'this' reference
-               this_ptr = fn.arg(0).to_object();
-               if (!this_ptr )
+               new_fn_call.this_ptr = fn.arg(0).to_object();
+               if (!new_fn_call.this_ptr )
                {
                        // ... or recycle this function's call 'this' pointer
                        // (most likely the Function instance)
-                       this_ptr = fn.this_ptr;
+                       new_fn_call.this_ptr = fn.this_ptr;
                }
 
                if ( fn.nargs > 1 )
@@ -261,15 +262,13 @@
                                pushed++;
                        }
 
-                       offset = fn.env().get_top_index();
-                       nargs=nelems;
+                       new_fn_call.set_offset(fn.env().get_top_index());
+                       new_fn_call.nargs=nelems;
                }
        }
 
        call_it:
 
-       fn_call new_fn_call(this_ptr, &fn.env(), nargs, offset);
-
        // Call the function 
        as_value rv = function_obj->call(new_fn_call);
 
@@ -288,29 +287,26 @@
 
        // Copy new function call from old one, we'll modify 
        // the copy only if needed
-
-       boost::intrusive_ptr<as_object> this_ptr = fn.this_ptr;
-       unsigned int nargs = fn.nargs;
-       int index = fn.offset();
+       fn_call new_fn_call(fn);
 
        if ( ! fn.nargs )
        {
                 dbglogfile << "Function.call() with no args" << endl;
+               new_fn_call.nargs=0;
        }
        else
        {
                // Get the object to use as 'this' reference
-               this_ptr = fn.arg(0).to_object();
-               nargs--;
-               index--;
+               boost::intrusive_ptr<as_object> this_ptr = 
fn.arg(0).to_object();
+               new_fn_call.this_ptr = this_ptr;
+               new_fn_call.nargs--;
+               new_fn_call.set_offset(new_fn_call.offset()-1);
        }
 
-       fn_call new_fn_call(this_ptr, &fn.env(), nargs, index);
-
        // Call the function 
        return (*function_obj)(new_fn_call);
 
-       //log_msg("at function_call exit, stack: \n"); fn.env().dump_stack();
+       //log_msg("at function_call exit, stack: \n"); fn.env->dump_stack();
 
        //log_msg("%s: tocheck \n", __FUNCTION__);
 }

Index: server/vm/fn_call.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/fn_call.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/vm/fn_call.h 22 Mar 2007 22:37:46 -0000      1.5
+++ server/vm/fn_call.h 24 Mar 2007 11:35:02 -0000      1.6
@@ -48,7 +48,7 @@
        boost::intrusive_ptr<as_object> this_ptr;
 
        /// Number of arguments to this ActionScript function call.
-       const unsigned int nargs;
+       unsigned int nargs;
 
 public:
        fn_call(as_object* this_in,
@@ -85,6 +85,11 @@
                return _stack_offset;
        }
 
+       void set_offset(int offset)
+       {
+               _stack_offset = offset;
+       }
+
        as_environment& env() const
        {
                return *_env;




reply via email to

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