[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9493: Begin to implement calling an
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9493: Begin to implement calling an abc_function. |
Date: |
Tue, 19 Aug 2008 11:29:32 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9493
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Tue 2008-08-19 11:29:32 +0800
message:
Begin to implement calling an abc_function.
modified:
libcore/abc_function.cpp
libcore/abc_function.h
libcore/vm/Machine.cpp
=== modified file 'libcore/abc_function.cpp'
--- a/libcore/abc_function.cpp 2008-08-15 15:32:25 +0000
+++ b/libcore/abc_function.cpp 2008-08-19 03:29:32 +0000
@@ -21,14 +21,17 @@
namespace gnash{
-abc_function::abc_function(CodeStream* stream):as_function(){
+abc_function::abc_function(CodeStream* stream, Machine* machine):as_function(){
mStream = stream;
+ mMachine = machine;
}
// Dispatch.
as_value
abc_function::operator()(const fn_call& fn)
{
+ log_debug("Calling an abc_function.");
+ mMachine->executeCodeblock(mStream);
return as_value();
}
=== modified file 'libcore/abc_function.h'
--- a/libcore/abc_function.h 2008-08-15 15:32:25 +0000
+++ b/libcore/abc_function.h 2008-08-19 03:29:32 +0000
@@ -25,6 +25,7 @@
#include "as_function.h"
#include "as_value.h"
#include "CodeStream.h"
+#include "Machine.h"
namespace gnash {
@@ -34,11 +35,12 @@
private:
CodeStream* mStream;
+ Machine* mMachine;
public:
- abc_function(CodeStream* stream);
+ abc_function(CodeStream* stream, Machine* mMachine);
-as_value operator()(const fn_call& fn);
+ as_value operator()(const fn_call& fn);
};
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-08-17 17:30:57 +0000
+++ b/libcore/vm/Machine.cpp 2008-08-19 03:29:32 +0000
@@ -1032,7 +1032,7 @@
case SWF::ABC_ACTION_NEWFUNCTION:
{
asMethod *m = pool_method(mStream->read_V32(), mPoolObject);
- push_stack(as_value(new abc_function(m->getBody())));
+ push_stack(as_value(new abc_function(m->getBody(),this)));
break;
}
/// 0x41 ABC_ACTION_CALL
@@ -1390,7 +1390,7 @@
as_object* base_class = pop_stack().to_object().get();
as_object* new_class = new as_object();
//Create the class.
- abc_function* constructor = new
abc_function(c->getConstructor()->getBody());
+ abc_function* constructor = new
abc_function(c->getConstructor()->getBody(),this);
new_class->init_member(NSV::PROP_uuCONSTRUCTORuu,as_value(constructor),0);
push_stack(as_value(new_class));
@@ -2621,8 +2621,10 @@
}
void Machine::executeCodeblock(CodeStream* stream){
+ saveState();
mStream = stream;
execute();
+// restoreState();
}
void Machine::instantiateClass(std::string className){
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9493: Begin to implement calling an abc_function.,
Tom Stellard <=