Go to the documentation of this file.
19 #ifndef GNASH_SWF_FUNCTION_H
20 #define GNASH_SWF_FUNCTION_H
84 return _action_buffer;
std::vector< Argument > _args
Definition: Function.h:138
size_t size() const
Definition: action_buffer.h:65
as_object * super
The "super" object in this function call context.
Definition: fn_call.h:175
std::string name
Definition: LocalConnection_as.cpp:149
The base class for all ActionScript objects.
Definition: as_object.h:162
CallFrame & callFrame()
Get the CallFrame we've just pushed.
Definition: VM.h:329
@ i
Definition: GnashKey.h:155
void setLocal(CallFrame &c, const ObjectURI &name, const as_value &val)
Set a local variable in this CallFrame.
Definition: CallStack.cpp:80
A simple SWF-defined Function.
Definition: Function.h:64
ObjectURI name
Definition: Function.h:135
virtual ~Function()
Definition: Function.h:77
Provides information about timeline context.
Definition: as_environment.h:51
virtual as_value call(const fn_call &fn)
Dispatch.
Definition: Function.cpp:70
void init_member(const std::string &name, const as_value &val, int flags=DefaultFlags)
Initialize a member value by string.
Definition: as_object.cpp:669
The AVM1 virtual machine.
Definition: VM.h:72
@ PROP_CALLEE
Definition: namedStrings.h:64
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
@ PROP_SUPER
Definition: namedStrings.h:93
const as_environment & _env
Definition: Array_as.cpp:682
virtual std::uint8_t registers() const
Get the number of registers required for function execution.
Definition: Function.h:98
@ n
Definition: GnashKey.h:160
@ start
Definition: klash_part.cpp:330
Executor of an action_buffer.
Definition: ActionExec.h:119
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
@ PROP_PUSH
Definition: namedStrings.h:88
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:118
as_value callMethod(fn_call::Args &args, as_object *obj, const ObjectURI &uri)
Call a member function of this object in an AS-compatible way.
Definition: Global_as.h:219
@ r
Definition: GnashKey.h:164
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
A UserFunction is a callable function defined in ActionScript.
Definition: UserFunction.h:38
size_t getLength() const
Definition: Function.h:91
const ScopeStack & getScopeStack() const
Definition: Function.h:79
TargetGuard(as_environment &e, DisplayObject *ch, DisplayObject *och)
Definition: Function.cpp:50
void add_arg(std::uint8_t reg, const ObjectURI &name)
Add an expected argument for the function.
Definition: Function.h:112
std::uint8_t reg
Definition: Function.h:134
Function(const action_buffer &ab, as_environment &env, size_t start, ScopeStack with_stack)
Create an ActionScript function as defined in an action_buffer starting at offset 'start'.
Definition: Function.cpp:36
void setLength(size_t len)
Set the length in bytes of the function code.
Definition: Function.cpp:150
as_environment & _env
@ might need some kind of ref count here, but beware cycles
Definition: Function.h:141
std::vector< const char * > ConstantPool
An indexed list of strings (must match the definition in action_buffer.h)
Definition: ConstantPool.h:27
void set_original_target(DisplayObject *target)
Definition: as_environment.h:73
void markReachableResources() const
Mark all reachable resources.
Definition: as_environment.cpp:282
virtual void markReachableResources() const
Mark reachable resources. Override from as_object.
Definition: Function.cpp:157
Args::size_type nargs
Number of arguments to this ActionScript function call.
Definition: fn_call.h:178
DisplayObject * target() const
Definition: as_environment.h:61
bool calling() const
Whether a function call is in progress.
Definition: VM.h:240
std::vector< as_object * > ScopeStack
Definition: Function.h:68
Definition: Function.h:40
@ PROP_CALLER
Definition: namedStrings.h:65
ActionScript value type.
Definition: as_value.h:95
as_object * createArray()
Construct an Array.
Definition: Global_as.cpp:207
as_object * getArguments(Function &callee, as_object &args, const fn_call &fn, as_object *caller)
Add properties to an 'arguments' object.
Definition: Function.cpp:169
@ PROP_ARGUMENTS
Definition: namedStrings.h:60
size_t getStartPC() const
Definition: Function.h:87
const action_buffer & getActionBuffer() const
Definition: Function.h:83
UserFunction & function()
Get the function for which this CallFrame provides a scope.
Definition: CallStack.h:78
const Args::value_type & arg(unsigned int n) const
Access a particular argument.
Definition: fn_call.h:194
const ConstantPool * _pool
The ConstantPool in effect at time of function definition.
Definition: Function.h:144
VM & vm() const
Return a reference to this as_object's global object.
Definition: as_object.h:205
DisplayObject * get_original_target() const
Definition: as_environment.h:77
void set_target(DisplayObject *target)
Set default target for timeline opcodes.
Definition: as_environment.h:68
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
Definition: Function.h:132
virtual void markReachableResources() const
Mark all reachable resources, override from GcResource.
Definition: as_object.cpp:1011
Definition: ConstantPool.h:35
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
A code segment.
Definition: action_buffer.h:50
void declareLocal(CallFrame &c, const ObjectURI &name)
Declare a local variable in this CallFrame.
Definition: CallStack.cpp:71
A CallFrame is an element of a CallStack.
Definition: CallStack.h:44
~TargetGuard()
Definition: Function.cpp:62
Argument(std::uint8_t r, ObjectURI n)
Definition: Function.h:133
as_object * this_ptr
Definition: fn_call.h:170
A URI for describing as_objects.
Definition: ObjectURI.h:45
@ PROP_THIS
Definition: namedStrings.h:96
@ e
Definition: GnashKey.h:151
virtual as_object * get_super(const ObjectURI &fname)
Definition: as_object.cpp:445
CallFrame & currentCall()
Return the CallFrame of the currently executing function.
Definition: VM.cpp:229
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92