Question: "backwards" adressing

Christian Thalinger Christian.Thalinger at Sun.COM
Mon Aug 24 08:53:28 PDT 2009


Ulf Zibis wrote:
>> 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
>>
>>   
> 
> Hm, I'm wondering, that CPU move instruction can determine target 
> address from 3 operands at same time.
> Anyway, the base+index part must be calculated 2 times here, where 2nd 
> seems redundant to me.

Well, this was only pseudo-code, as was yours.  Let's get a little deeper...

base+index is calculated only once into a temporary register and used
afterwards.  But if that happens depends on the register allocator and
register pressure.

> 
>  > a register machine here, not a stack machine
> I'm too wondering, how method parameters were passed by register, 
> especially if they were more.

On IA32?  The first two integer arguments are passed in registers, the
rest on the stack, on SPARC it's different.  But again, we are only
talking in pseudo-code here.

-- Christian


More information about the hotspot-compiler-dev mailing list