Posts Tagged ordering

Class Bootup Part 2

Tags: , , , ,

Today’s article follows up on an article I wrote way back in August of 2009 about the order of operations when you use a class. In the original article I showed the order of field initializers and constructors. Today I’m expanding on that to show three more chunks of code that are run. Can you guess what those chunks are?

Read the rest of this article »

7 Comments

Variable Ordering

Tags: , , ,

I recently perused the AVM2 bytecode overview that Adobe provides and found something strange: they have special instructions for the first few local variables. Getting the first local variables is done by getlocal0, getlocal1, getlocal2, getlocal3, but then a generalized getlocal is used for local variables thereafter. This brought me to think about the performance implications of these specialized instructions. After all, why have them when you already have a generalized one? Read on to see the performance differences and if you can get any speed boost from rearranging your local variables.

Read the rest of this article »

5 Comments