Gnash
0.8.11dev
|
#include <Method.h>
Public Types | |
typedef std::list< Class * > | ArgumentList |
Public Member Functions | |
Method () | |
std::uint32_t | methodID () const |
void | setMethodID (std::uint32_t m) |
void | initPrototype (Machine *machine) |
std::uint32_t | getMaxRegisters () |
void | setMaxRegisters (std::uint32_t maxRegisters) |
std::uint32_t | getBodyLength () |
void | setBodyLength (std::uint32_t length) |
void | setMaxStack (std::uint32_t max) |
std::uint32_t | maxStack () const |
void | setMaxScope (std::uint32_t max) |
std::uint32_t | maxScope () const |
void | setScopeDepth (std::uint32_t depth) |
std::uint32_t | scopeDepth () const |
abc_function * | getPrototype () |
void | addTrait (const Trait &t) |
Add a Trait to this Method. More... | |
void | initTraits (AbcBlock &bl) |
Initialize Traits. This is bogus. More... | |
asBinding * | getBinding (string_table::key name) |
bool | isNative () |
bool | hasBody () const |
as_object * | construct (as_object *) |
bool | needsActivation () const |
void | setNeedsActivation () |
CodeStream * | getBody () |
void | setBody (CodeStream *b) |
bool | addValue (string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type, as_value &val, bool isconst) |
bool | addSlot (string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type) |
bool | addMethod (string_table::key name, Namespace *ns, Method *method) |
bool | addGetter (string_table::key name, Namespace *ns, Method *method) |
bool | addSetter (string_table::key name, Namespace *ns, Method *method) |
bool | addMemberScript (string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type) |
bool | addSlotFunction (string_table::key name, Namespace *ns, std::uint32_t slotID, Method *method) |
void | setOwner (Class *s) |
Set the owner of this method. More... | |
Class * | getReturnType () const |
Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic property.) Id reference: Type. More... | |
void | setReturnType (Class *t) |
Set the return type. More... | |
Method * | getSuper () |
void | setSuper (Method *s) |
bool | isFinal () const |
Is the method final? If so, it may not be overridden. More... | |
void | setFinal () |
Set the method as final. More... | |
void | unsetFinal () |
Unset the method as final. Not final anymore. More... | |
bool | isPrivate () const |
Is the method private? More... | |
void | setPrivate () |
Make the method private. More... | |
bool | isProtected () const |
Is the method protected? More... | |
void | setProtected () |
Make the method protected. More... | |
bool | isPublic () const |
Is the method public? More... | |
void | setPublic () |
Make the method public. More... | |
int | minArgumentCount () const |
How many arguments are required? -1 means unknown. More... | |
void | setMinArgumentCount (int i) |
Set the required minimum arguments. More... | |
int | maxArgumentCount () const |
How many arguments are allowed? -1 means unknown. More... | |
void | setMaxArgumentCount (int i) |
Set the required maximum arguments. More... | |
void | pushArgument (Class *t) |
Push an argument of type t into the method definition. More... | |
void | pushOptional (const as_value &v) |
Push an optional argument's default value. More... | |
bool | optionalArguments () const |
Are any of the arguments optional? More... | |
const ArgumentList & | getArgumentList () const |
Get a reference to a list of argument types. More... | |
as_function * | getImplementation () |
Get an object capable of executing this function. Note: This may be NULL, because we might have information about this function but not actually have it yet. More... | |
void | print_body () |
Print the opcodes that define a method using log_parse. More... | |
A class to represent, abstractly, an ActionScript method.
Methods are unnamed until they are bound to an object.
typedef std::list<Class*> gnash::abc::Method::ArgumentList |
gnash::abc::Method::Method | ( | ) |
bool gnash::abc::Method::addGetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method | ||
) |
bool gnash::abc::Method::addMemberScript | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type | ||
) |
References addSlot().
Referenced by gnash::abc::Trait::finalize_mbody().
bool gnash::abc::Method::addMethod | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method | ||
) |
Referenced by gnash::abc::Trait::finalize_mbody().
bool gnash::abc::Method::addSetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method | ||
) |
bool gnash::abc::Method::addSlot | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type | ||
) |
References gnash::PropFlags::dontDelete, gnash::abc::Namespace::getURI(), and gnash::as_object::init_member().
Referenced by addMemberScript().
bool gnash::abc::Method::addSlotFunction | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Method * | method | ||
) |
References gnash::key::a, addValue(), gnash::key::b, gnash::NSV::CLASS_FUNCTION, getPrototype(), and gnash::abc::Class::setName().
Referenced by gnash::abc::Trait::finalize_mbody().
|
inline |
bool gnash::abc::Method::addValue | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type, | ||
as_value & | val, | ||
bool | isconst | ||
) |
References gnash::PropFlags::dontDelete, gnash::key::g, gnash::get(), gnash::abc::Class::getName(), gnash::abc::Namespace::getURI(), gnash::as_object::init_member(), gnash::NSV::INTERNAL_TYPE, gnash::as_value::is_object(), gnash::PropFlags::readOnly, gnash::as_object::set_member(), gnash::as_value::to_object(), and test::uri.
Referenced by addSlotFunction(), and gnash::abc::Trait::finalize_mbody().
|
inline |
Get a reference to a list of argument types.
NB: Some values may be 0, meaning "any".
asBinding* gnash::abc::Method::getBinding | ( | string_table::key | name | ) |
|
inline |
|
inline |
|
inline |
Get an object capable of executing this function. Note: This may be NULL, because we might have information about this function but not actually have it yet.
References gnash::key::b.
|
inline |
|
inline |
Referenced by gnash::abc::Class::addGetter(), addGetter(), gnash::abc::Class::addSetter(), addSetter(), gnash::abc::Class::addSlotFunction(), addSlotFunction(), gnash::abc::Machine::execute(), gnash::abc::Machine::executeFunction(), gnash::abc::Machine::initMachine(), and gnash::abc::Machine::instantiateClass().
Class* gnash::abc::Method::getReturnType | ( | ) | const |
Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic property.) Id reference: Type.
Method* gnash::abc::Method::getSuper | ( | ) |
|
inline |
void gnash::abc::Method::initPrototype | ( | abc::Machine * | machine | ) |
Referenced by gnash::abc::AbcBlock::prepare().
void gnash::abc::Method::initTraits | ( | AbcBlock & | bl | ) |
Initialize Traits. This is bogus.
TODO: fix!
References gnash::key::_1, gnash::abc::Trait::finalize(), and gnash::renderer::opengl::for_each().
Referenced by gnash::abc::AbcBlock::prepare().
|
inline |
Is the method final? If so, it may not be overridden.
|
inline |
|
inline |
Is the method private?
|
inline |
Is the method protected?
|
inline |
Is the method public?
|
inline |
How many arguments are allowed? -1 means unknown.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::Machine::executeFunction().
|
inline |
Referenced by gnash::abc::Machine::executeFunction().
|
inline |
Referenced by gnash::abc::abc_function::call().
|
inline |
How many arguments are required? -1 means unknown.
|
inline |
Referenced by gnash::abc::abc_function::needsActivation().
|
inline |
Are any of the arguments optional?
void gnash::abc::Method::print_body | ( | ) |
Print the opcodes that define a method using log_parse.
References gnash::key::i, gnash::log_parse(), gnash::CodeStream::read_as3op(), and gnash::CodeStream::seekTo().
|
inline |
Push an argument of type t into the method definition.
A value of 0 stands for 'any'.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Push an optional argument's default value.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::Machine::executeFunction().
|
inline |
References gnash::key::b, gnash::key::s, and gnash::key::t.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
References length.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the method as final.
|
inline |
Set the required maximum arguments.
References gnash::key::i.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
References gnash::key::m.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the required minimum arguments.
References gnash::key::i.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
void gnash::abc::Method::setOwner | ( | Class * | s | ) |
Set the owner of this method.
References gnash::abc::Class::getPrototype(), gnash::log_debug(), gnash::NSV::PROP_PROTOTYPE, and gnash::as_object::set_member().
|
inline |
Make the method private.
|
inline |
Make the method protected.
|
inline |
Make the method public.
void gnash::abc::Method::setReturnType | ( | Class * | t | ) |
Set the return type.
TODO: This is currently a no-op, so find out what it's for and implement it. NB: the return type of a method can be * (any) or void, neither of which are known names, so this may not be an appropriate way to handle return type.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
void gnash::abc::Method::setSuper | ( | Method * | s | ) |
|
inline |
Unset the method as final. Not final anymore.