Gnash
0.8.10
|
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 } |
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. | |
void | setRegisterCount (boost::uint8_t ct) |
void | setFlags (boost::uint16_t flags) |
virtual as_value | call (const fn_call &fn) |
Dispatch. |
Function2 adds extra sauce to ordinary Functions.
The Function2 was introduced in version 6 of the player. Differences from ordinary functions are: 1. Up to 256 local registers. 2. Ability to suppress super, this, arguments 3. Ability to store super, this, arguments, _global, _root, and _parent in registers.
gnash::Function2::Function2 | ( | const action_buffer & | ab, |
as_environment & | env, | ||
size_t | start, | ||
const ScopeStack & | with_stack | ||
) |
virtual gnash::Function2::~Function2 | ( | ) | [inline, virtual] |
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::as_object::vm(), gnash::getVM(), gnash::VM::calling(), gnash::VM::currentCall(), gnash::CallFrame::function(), gnash::FrameGuard::callFrame(), gnash::Function::_env, gnash::as_environment::target(), gnash::as_environment::get_original_target(), gnash::getSWFVersion(), gnash::fn_call::this_ptr, gnash::Function::_pool, SUPPRESS_THIS, PRELOAD_THIS, gnash::CallFrame::setLocalRegister(), gnash::setLocal(), gnash::NSV::PROP_THIS, SUPPRESS_ARGUMENTS, PRELOAD_ARGUMENTS, gnash::getGlobal(), gnash::Global_as::createArray(), gnash::getArguments(), gnash::NSV::PROP_ARGUMENTS, SUPPRESS_SUPER, gnash::fn_call::super, gnash::as_object::get_super(), PRELOAD_SUPER, gnash::NSV::PROP_SUPER, PRELOAD_ROOT, gnash::key::r, gnash::getObject(), gnash::DisplayObject::getAsRoot(), PRELOAD_PARENT, gnash::key::p, gnash::DisplayObject::parent(), PRELOAD_GLOBAL, gnash::VM::getGlobal(), gnash::key::i, gnash::key::n, gnash::Function::_args, gnash::fn_call::nargs, gnash::fn_call::arg(), and gnash::declareLocal().
virtual boost::uint8_t gnash::Function2::registers | ( | ) | const [inline, virtual] |
Return the number of registers to allocate for this function.
Reimplemented from gnash::Function.
void gnash::Function2::setFlags | ( | boost::uint16_t | flags | ) | [inline] |
void gnash::Function2::setRegisterCount | ( | boost::uint8_t | ct | ) | [inline] |