Andrew Haley wrote:
   D.843 = &java.text.Collator.class$$;
   D.845 = &_CD_java_text_Collator;
   _Jv_InitClass (D.843);
This is always a valid transformation.

i.e. the memory reference is moved to before the call to _Jv_InitClass.
There is no memory reference in the above case, it seems just the address
of _CD_java_text_Collator is taken.

Or maybe I'm missing sth?

In the RTL code it moves the mem ref, not just the address:

(call (mem:QI (symbol_ref:DI ("_Jv_InitClass") [flags 0x41]

(set (reg/f:DI 95 [ #ref#8#1 ])
        (mem/s/u/f/j:DI (const:DI (plus:DI (symbol_ref:DI 
("_CD_java_text_Collator")
                    (const_int 16 [0x10])))

is turned to:

(set (reg/f:DI 162 [ #ref#8#1 ])
        (mem/s/u/f/j:DI (const:DI (plus:DI (symbol_ref:DI 
("_CD_java_text_Collator")
                    (const_int 16 [0x10])))

...

(call (mem:QI (symbol_ref:DI ("_Jv_InitClass")

This is still fine.  The memory is in the GOT, and is known to contain a
stable value throughout the lifetime of the program.  Which is why we
don't model this as a memory load until we absolutely have to.


r~

Reply via email to