gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9584: When creating new functions on


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9584: When creating new functions only capture the current scope stack.
Date: Sat, 04 Oct 2008 19:43:32 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9584
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sat 2008-10-04 19:43:32 +0800
message:
  When creating new functions only capture the current scope stack.
modified:
  libcore/abc_function.h
  libcore/vm/Machine.cpp
=== modified file 'libcore/abc_function.h'
--- a/libcore/abc_function.h    2008-09-30 15:54:41 +0000
+++ b/libcore/abc_function.h    2008-10-04 11:43:32 +0000
@@ -28,6 +28,7 @@
 #include "asClass.h"
 #include "SafeStack.h"
 #include "as_object.h"
+#include "as_environment.h"
 
 namespace gnash {
 
@@ -51,7 +52,7 @@
 
        boost::uint32_t getMaxRegisters(){ return 
mMethodInfo->getMaxRegisters(); }
 
-       SafeStack<boost::intrusive_ptr<as_object> > mScopeStack;
+       as_environment::ScopeStack* mScopeStack;
 
 };
 

=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2008-09-30 15:54:41 +0000
+++ b/libcore/vm/Machine.cpp    2008-10-04 11:43:32 +0000
@@ -1023,7 +1023,7 @@
                abc_function* new_function = m->getPrototype();
                //TODO: SafeStack contains all the scope objects in for all 
functions in the call stack.
                //We should only copy the relevent scope objects to the 
function's scope stacks.
-               new_function->mScopeStack = mScopeStack;
+               new_function->mScopeStack = getScopeStack();
                push_stack(as_value(new_function));
                break;
        }
@@ -2639,15 +2639,15 @@
        for(unsigned int i=0;i<fn.nargs;i++){
                mRegisters[i+1] = fn.arg(i);
        }
+       //TODO:  There is probably a better way to do this.
+       if(mCurrentFunction->mScopeStack){
+               for(unsigned int 
i=0;i<mCurrentFunction->mScopeStack->size();++i){
+                       
push_scope_stack(as_value(mCurrentFunction->mScopeStack->at(i)));
+               }
+       }
        execute();
        mExitWithReturn = prev_ext;
        stream->seekTo(0);
-       
-//TODO:  There is probably a better way to do this.  Maybe we should remove 
the mScopeStack property
-//             of Machine and always have functions reference their own scope 
stack.
-       for(unsigned int i=0;i<mCurrentFunction->mScopeStack.size();++i){
-               push_scope_stack(mCurrentFunction->mScopeStack.top(i));
-       }
 
        return mGlobalReturn;
 }


reply via email to

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