19 #ifndef GNASH_ACTIONEXEC_H
20 #define GNASH_ACTIONEXEC_H
25 #include <boost/noncopyable.hpp>
53 TryBlock(
size_t cur_off,
size_t try_size,
size_t catch_size,
54 size_t finally_size, std::string catchName)
56 _catchOffset(cur_off + try_size),
57 _finallyOffset(cur_off + try_size + catch_size),
58 _afterTriedOffset(cur_off + try_size + catch_size + finally_size),
66 TryBlock(
size_t cur_off,
size_t try_size,
size_t catch_size,
67 size_t finally_size, boost::uint8_t register_index)
69 _catchOffset(cur_off + try_size),
70 _finallyOffset(cur_off + try_size + catch_size),
71 _afterTriedOffset(cur_off + try_size + catch_size + finally_size),
74 _registerIndex(register_index),
81 size_t _finallyOffset;
82 size_t _afterTriedOffset;
83 size_t _savedEndOffset;
86 unsigned int _registerIndex;
103 return _block_end_pc;
112 size_t _block_end_pc;
131 bool abortOnUnloaded =
true);
253 void dumpActions(
size_t start,
size_t end, std::ostream& os);
268 bool processExceptions(
TryBlock& t);
285 void cleanupAfterRun();
288 std::vector<With> _withStack;
291 ScopeStack _scopeStack;
307 size_t _initialStackSize;
311 int _origExecSWFVersion;
313 std::list<TryBlock> _tryList;
333 #endif // GNASH_ACTIONEXEC_H
bool pushWith(const With &entry)
Push an entry to the with stack.
Definition: ActionExec.cpp:592
as_object * object() const
Definition: ActionExec.h:106
void skip_actions(size_t offset)
Skip the specified number of action tags.
Definition: ActionExec.cpp:556
Definition: ActionExec.h:40
Definition: ActionExec.h:50
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
void pushTryBlock(TryBlock t)
Use this to push a try block. It will be copied.
Definition: ActionExec.cpp:651
const action_buffer & code
The actual action buffer.
Definition: ActionExec.h:151
as_value getVariable(const std::string &name, as_object **target=0)
Get a named variable, seeking for it in the with stack if any.
Definition: ActionExec.cpp:623
void operator()()
Execute.
Definition: ActionExec.cpp:127
Definition: klash_part.cpp:330
ActionScript value type.
Definition: as_value.h:95
bool isFunction() const
Is this execution thread a function call ?
Definition: ActionExec.h:160
void setVariable(const std::string &name, const as_value &val)
Set a named variable, seeking for it in the with stack if any.
Definition: ActionExec.cpp:617
as_object * getThisPointer()
Get the current 'this' pointer, for use in function calls.
Definition: ActionExec.cpp:708
void pushReturn(const as_value &t)
Set the return value.
Definition: ActionExec.cpp:661
A simple SWF-defined Function.
Definition: Function.h:63
ActionType
SWF action ids. Symbolic names copied from Ming.
Definition: SWF.h:124
The base class for all ActionScript objects.
Definition: as_object.h:161
ActionExec(const action_buffer &abuf, as_environment &newEnv, bool abortOnUnloaded=true)
Create an execution thread.
Definition: ActionExec.cpp:104
Definition: ActionExec.h:91
as_environment & env
TODO: provide a getter and make private ?
Definition: ActionExec.h:154
Provides information about timeline context.
Definition: as_environment.h:50
size_t getNextPC() const
Definition: ActionExec.h:232
tryState
Definition: ActionExec.h:45
Definition: GnashKey.h:166
size_t end_pc() const
Definition: ActionExec.h:102
Executor of an action_buffer.
Definition: ActionExec.h:116
void setNextPC(size_t pc)
Definition: ActionExec.h:234
const ScopeStack & getScopeStack() const
Returns the scope stack associated with this execution thread.
Definition: ActionExec.h:166
Definition: ActionExec.h:47
Definition: ActionExec.h:49
void adjustNextPC(int offset)
Definition: ActionExec.cpp:670
TryBlock(size_t cur_off, size_t try_size, size_t catch_size, size_t finally_size, std::string catchName)
Definition: ActionExec.h:53
void skipRemainingBuffer()
Definition: ActionExec.h:228
size_t getCurrentPC() const
Definition: ActionExec.h:226
Definition: ActionExec.h:48
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
TryBlock(size_t cur_off, size_t try_size, size_t catch_size, size_t finally_size, boost::uint8_t register_index)
Definition: ActionExec.h:66
as_value * retval
TODO: provide a setter and make private ?
Definition: ActionExec.h:157
as_object * getTarget()
Get current target.
Definition: ActionExec.cpp:642
A code segment.
Definition: action_buffer.h:49
void setLocalVariable(const std::string &name, const as_value &val)
Set a function-local variable.
Definition: ActionExec.cpp:629
const ObjectURI & _name
Definition: DisplayList.cpp:109
std::vector< as_object * > ScopeStack
A stack of objects used for variables/members lookup.
Definition: as_environment.h:55
bool atActionTag(SWF::ActionType t)
Definition: ActionExec.h:224
size_t getStopPC() const
Definition: ActionExec.h:236
std::string name
Definition: LocalConnection_as.cpp:151
With(as_object *obj, size_t end)
Definition: ActionExec.h:95
bool delVariable(const std::string &name)
Delete named variable, seeking for it in the with stack if any.
Definition: ActionExec.cpp:611