20 #ifndef GNASH_MACHINE_H 21 #define GNASH_MACHINE_H 44 template <
typename T>
class FunctionArgs;
232 unsigned char stack_in,
short stack_out);
235 as_value& storage,
unsigned char stack_in,
short stack_out);
238 unsigned char stack_in,
short stack_out) {
239 immediateFunction(to_call, pthis, mIgnoreReturn, stack_in, stack_out);
242 void initMachine(
AbcBlock* pool_block);
246 void instantiateClass(std::string className,
as_object* global);
255 void markReachableResources()
const;
262 unsigned int _stackDepth;
263 unsigned int _stackTotalSize;
264 unsigned int _scopeStackDepth;
265 unsigned int mScopeTotalSize;
272 std::vector<as_value> _registers;
274 void to_debug_string(){
275 log_abc(
"StackDepth=%u StackTotalSize=%u ScopeStackDepth=%u ScopeTotalSize=%u",_stackDepth,_stackTotalSize,_scopeStackDepth,mScopeTotalSize);
283 unsigned int mHeightAfterPop;
286 Scope() : mHeightAfterPop(0), mScope(NULL) {}
287 Scope(
unsigned int i,
as_object *
o) : mHeightAfterPop(i),
299 void print_scope_stack();
303 void load_function(
CodeStream* stream, std::uint32_t maxRegisters);
307 void clearRegisters(std::uint32_t maxRegsiters);
309 const as_value& getRegister(
int index){
310 log_abc(
"Getting value at a register %d ", index);
311 return _registers[index];
314 void setRegister(
size_t index,
const as_value& val) {
315 log_abc(
"Putting %s in register %s", val, index);
316 if (_registers.size() <= index) {
317 log_abc(
"Register doesn't exist! Adding new registers!");
318 _registers.resize(index + 1);
320 _registers[index] = val;
324 log_abc(
"Pushing value %s onto stack.",
object);
330 log_abc(
"Popping value %s off the stack.", value);
334 void push_scope_stack(
as_value object);
337 log_abc(
"Popping value %s off the scope stack. There will be " 338 "%u items left.",
as_value(_scopeStack.top(0)),
339 _scopeStack.size()-1);
340 return _scopeStack.pop();
343 as_object* get_scope_stack(std::uint8_t depth)
const {
344 log_abc(
"Getting value from scope stack %u from the bottom.",
346 return _scopeStack.value(depth);
351 std::vector<as_value> _registers;
379 bool mExitWithReturn;
The ActionScript bytecode of a single ABC tag in a SWF.
Definition: AbcBlock.h:208
Definition: klash_part.cpp:329
Property * findProperty(MultiName &)
Definition: Machine.h:165
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
ActionScript value type.
Definition: as_value.h:94
An abstract property.
Definition: Property.h:276
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Represent an ActionScript Namespace.
Definition: Namespace.h:48
Definition: SafeStack.h:41
The base class for all ActionScript objects.
Definition: as_object.h:161
Definition: GnashKey.h:161
A general use string table.
Definition: string_table.h:41
as_value getMember(as_object &o, const ObjectURI &uri)
Get a member of an object using AS lookup rules.
Definition: as_object.h:756
Definition: CodeStream.h:40
A class to represent AS3 Classes.
Definition: Class.h:75
A class to contain transferable arguments for a fn_call.
Definition: as_function.h:30
void log_abc(StringType msg, Args... args)
Definition: log.h:337
void immediateProcedure(const as_function *to_call, as_object *pthis, unsigned char stack_in, short stack_out)
Definition: Machine.h:237
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:49
The virtual machine for executing ABC (ActionScript Bytecode).
Definition: Machine.h:73
The AVM1 virtual machine.
Definition: VM.h:71
Definition: GnashKey.h:155
An MultiName represents a single ABC multiname.
Definition: MultiName.h:51
ABC-defined Function.
Definition: abc_function.h:40
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:117
std::string name
Definition: LocalConnection_as.cpp:149
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:62