Question: "backwards" adressing

Christian Thalinger Christian.Thalinger at Sun.COM
Mon Aug 24 07:43:36 PDT 2009


Ulf Zibis wrote:
> Thanks for clarifying.
> ... But isn't using the index register faster, than 2 times 
> load-with-offset ?
> 
> forwards:
> accumlator = pop // codePoint
> index register = pop // dst
> index register += pop // index
> save highSurrogate(accumulator) (ix++)
> save lowSurrogate(accumulator) (ix)
> 
> backwards:
> accumlator = pop // codePoint
> index register = pop // dst
> index register += pop // index
> push index register // dst + index
> save lowSurrogate(accumulator) (++ix)
> index register = pop // dst + index
> save highSurrogate(accumulator) (ix)

We are talking here about a register machine here, not a stack machine.
 The generated code is more like:

move lowSurrogate(accumulator),[base+index + 0]
move highSurrogate(accumulator),[base+index + 1]

And you can exchange the two stores as you like.

-- Christian


More information about the hotspot-compiler-dev mailing list