Gnash  0.8.11dev
Public Types | Public Member Functions
gnash::Function2 Class Reference

Function2 adds extra sauce to ordinary Functions. More...

#include <Function2.h>

Inheritance diagram for gnash::Function2:
gnash::Function gnash::UserFunction gnash::as_function gnash::as_object gnash::GcResource

List of all members.

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 Types inherited from gnash::Function
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.
void setRegisterCount (boost::uint8_t ct)
void setFlags (boost::uint16_t flags)
virtual as_value call (const fn_call &fn)
 Dispatch.
- Public Member Functions inherited from gnash::Function
 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'.
virtual ~Function ()
const ScopeStackgetScopeStack () const
const action_buffergetActionBuffer () 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.
void setLength (size_t len)
 Set the length in bytes of the function code.
virtual void markReachableResources () const
 Mark reachable resources. Override from as_object.

Additional Inherited Members

- Protected Attributes inherited from gnash::Function
std::vector< Argument_args
as_environment_env
 @ might need some kind of ref count here, but beware cycles
const ConstantPool_pool
 The ConstantPool in effect at time of function definition.

Detailed Description

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.

Member Enumeration Documentation

Enumerator:
PRELOAD_THIS 

Bind one register to "this".

SUPPRESS_THIS 

No "this" variable accessible by name.

PRELOAD_ARGUMENTS 

Bind one register to "arguments".

SUPPRESS_ARGUMENTS 

No "argument" variable accessible by name.

PRELOAD_SUPER 

Bind one register to "super".

SUPPRESS_SUPER 

No "super" variable accessible by name.

PRELOAD_ROOT 

Bind one register to "_root".

PRELOAD_PARENT 

Bind one register to "_parent".

PRELOAD_GLOBAL 

Bind one register to "_global".


Constructor & Destructor Documentation

gnash::Function2::Function2 ( const action_buffer ab,
as_environment env,
size_t  start,
const ScopeStack with_stack 
)
virtual gnash::Function2::~Function2 ( )
inlinevirtual

Member Function Documentation

as_value gnash::Function2::call ( const fn_call fn)
virtual
virtual boost::uint8_t gnash::Function2::registers ( ) const
inlinevirtual

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

The documentation for this class was generated from the following files: