If you are visually impaired or blind, you can visit the PDF version by Pressing CONTROL + ALT + 4
You need a JavaScript-enabled browser to view this Publication
Please follow these steps to view the Publication:
Enable JavaScript in your browser
Refresh this page
Best regards
Zmags
Adobe®
ActionScript Virtual Machine 2 (AVM2) Overview
May 2007
Copyright © 2006–2007 Adobe Systems Incorporated. All rights reserved.
NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic
form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior
written consent of Adobe Systems Incorporated.
Adobe, the Adobe Logo, and ActionScript, are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other
countries. All other trademarks are the property of their respective owners.
This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by
Adobe Systems Incorporated. Adobe Systems Incorporated assumes no resp
Adobe® ActionScript Virtual
Copyright © 2006–2007 Adobe Systems Incorporated.
Contents 1 Introduction...................
4.8.5 Method, getter, and setter t
1 Introduction The Adobe® ActionScript™ Virtual
Verification—The contents of an ABC file und
2 The structure of the ActionScript Virtual Mac
o The operand stack holds oper
RTQName should use. So when the RTQName is used,
use namespace t; trace(o[x]); This code will
If the closure is a method closure, then the firs
2.5.5 Object creation and manipulation instructio
2.5.10Debugging instructions Unlike many traditio
3 Loading, linking, verification, and executio
3.3 Execution This section describes the state
3.3.4 Execution mechanics Execution begins with t
• Some name fields (for example, instance_info
4 The ActionScript Byte Code (abc) format Sy
4.2 abcFile abcFile { u16 minor_version u16
method_body_count, method_body The valu
string_count, string The value of str
4.4.1 Namespace A namespace_info entry defines a
4.4.3 Multiname A multiname_info entry is a varia
RTQNameL The multiname_kind_RTQNameL format is u
array of the constant pool; the name at that entr
Each optional value consists of a kind field that
4.5.2 Parameter names The param_names entry is av
4.7 Instance The instance_info entry is used to
iinit This is an index into the method array of
4.8.2 Slot and const traits A kind value of Trait
4.8.4 Function traits A kind value of Trait_Funct
class_info { u30 cinit u30
method_body_info { u30 method
4.12 Exception The exception_info entry is used
5 AVM2 instructions The AVM2 instruction des
add Operation Add two values. Format add Form
add_i Operation Add two integer values. Format
astypelate Operation Return the same value, or n
bitnot Operation Bitwise not. Format bitnot F
bitxor Operation Bitwise exclusive or. Format b
callmethod Operation Call a method identified by
Description arg_count is a u30 that is the number
Runtime exceptions A TypeError is thrown if obj i
callstatic Operation Call a method identified by
Description arg_count is a u30 that is the number
Runtime exceptions A TypeError is thrown if recei
interfaces matches the type specified by the mult
construct Operation Construct an instance. Form
The property specified by the multiname at index
Description value is popped off of the stack and
convert_o Operation Convert a value to an Object
convert_s Operation Convert a value to a string.
When debug_type has a value of 1, this tells the
If the debugger is running, then this instruction
decrement Operation Decrement a value. Format d
deleteproperty Operation Delete a property. For
dup Operation Duplicates the top value on the st
dxnslate Operation Sets the default XML namespac
esc_xattr Operation Escape an xml attribute. Fo
findproperty Operation Search the scope stack fo
Description index is a u30 that must be an index
getglobalscope Operation Gets the global scope.
getlex Operation Find and get a property. Forma
getlocal_
Operation Get a local register. Fo
getscopeobject Operation Get a scope object. Fo
getsuper Operation Gets a property from a base c
greaterthan Operation Determine if one value is
hasnext2 Operation Determine if the given object
Format ifeq offset Forms ifeq = 19 (0x13)
Format ifge offset Forms ifge = 24 (0x18)
Format ifle offset Forms ifle = 22 (0x16)
Format ifnge offset Forms ifnge = 15 (0x0f)
undefined. In that case ifngt will branch (undefi
Compute value1 < value2 using the abstract relati
Description offset is an s24 that is the number o
in Operation Determine whether an object has a n
Format inclocal_i index Forms inclocal_i = 19
Description Pop value off of the stack. Convert v
Description Pop value and type off of the stack.
Description Compute the type of value, and let va
Notes This is usually used so that different jump
lessthan Operation Determine if one value is les
Notes Other control flow instructions take the ba
multiply Operation Multiply two values. Format
Forms negate = 144 (0x90) Stack …, value =>
newarray Operation Create a new array. Format n
newclass Operation Create a new class. Format n
newobject Operation Create a new object. Format
nextvalue Operation Get the name of the next pro
not Operation Boolean negation. Format not Fo
popscope Operation Pop a scope off of the scope
pushdouble Operation Push a double value onto th
pushint Operation Push an int value onto the sta
Stack … => …, NaN Description Push the value Na
pushshort Operation Push a short value. Format
pushtrue Operation Push true.
pushundefined Operation Push un
returnvalue Operation Return a value from a meth
rshift Operation Signed bitwise right shift. Fo
setlocal_
Operation Set a local register. Fo
setproperty Operation Set a property. Format se
This will set the value stored in the slot at slo
Format strictequals Forms strictequals = 172
Format subtract_i Forms subtract_i = 198 (0x
When a throw is executed, the current method’s ex
Format urshift Forms urshift = 167 (0xa7)
6 Hints for compiler writers The following te
pushshort 0 se