Request for reviews (XXL): 6961697: move nmethod constants section before instruction section

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Jul 7 16:56:50 PDT 2010


Christian,

Renaming itself is fine but I don't like putting constants at the beginning.

Originally nmethod::code_begin() and CodeBlob::instruction_begin() both point to the first instruction. Now CodeBlob::code_begin() points to the constants section and nmethod::insts_begin() to the first instruction. As result it is very confusing what to use nmethod::insts_begin() or 
nmethod::code_begin() in some cases. I spent few hours looking on these changes and found few other case (for example, disassembler) in addition to your XXX where I am not sure what to use. And there are no checks/validation that correct method is used. Also for stubs it is silently assumed that 
there are no constants.

Could you explain why for sparc you need the constants section before the instructions section? May be we could use other approach.

Thanks,
Vladimir

Christian Thalinger wrote:
> http://cr.openjdk.java.net/~twisti/6961697/webrev.01/
> 
> 6961697: move nmethod constants section before instruction section
> Summary: This is a preparation for 6961690.
> Reviewed-by:
> 
> To better support PC-relative addressing of nmethod constant table
> entries on SPARC, the constants section should be moved before the
> instruction section.  This is a preparation for 6961690.
> 
> The changes are rather big because of some method renamings that were
> necessary since the old naming would have been confusing:
> 
> CodeBlob::instruction_* -> CodeBlob::code_*
> nmethod::code_*         -> nmethod::insts_*
> 
> CodeBlob::code_* methods refer to memory that belongs to the code
> section (consts, insts, and stubs that is).  nmethod methods are named
> as the corresponding section (consts_*, insts_*, stub_*).
> 
> There are a couple of XXX comments in the changes where it isn't clear
> if e.g. an instruction_begin() call really means the beginning of the
> instructions or actually the beginning of the code section.  Please
> examine these changes carefully!
> 
> Testing: DaCapo, JPRT
> 


More information about the hotspot-compiler-dev mailing list