Questions tagged [avm2]

AVM2 is the second iteration of the Actionscript Virtual Machine.

AVM2 executes programs written in .

35 questions
15
votes
1 answer

How do generics (Vector) work inside the AVM?

Support for generics (currently only Vector.<*>, and called 'postfix type parameters' by Adobe) was added in Flash Player 10, but the only AVM2 documentation does not describe how these objects are accessed. Specifically, I noticed a new opcode…
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
8
votes
5 answers

What are the negative impacts of extending classes in ActionScript 3?

In my game engine I use Box2D for physics. Box2D's naming conventions and poor commenting ruin the consistent and well documented remainder of my engine which is a little frustrating and presents poorly when you're using it. I've considered making a…
Marty
  • 39,033
  • 19
  • 93
  • 162
7
votes
1 answer

Why does the Flash ActionScript3 compiler emit unnecessary code?

I've recently made a decompiler for AVM2/AS3, and I've noticed that Flash compiler tends to emit a lot of unneccessary code. For example, for a certain application I've removed circa 10% of the code without any impairment to functionality. It was…
Catherine
  • 22,492
  • 3
  • 32
  • 47
7
votes
3 answers

Subclassing a private (support) class in AVM2

I am developing a dynamic mocking framework for Flex/AS3 and am having trouble with private/support types (ie. those declared outside the package {} in a class file). In my ABC "file", I am declaring the instance with the PROTECTED_NAMESPACE class…
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
5
votes
2 answers

What kind of optimizations AVM2 supports?

I wonder, what kind of optimizations AVM2 (ActionScript 3 VM) support? I know it uses JIT but does it support Dead Code Elimination, constant folding, inlining, etc. Also it's very interesting to me that ActionScript compiler also do some…
anatoly
  • 350
  • 2
  • 8
5
votes
1 answer

Stack(s), Registers in ActionScript ByteCode AVM2, which all are there?

From the AVM2 Overview PDF I encountered references to two types of stacks - Scope Stack and Operand Stack. 1) I assume these are two different memory stacks, each handling different things. Are there even more stacks? 2) pushstring "hello" - this…
Ska
  • 6,658
  • 14
  • 53
  • 74
5
votes
3 answers

How are methods found in AVM2 bytecode?

I've been playing around with ABC bytecode and was hoping someone could clear up a point of confusion for me. I have a simple flash file that places a clip on the stage and has a tiny script to update its position on each frame. The code looks…
izb
  • 50,101
  • 39
  • 117
  • 168
4
votes
2 answers

Any tool to debug ActionScript ByteCode? Would like to observe registers, stacks

So when running a SWF, is there a way to step through line by line of ABC code and observe registers, stacks? Could I at least print it to screen or log it?
Ska
  • 6,658
  • 14
  • 53
  • 74
4
votes
1 answer

In ActionScript Bytecode, what does NewActivation mean?

Some methods use it some don't, obviously that's specified by needsActivation flag, nut what does it do and when to use it and when don't? The information on AVM docs is somewhat ungenerous: Creates a new activation object, newactivation, and pushes…
Ska
  • 6,658
  • 14
  • 53
  • 74
3
votes
1 answer

AVM Verifier to Flash Log, how to interpret some things?

The AVM verifier when encounters and error, writes to flash log. In the documentation it says that verifier will visit "all possible branches" where jumps might take it. However it is still pretty confusing when trying to follow the output. Are…
Ska
  • 6,658
  • 14
  • 53
  • 74
2
votes
1 answer

Unexpected behavior accessing properties of script variables

I tried to execute the following actionscript3 program and I am surprised of the result of the call to f() function. I was expecting that the result of f() was "1" or at least "undefined" but the "0" value does not makes any sense for me. I will be…
Vincent M.
  • 23
  • 2
2
votes
1 answer

Why is a linked list faster than Vector in AS3?

I tried the benchmark on this site: Array vs. Vector vs. Linked list. It tests the performance of iterating over said sequences. Remarkably, iterating over a linked list is approximately 2.5x faster than a Vector.. What is the reason for this…
Stefan Dragnev
  • 14,143
  • 6
  • 48
  • 52
2
votes
1 answer

What is initscopedepth in ActionScript bytecode AVM2? Why getlocal_0 and pushscope?

I have looked into the AVM2 Overview document (chapter 4.11, page 33) and found the following about init_scope_depth: init_scope_depth The init_scope_depth field defines the minimum scope depth, relative to max_scope_depth, that may be accessed…
MangaD
  • 315
  • 4
  • 12
2
votes
3 answers

Where I can find AVM2 disassembler (or dump tool)?

Greetings I found this nice answer: How are methods found in AVM2 bytecode? See number 3. May anyone help me? What is the tool used to produce abcFile dump? Thank you!
Dmytro
  • 530
  • 4
  • 18
2
votes
2 answers

AVM2 and ABC (Adobe's ActionScript bytecode format) spec licensing.. can I use it?

Google is failing me on this one. Let's say I have some ECMA script that I've compiled to an ABC bytecode file using the compiler in the Open Source Flex SDK. Is it within the terms of use (That I can't seem to find) for me to use the AVM2…
izb
  • 50,101
  • 39
  • 117
  • 168
1
2 3