If you are visually impaired or blind, you can visit the PDF version by Pressing CONTROL + ALT + 4
<br /> Adobe®<br /> ActionScript Virtual Machine 2 (AVM2) Overview<br /> May 2007<br /> Copyright © 2006–2007 Adobe Systems Incorporated. All rights reserved.<br /> NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic<br /> form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior<br /> written consent of Adobe Systems Incorporated.<br /> Adobe, the Adobe Logo, and ActionScript, are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other<br /> countries. All other trademarks are the property of their respective owners.<br /> 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<br /> Adobe Systems Incorporated. Adobe Systems Incorporated assumes no resp<a title="ActionScript Virtual Machine 2 Overview page 1" href="http://viewer.zmags.com/publication/950ce62a?page=1"> Adobe® ActionScript Virtual </a> <a title="ActionScript Virtual Machine 2 Overview page 2" href="http://viewer.zmags.com/publication/950ce62a?page=2"> Copyright © 2006–2007 Adobe Systems Incorporated.</a> <a title="ActionScript Virtual Machine 2 Overview page 3" href="http://viewer.zmags.com/publication/950ce62a?page=3"> Contents 1 Introduction...................</a> <a title="ActionScript Virtual Machine 2 Overview page 4" href="http://viewer.zmags.com/publication/950ce62a?page=4"> 4.8.5 Method, getter, and setter t</a> <a title="ActionScript Virtual Machine 2 Overview page 5" href="http://viewer.zmags.com/publication/950ce62a?page=5"> 1 Introduction The Adobe® ActionScript™ Virtual</a> <a title="ActionScript Virtual Machine 2 Overview page 6" href="http://viewer.zmags.com/publication/950ce62a?page=6"> ƒ Verification—The contents of an ABC file und</a> <a title="ActionScript Virtual Machine 2 Overview page 7" href="http://viewer.zmags.com/publication/950ce62a?page=7"> 2 The structure of the ActionScript Virtual Mac</a> <a title="ActionScript Virtual Machine 2 Overview page 8" href="http://viewer.zmags.com/publication/950ce62a?page=8"> o The operand stack holds oper</a> <a title="ActionScript Virtual Machine 2 Overview page 9" href="http://viewer.zmags.com/publication/950ce62a?page=9"> RTQName should use. So when the RTQName is used, </a> <a title="ActionScript Virtual Machine 2 Overview page 10" href="http://viewer.zmags.com/publication/950ce62a?page=10"> use namespace t; trace(o[x]); This code will </a> <a title="ActionScript Virtual Machine 2 Overview page 11" href="http://viewer.zmags.com/publication/950ce62a?page=11"> If the closure is a method closure, then the firs</a> <a title="ActionScript Virtual Machine 2 Overview page 12" href="http://viewer.zmags.com/publication/950ce62a?page=12"> 2.5.5 Object creation and manipulation instructio</a> <a title="ActionScript Virtual Machine 2 Overview page 13" href="http://viewer.zmags.com/publication/950ce62a?page=13"> 2.5.10Debugging instructions Unlike many traditio</a> <a title="ActionScript Virtual Machine 2 Overview page 14" href="http://viewer.zmags.com/publication/950ce62a?page=14"> 3 Loading, linking, verification, and executio</a> <a title="ActionScript Virtual Machine 2 Overview page 15" href="http://viewer.zmags.com/publication/950ce62a?page=15"> 3.3 Execution This section describes the state </a> <a title="ActionScript Virtual Machine 2 Overview page 16" href="http://viewer.zmags.com/publication/950ce62a?page=16"> 3.3.4 Execution mechanics Execution begins with t</a> <a title="ActionScript Virtual Machine 2 Overview page 17" href="http://viewer.zmags.com/publication/950ce62a?page=17"> • Some name fields (for example, instance_info</a> <a title="ActionScript Virtual Machine 2 Overview page 18" href="http://viewer.zmags.com/publication/950ce62a?page=18"> 4 The ActionScript Byte Code (abc) format Sy</a> <a title="ActionScript Virtual Machine 2 Overview page 19" href="http://viewer.zmags.com/publication/950ce62a?page=19"> 4.2 abcFile abcFile { u16 minor_version u16</a> <a title="ActionScript Virtual Machine 2 Overview page 20" href="http://viewer.zmags.com/publication/950ce62a?page=20"> method_body_count, method_body The valu</a> <a title="ActionScript Virtual Machine 2 Overview page 21" href="http://viewer.zmags.com/publication/950ce62a?page=21"> string_count, string The value of str</a> <a title="ActionScript Virtual Machine 2 Overview page 22" href="http://viewer.zmags.com/publication/950ce62a?page=22"> 4.4.1 Namespace A namespace_info entry defines a</a> <a title="ActionScript Virtual Machine 2 Overview page 23" href="http://viewer.zmags.com/publication/950ce62a?page=23"> 4.4.3 Multiname A multiname_info entry is a varia</a> <a title="ActionScript Virtual Machine 2 Overview page 24" href="http://viewer.zmags.com/publication/950ce62a?page=24"> RTQNameL The multiname_kind_RTQNameL format is u</a> <a title="ActionScript Virtual Machine 2 Overview page 25" href="http://viewer.zmags.com/publication/950ce62a?page=25"> array of the constant pool; the name at that entr</a> <a title="ActionScript Virtual Machine 2 Overview page 26" href="http://viewer.zmags.com/publication/950ce62a?page=26"> Each optional value consists of a kind field that</a> <a title="ActionScript Virtual Machine 2 Overview page 27" href="http://viewer.zmags.com/publication/950ce62a?page=27"> 4.5.2 Parameter names The param_names entry is av</a> <a title="ActionScript Virtual Machine 2 Overview page 28" href="http://viewer.zmags.com/publication/950ce62a?page=28"> 4.7 Instance The instance_info entry is used to</a> <a title="ActionScript Virtual Machine 2 Overview page 29" href="http://viewer.zmags.com/publication/950ce62a?page=29"> iinit This is an index into the method array of </a> <a title="ActionScript Virtual Machine 2 Overview page 30" href="http://viewer.zmags.com/publication/950ce62a?page=30"> 4.8.2 Slot and const traits A kind value of Trait</a> <a title="ActionScript Virtual Machine 2 Overview page 31" href="http://viewer.zmags.com/publication/950ce62a?page=31"> 4.8.4 Function traits A kind value of Trait_Funct</a> <a title="ActionScript Virtual Machine 2 Overview page 32" href="http://viewer.zmags.com/publication/950ce62a?page=32"> class_info { u30 cinit u30 </a> <a title="ActionScript Virtual Machine 2 Overview page 33" href="http://viewer.zmags.com/publication/950ce62a?page=33"> method_body_info { u30 method </a> <a title="ActionScript Virtual Machine 2 Overview page 34" href="http://viewer.zmags.com/publication/950ce62a?page=34"> 4.12 Exception The exception_info entry is used </a> <a title="ActionScript Virtual Machine 2 Overview page 35" href="http://viewer.zmags.com/publication/950ce62a?page=35"> 5 AVM2 instructions The AVM2 instruction des</a> <a title="ActionScript Virtual Machine 2 Overview page 36" href="http://viewer.zmags.com/publication/950ce62a?page=36"> add Operation Add two values. Format add Form</a> <a title="ActionScript Virtual Machine 2 Overview page 37" href="http://viewer.zmags.com/publication/950ce62a?page=37"> add_i Operation Add two integer values. Format </a> <a title="ActionScript Virtual Machine 2 Overview page 38" href="http://viewer.zmags.com/publication/950ce62a?page=38"> astypelate Operation Return the same value, or n</a> <a title="ActionScript Virtual Machine 2 Overview page 39" href="http://viewer.zmags.com/publication/950ce62a?page=39"> bitnot Operation Bitwise not. Format bitnot F</a> <a title="ActionScript Virtual Machine 2 Overview page 40" href="http://viewer.zmags.com/publication/950ce62a?page=40"> bitxor Operation Bitwise exclusive or. Format b</a> <a title="ActionScript Virtual Machine 2 Overview page 41" href="http://viewer.zmags.com/publication/950ce62a?page=41"> callmethod Operation Call a method identified by</a> <a title="ActionScript Virtual Machine 2 Overview page 42" href="http://viewer.zmags.com/publication/950ce62a?page=42"> Description arg_count is a u30 that is the number</a> <a title="ActionScript Virtual Machine 2 Overview page 43" href="http://viewer.zmags.com/publication/950ce62a?page=43"> Runtime exceptions A TypeError is thrown if obj i</a> <a title="ActionScript Virtual Machine 2 Overview page 44" href="http://viewer.zmags.com/publication/950ce62a?page=44"> callstatic Operation Call a method identified by</a> <a title="ActionScript Virtual Machine 2 Overview page 45" href="http://viewer.zmags.com/publication/950ce62a?page=45"> Description arg_count is a u30 that is the number</a> <a title="ActionScript Virtual Machine 2 Overview page 46" href="http://viewer.zmags.com/publication/950ce62a?page=46"> Runtime exceptions A TypeError is thrown if recei</a> <a title="ActionScript Virtual Machine 2 Overview page 47" href="http://viewer.zmags.com/publication/950ce62a?page=47"> interfaces matches the type specified by the mult</a> <a title="ActionScript Virtual Machine 2 Overview page 48" href="http://viewer.zmags.com/publication/950ce62a?page=48"> construct Operation Construct an instance. Form</a> <a title="ActionScript Virtual Machine 2 Overview page 49" href="http://viewer.zmags.com/publication/950ce62a?page=49"> The property specified by the multiname at index </a> <a title="ActionScript Virtual Machine 2 Overview page 50" href="http://viewer.zmags.com/publication/950ce62a?page=50"> Description value is popped off of the stack and </a> <a title="ActionScript Virtual Machine 2 Overview page 51" href="http://viewer.zmags.com/publication/950ce62a?page=51"> convert_o Operation Convert a value to an Object</a> <a title="ActionScript Virtual Machine 2 Overview page 52" href="http://viewer.zmags.com/publication/950ce62a?page=52"> convert_s Operation Convert a value to a string.</a> <a title="ActionScript Virtual Machine 2 Overview page 53" href="http://viewer.zmags.com/publication/950ce62a?page=53"> When debug_type has a value of 1, this tells the </a> <a title="ActionScript Virtual Machine 2 Overview page 54" href="http://viewer.zmags.com/publication/950ce62a?page=54"> If the debugger is running, then this instruction</a> <a title="ActionScript Virtual Machine 2 Overview page 55" href="http://viewer.zmags.com/publication/950ce62a?page=55"> decrement Operation Decrement a value. Format d</a> <a title="ActionScript Virtual Machine 2 Overview page 56" href="http://viewer.zmags.com/publication/950ce62a?page=56"> deleteproperty Operation Delete a property. For</a> <a title="ActionScript Virtual Machine 2 Overview page 57" href="http://viewer.zmags.com/publication/950ce62a?page=57"> dup Operation Duplicates the top value on the st</a> <a title="ActionScript Virtual Machine 2 Overview page 58" href="http://viewer.zmags.com/publication/950ce62a?page=58"> dxnslate Operation Sets the default XML namespac</a> <a title="ActionScript Virtual Machine 2 Overview page 59" href="http://viewer.zmags.com/publication/950ce62a?page=59"> esc_xattr Operation Escape an xml attribute. Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 60" href="http://viewer.zmags.com/publication/950ce62a?page=60"> findproperty Operation Search the scope stack fo</a> <a title="ActionScript Virtual Machine 2 Overview page 61" href="http://viewer.zmags.com/publication/950ce62a?page=61"> Description index is a u30 that must be an index </a> <a title="ActionScript Virtual Machine 2 Overview page 62" href="http://viewer.zmags.com/publication/950ce62a?page=62"> getglobalscope Operation Gets the global scope. </a> <a title="ActionScript Virtual Machine 2 Overview page 63" href="http://viewer.zmags.com/publication/950ce62a?page=63"> getlex Operation Find and get a property. Forma</a> <a title="ActionScript Virtual Machine 2 Overview page 64" href="http://viewer.zmags.com/publication/950ce62a?page=64"> getlocal_<n> Operation Get a local register. Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 65" href="http://viewer.zmags.com/publication/950ce62a?page=65"> getscopeobject Operation Get a scope object. Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 66" href="http://viewer.zmags.com/publication/950ce62a?page=66"> getsuper Operation Gets a property from a base c</a> <a title="ActionScript Virtual Machine 2 Overview page 67" href="http://viewer.zmags.com/publication/950ce62a?page=67"> greaterthan Operation Determine if one value is </a> <a title="ActionScript Virtual Machine 2 Overview page 68" href="http://viewer.zmags.com/publication/950ce62a?page=68"> hasnext2 Operation Determine if the given object</a> <a title="ActionScript Virtual Machine 2 Overview page 69" href="http://viewer.zmags.com/publication/950ce62a?page=69"> Format ifeq offset Forms ifeq = 19 (0x13) </a> <a title="ActionScript Virtual Machine 2 Overview page 70" href="http://viewer.zmags.com/publication/950ce62a?page=70"> Format ifge offset Forms ifge = 24 (0x18) </a> <a title="ActionScript Virtual Machine 2 Overview page 71" href="http://viewer.zmags.com/publication/950ce62a?page=71"> Format ifle offset Forms ifle = 22 (0x16) </a> <a title="ActionScript Virtual Machine 2 Overview page 72" href="http://viewer.zmags.com/publication/950ce62a?page=72"> Format ifnge offset Forms ifnge = 15 (0x0f) </a> <a title="ActionScript Virtual Machine 2 Overview page 73" href="http://viewer.zmags.com/publication/950ce62a?page=73"> undefined. In that case ifngt will branch (undefi</a> <a title="ActionScript Virtual Machine 2 Overview page 74" href="http://viewer.zmags.com/publication/950ce62a?page=74"> Compute value1 < value2 using the abstract relati</a> <a title="ActionScript Virtual Machine 2 Overview page 75" href="http://viewer.zmags.com/publication/950ce62a?page=75"> Description offset is an s24 that is the number o</a> <a title="ActionScript Virtual Machine 2 Overview page 76" href="http://viewer.zmags.com/publication/950ce62a?page=76"> in Operation Determine whether an object has a n</a> <a title="ActionScript Virtual Machine 2 Overview page 77" href="http://viewer.zmags.com/publication/950ce62a?page=77"> Format inclocal_i index Forms inclocal_i = 19</a> <a title="ActionScript Virtual Machine 2 Overview page 78" href="http://viewer.zmags.com/publication/950ce62a?page=78"> Description Pop value off of the stack. Convert v</a> <a title="ActionScript Virtual Machine 2 Overview page 79" href="http://viewer.zmags.com/publication/950ce62a?page=79"> Description Pop value and type off of the stack. </a> <a title="ActionScript Virtual Machine 2 Overview page 80" href="http://viewer.zmags.com/publication/950ce62a?page=80"> Description Compute the type of value, and let va</a> <a title="ActionScript Virtual Machine 2 Overview page 81" href="http://viewer.zmags.com/publication/950ce62a?page=81"> Notes This is usually used so that different jump</a> <a title="ActionScript Virtual Machine 2 Overview page 82" href="http://viewer.zmags.com/publication/950ce62a?page=82"> lessthan Operation Determine if one value is les</a> <a title="ActionScript Virtual Machine 2 Overview page 83" href="http://viewer.zmags.com/publication/950ce62a?page=83"> Notes Other control flow instructions take the ba</a> <a title="ActionScript Virtual Machine 2 Overview page 84" href="http://viewer.zmags.com/publication/950ce62a?page=84"> multiply Operation Multiply two values. Format </a> <a title="ActionScript Virtual Machine 2 Overview page 85" href="http://viewer.zmags.com/publication/950ce62a?page=85"> Forms negate = 144 (0x90) Stack …, value => </a> <a title="ActionScript Virtual Machine 2 Overview page 86" href="http://viewer.zmags.com/publication/950ce62a?page=86"> newarray Operation Create a new array. Format n</a> <a title="ActionScript Virtual Machine 2 Overview page 87" href="http://viewer.zmags.com/publication/950ce62a?page=87"> newclass Operation Create a new class. Format n</a> <a title="ActionScript Virtual Machine 2 Overview page 88" href="http://viewer.zmags.com/publication/950ce62a?page=88"> newobject Operation Create a new object. Format</a> <a title="ActionScript Virtual Machine 2 Overview page 89" href="http://viewer.zmags.com/publication/950ce62a?page=89"> nextvalue Operation Get the name of the next pro</a> <a title="ActionScript Virtual Machine 2 Overview page 90" href="http://viewer.zmags.com/publication/950ce62a?page=90"> not Operation Boolean negation. Format not Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 91" href="http://viewer.zmags.com/publication/950ce62a?page=91"> popscope Operation Pop a scope off of the scope </a> <a title="ActionScript Virtual Machine 2 Overview page 92" href="http://viewer.zmags.com/publication/950ce62a?page=92"> pushdouble Operation Push a double value onto th</a> <a title="ActionScript Virtual Machine 2 Overview page 93" href="http://viewer.zmags.com/publication/950ce62a?page=93"> pushint Operation Push an int value onto the sta</a> <a title="ActionScript Virtual Machine 2 Overview page 94" href="http://viewer.zmags.com/publication/950ce62a?page=94"> Stack … => …, NaN Description Push the value Na</a> <a title="ActionScript Virtual Machine 2 Overview page 95" href="http://viewer.zmags.com/publication/950ce62a?page=95"> pushshort Operation Push a short value. Format </a> <a title="ActionScript Virtual Machine 2 Overview page 96" href="http://viewer.zmags.com/publication/950ce62a?page=96"> pushtrue Operation Push true. </a> <a title="ActionScript Virtual Machine 2 Overview page 97" href="http://viewer.zmags.com/publication/950ce62a?page=97"> pushundefined Operation Push un</a> <a title="ActionScript Virtual Machine 2 Overview page 98" href="http://viewer.zmags.com/publication/950ce62a?page=98"> returnvalue Operation Return a value from a meth</a> <a title="ActionScript Virtual Machine 2 Overview page 99" href="http://viewer.zmags.com/publication/950ce62a?page=99"> rshift Operation Signed bitwise right shift. Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 100" href="http://viewer.zmags.com/publication/950ce62a?page=100"> setlocal_<n> Operation Set a local register. Fo</a> <a title="ActionScript Virtual Machine 2 Overview page 101" href="http://viewer.zmags.com/publication/950ce62a?page=101"> setproperty Operation Set a property. Format se</a> <a title="ActionScript Virtual Machine 2 Overview page 102" href="http://viewer.zmags.com/publication/950ce62a?page=102"> This will set the value stored in the slot at slo</a> <a title="ActionScript Virtual Machine 2 Overview page 103" href="http://viewer.zmags.com/publication/950ce62a?page=103"> Format strictequals Forms strictequals = 172 </a> <a title="ActionScript Virtual Machine 2 Overview page 104" href="http://viewer.zmags.com/publication/950ce62a?page=104"> Format subtract_i Forms subtract_i = 198 (0x</a> <a title="ActionScript Virtual Machine 2 Overview page 105" href="http://viewer.zmags.com/publication/950ce62a?page=105"> When a throw is executed, the current method’s ex</a> <a title="ActionScript Virtual Machine 2 Overview page 106" href="http://viewer.zmags.com/publication/950ce62a?page=106"> Format urshift Forms urshift = 167 (0xa7) </a> <a title="ActionScript Virtual Machine 2 Overview page 107" href="http://viewer.zmags.com/publication/950ce62a?page=107"> 6 Hints for compiler writers The following te</a> <a title="ActionScript Virtual Machine 2 Overview page 108" href="http://viewer.zmags.com/publication/950ce62a?page=108"> pushshort 0 se</a>