Gnash
0.8.11dev
|
Function2 adds extra sauce to ordinary Functions. More...
#include <Function2.h>
Public Types | |
enum | DefineFunction2Flags { PRELOAD_THIS = 0x01, SUPPRESS_THIS = 0x02, PRELOAD_ARGUMENTS = 0x04, SUPPRESS_ARGUMENTS = 0x08, PRELOAD_SUPER = 0x10, SUPPRESS_SUPER = 0x20, PRELOAD_ROOT = 0x40, PRELOAD_PARENT = 0x80, PRELOAD_GLOBAL = 256 } |
![]() | |
typedef std::vector< as_object * > | ScopeStack |
Public Member Functions | |
Function2 (const action_buffer &ab, as_environment &env, size_t start, const ScopeStack &with_stack) | |
virtual | ~Function2 () |
virtual boost::uint8_t | registers () const |
Return the number of registers to allocate for this function. More... | |
void | setRegisterCount (boost::uint8_t ct) |
void | setFlags (boost::uint16_t flags) |
virtual as_value | call (const fn_call &fn) |
Dispatch. More... | |
![]() | |
Function (const action_buffer &ab, as_environment &env, size_t start, const ScopeStack &with_stack) | |
Create an ActionScript function as defined in an action_buffer starting at offset 'start'. More... | |
virtual | ~Function () |
const ScopeStack & | getScopeStack () const |
const action_buffer & | getActionBuffer () const |
size_t | getStartPC () const |
size_t | getLength () const |
void | add_arg (boost::uint8_t reg, const ObjectURI &name) |
Add an expected argument for the function. More... | |
void | setLength (size_t len) |
Set the length in bytes of the function code. More... | |
virtual void | markReachableResources () const |
Mark reachable resources. Override from as_object. More... | |
Additional Inherited Members | |
![]() | |
static const int | DefaultFlags |
The most common flags for built-in properties. More... | |
![]() | |
UserFunction (Global_as &gl) | |
virtual | ~UserFunction ()=0 |
This is an abstract base class! More... | |
![]() | |
std::vector< Argument > | _args |
as_environment & | _env |
@ might need some kind of ref count here, but beware cycles More... | |
const ConstantPool * | _pool |
The ConstantPool in effect at time of function definition. More... | |
Function2 adds extra sauce to ordinary Functions.
The Function2 was introduced in version 6 of the player. Differences from ordinary functions are:
gnash::Function2::Function2 | ( | const action_buffer & | ab, |
as_environment & | env, | ||
size_t | start, | ||
const ScopeStack & | with_stack | ||
) |
|
inlinevirtual |
Dispatch.
This is only needed for SWF5 (temp switch of target) We do always and base 'target' value on SWF version. TODO: simplify code by maybe using a custom as_environment instead, so to get an "original" target being the one set now (rather then the really original one) TODO: test scope when calling functions defined in another timeline (target, in particular).
Reimplemented from gnash::Function.
References gnash::Function::_args, gnash::Function::_env, gnash::Function::_pool, gnash::fn_call::arg(), gnash::FrameGuard::callFrame(), gnash::VM::calling(), gnash::Global_as::createArray(), gnash::VM::currentCall(), gnash::declareLocal(), gnash::CallFrame::function(), gnash::as_environment::get_original_target(), gnash::as_object::get_super(), gnash::getArguments(), gnash::DisplayObject::getAsRoot(), gnash::VM::getGlobal(), gnash::getGlobal(), gnash::getObject(), gnash::getSWFVersion(), gnash::getVM(), gnash::key::i, gnash::key::n, gnash::fn_call::nargs, gnash::key::p, gnash::DisplayObject::parent(), PRELOAD_ARGUMENTS, PRELOAD_GLOBAL, PRELOAD_PARENT, PRELOAD_ROOT, PRELOAD_SUPER, PRELOAD_THIS, gnash::NSV::PROP_ARGUMENTS, gnash::NSV::PROP_SUPER, gnash::NSV::PROP_THIS, gnash::key::r, gnash::setLocal(), gnash::CallFrame::setLocalRegister(), gnash::fn_call::super, SUPPRESS_ARGUMENTS, SUPPRESS_SUPER, SUPPRESS_THIS, gnash::as_environment::target(), gnash::fn_call::this_ptr, and gnash::as_object::vm().
|
inlinevirtual |
Return the number of registers to allocate for this function.
Reimplemented from gnash::Function.
|
inline |
|
inline |