Writing custom compiler

C

Chris Uppal

Chris said:
With a few exceptions, though, optimizers don't optimize native machine
code. They optimize intermediate representations.
Agreed.


2. Convert all local variables AND the operand stack into SSA form with
temporary variables.

My reason for suspecting that overuse of the stack might impede optimisation is
that the semantics of stack operations are richer than just register moves --
for instance an /ordering/ of data items on the stack is implied, even when the
algorithm itself doesn't make use of that ordering. If the optimisation phase
attempts to preserve that layout, then it'll have more work to do than if the
same algorithm had been expressed as movements between (unordered) "registers".
I assume that you are right in thinking that an SSA analysis is capable of
removing "stackness" from bytecode which passes verification (I know very
little about SSA). I would be just a little hesitant in going from that to
assuming that <some unknown JVM> does do so in practise -- especially for
non-idiomatic bytecode.

-- chris
 
R

Roedy Green

I've seen methods with one parameter and methods with two parameters, but
I've never seem a method with 1.5 parameters.

i just meant to insert a point between 1 and 2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top