accessing a static field

Deneau, Tom tom.deneau at
Thu May 16 08:37:06 PDT 2013

In our graal HSAIL compiler, we would like to be able to compile accesses of a static field.
I can see that we are generating a MoveToRegOp with the result being a register and the input
being a Constant of kind = Object, the Object being the class object which contains the static field.

and I think we want to end up with code like:

   	mov_b64 $d1,  constant_address_of_class;
	ld_global_s32 $s1, [$d1 + 148];    

The second instruction is being correctly generated but for the first instruction how do I
in java get the actual constant address to insert in the instruction, given the class Object?
(I am assuming the address of the class really does remain constant in the face of GC)

I glanced at the AMD64 code and I don't really understand what is going on with the
recordDataReferenceInCode logic.

-- Tom Deneau, AMD

More information about the graal-dev mailing list