Gnash
0.8.10
|
A CallFrame is an element of a CallStack. More...
#include <CallStack.h>
Public Types | |
typedef std::vector< as_value > | Registers |
Public Member Functions | |
CallFrame (UserFunction *func) | |
Construct a CallFrame for a specific UserFunction. | |
CallFrame (const CallFrame &other) | |
Copy constructor for containers. | |
CallFrame & | operator= (const CallFrame &other) |
Assignment operator for containers. | |
as_object & | locals () |
Access the local variables for this function call. | |
UserFunction & | function () |
Get the function for which this CallFrame provides a scope. | |
const as_value * | getLocalRegister (size_t i) const |
Get a specific register in this CallFrame. | |
void | setLocalRegister (size_t i, const as_value &val) |
Set a specific register in this CallFrame. | |
bool | hasRegisters () const |
Set the number of registers for this CallFrame. | |
void | markReachableResources () const |
Mark all reachable resources. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const CallFrame &) |
A CallFrame is an element of a CallStack.
A CallFrame exists for the duration of a UserFunction call. NativeFunctions have no call frame. The CallFrame provides space for local registers and local variables. These values are discarded when the CallFrame is destroyed at the end of a function call. It provides a scope for the function's execution.
typedef std::vector<as_value> gnash::CallFrame::Registers |
gnash::CallFrame::CallFrame | ( | UserFunction * | func | ) |
Construct a CallFrame for a specific UserFunction.
func | The UserFunction to create the CallFrame for. This must provide information about the amount of registers to allocate. |
References assert.
gnash::CallFrame::CallFrame | ( | const CallFrame & | other | ) | [inline] |
Copy constructor for containers.
UserFunction& gnash::CallFrame::function | ( | ) | [inline] |
Get the function for which this CallFrame provides a scope.
Referenced by gnash::ActionExec::ActionExec(), gnash::Function::call(), and gnash::Function2::call().
const as_value* gnash::CallFrame::getLocalRegister | ( | size_t | i | ) | const [inline] |
Get a specific register in this CallFrame.
i | The index of the register to return. |
References gnash::key::i.
Referenced by gnash::VM::getRegister().
bool gnash::CallFrame::hasRegisters | ( | ) | const [inline] |
Set the number of registers for this CallFrame.
The number of registers may only be set once! This is to ensure that pointers to the register values are always valid.
Referenced by gnash::VM::getRegister(), and gnash::VM::setRegister().
as_object& gnash::CallFrame::locals | ( | ) | [inline] |
Access the local variables for this function call.
Referenced by gnash::ActionExec::ActionExec(), gnash::declareLocal(), and gnash::setLocal().
void gnash::CallFrame::markReachableResources | ( | ) | const |
Mark all reachable resources.
Reachable resources would be registers and locals (expected to be empty?) and function.
References assert, gnash::GcResource::setReachable(), gnash::renderer::opengl::for_each(), and gnash::as_value::setReachable().
Assignment operator for containers.
void gnash::CallFrame::setLocalRegister | ( | size_t | i, |
const as_value & | val | ||
) |
Set a specific register in this CallFrame.
If the register doesn't exist, nothing happens.
i | The index of the register to set. |
val | The value to set the register to. |
References gnash::key::i, IF_VERBOSE_ACTION, and _.
Referenced by gnash::Function2::call(), and gnash::VM::setRegister().
std::ostream& operator<< | ( | std::ostream & | , |
const CallFrame & | |||
) | [friend] |