gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9509: Pass arguments to Machine when


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9509: Pass arguments to Machine when calling an ABC function.
Date: Fri, 22 Aug 2008 11:26:02 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9509
committer: Tom Stellard <address@hidden>
branch nick: gnash_traits
timestamp: Fri 2008-08-22 11:26:02 +0800
message:
  Pass arguments to Machine when calling an ABC function.
modified:
  libcore/abc_function.cpp
  libcore/vm/Machine.cpp
  libcore/vm/Machine.h
=== modified file 'libcore/abc_function.cpp'
--- a/libcore/abc_function.cpp  2008-08-19 17:04:30 +0000
+++ b/libcore/abc_function.cpp  2008-08-22 03:26:02 +0000
@@ -32,7 +32,7 @@
 abc_function::operator()(const fn_call& fn)
 {
        log_debug("Calling an abc_function.");
-       mMachine->executeFunction(mStream);
+       mMachine->executeFunction(mStream,fn);
        return as_value();
 }
 

=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2008-08-22 03:07:31 +0000
+++ b/libcore/vm/Machine.cpp    2008-08-22 03:26:02 +0000
@@ -2604,10 +2604,14 @@
 //This is called by abc_functions to execute their code stream.
 //TODO: There is probably a better way to do this, once we understand what the 
VM is supposed
 //todo, this should be fixed.
-void Machine::executeFunction(CodeStream* stream){
+void Machine::executeFunction(CodeStream* stream,const fn_call& fn){
        
        mExitWithReturn = true;
        load_function(stream);
+       mRegisters[0] = as_value(fn.this_ptr);
+       for(unsigned int i=0;i<fn.nargs;i++){
+               mRegisters[i+1] = fn.arg(i);
+       }
        execute();
        mExitWithReturn = false;
 }

=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h      2008-08-21 17:09:23 +0000
+++ b/libcore/vm/Machine.h      2008-08-22 03:26:02 +0000
@@ -206,7 +206,7 @@
 
        void initMachine(abc_block* pool_block,as_object* global);
 
-       void executeFunction(CodeStream* stream);
+       void executeFunction(CodeStream* stream,const fn_call& fn);
 
        void instantiateClass(std::string className);
 


reply via email to

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