5

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 optimizations. AFAIK C# compiler does very small set of optimizations (only required for language support), JIT does all the work. And it works very fast.

Thanks.

Thanks to MPD. AVM2 supports:

  • Constant Folding
  • Copy & Constant Propagation
  • Common Subexpression Elimination (CSE)
  • Dead Code Elimination (DCE)
anatoly
  • 350
  • 2
  • 8

2 Answers2

3

Take a look at these slides: ActionScript 3.0 and AVM2: Performance Tuning.

MultiplyByZer0
  • 6,302
  • 3
  • 32
  • 48
mpdonadio
  • 2,891
  • 3
  • 35
  • 54
  • Thanks for the answer! Presentation is a little bit old (2006 year) but it has info that I was looking for. AVM2 supports: Constant Folding, Copy & Constant Propagation, Common Subexpression Elimination (CSE), Dead Code Elimination (DCE) – anatoly Jun 09 '11 at 09:58
  • Glad it helped. If you aren't aware, Grossman was the original developer of Actionscript. I think that paper coincides with the release of AS3 and the AVM2. – mpdonadio Jun 09 '11 at 12:45
0

I don't think that the Flash/Flex compiler do most of this optimizations, but you can achieve this results with 3rd party softwares, like secureSWF (commercial).

Maybe you can find another tool that is free or Open Source that does this too.

NemoStein
  • 2,088
  • 2
  • 22
  • 36