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),
67 TryBlock(
size_t cur_off,
size_t try_size,
size_t catch_size,
68 size_t finally_size, std::uint8_t register_index)
70 _catchOffset(cur_off + try_size),
71 _finallyOffset(cur_off + try_size + catch_size),
72 _afterTriedOffset(cur_off + try_size + catch_size + finally_size),
76 _registerIndex(register_index),
83 size_t _finallyOffset;
84 size_t _afterTriedOffset;
85 size_t _savedEndOffset;
88 unsigned int _registerIndex;
105 return _block_end_pc;
114 size_t _block_end_pc;
133 bool abortOnUnloaded =
true);
255 void dumpActions(
size_t start,
size_t end, std::ostream& os);
270 bool processExceptions(
TryBlock& t);
287 void cleanupAfterRun();
290 std::vector<With> _withStack;
293 ScopeStack _scopeStack;
309 size_t _initialStackSize;
313 int _origExecSWFVersion;
315 std::stack<TryBlock> _tryList;
335 #endif // GNASH_ACTIONEXEC_H
bool pushWith(const With &entry)
Push an entry to the with stack.
Definition: ActionExec.cpp:590
as_object * object() const
Definition: ActionExec.h:108
void skip_actions(size_t offset)
Skip the specified number of action tags.
Definition: ActionExec.cpp:554
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:649
const action_buffer & code
The actual action buffer.
Definition: ActionExec.h:153
void operator()()
Execute.
Definition: ActionExec.cpp:125
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:162
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:615
as_object * getThisPointer()
Get the current 'this' pointer, for use in function calls.
Definition: ActionExec.cpp:706
void pushReturn(const as_value &t)
Set the return value.
Definition: ActionExec.cpp:659
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
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:103
Definition: ActionExec.h:93
as_environment & env
TODO: provide a getter and make private ?
Definition: ActionExec.h:156
Provides information about timeline context.
Definition: as_environment.h:50
as_value getVariable(const std::string &name, as_object **target=nullptr)
Get a named variable, seeking for it in the with stack if any.
Definition: ActionExec.cpp:621
size_t getNextPC() const
Definition: ActionExec.h:234
tryState
Definition: ActionExec.h:45
Definition: GnashKey.h:166
size_t end_pc() const
Definition: ActionExec.h:104
Executor of an action_buffer.
Definition: ActionExec.h:118
void setNextPC(size_t pc)
Definition: ActionExec.h:236
const ScopeStack & getScopeStack() const
Returns the scope stack associated with this execution thread.
Definition: ActionExec.h:168
Definition: ActionExec.h:47
Definition: ActionExec.h:49
void adjustNextPC(int offset)
Definition: ActionExec.cpp:668
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:230
size_t getCurrentPC() const
Definition: ActionExec.h:228
TryBlock(size_t cur_off, size_t try_size, size_t catch_size, size_t finally_size, std::uint8_t register_index)
Definition: ActionExec.h:67
Definition: ActionExec.h:48
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
as_value * retval
TODO: provide a setter and make private ?
Definition: ActionExec.h:159
as_object * getTarget()
Get current target.
Definition: ActionExec.cpp:640
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:627
const ObjectURI & _name
Definition: DisplayList.cpp:111
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:226
size_t getStopPC() const
Definition: ActionExec.h:238
std::string name
Definition: LocalConnection_as.cpp:149
With(as_object *obj, size_t end)
Definition: ActionExec.h:97
bool delVariable(const std::string &name)
Delete named variable, seeking for it in the with stack if any.
Definition: ActionExec.cpp:609