RFR: 8013393: Merge templateTable_x86 32 and 64 bit files into one file.

Coleen Phillimore coleen.phillimore at oracle.com
Mon Mar 2 16:53:43 UTC 2015


Hi Max,

This was a lot of work!  Thank you for this technical debt relief!

I've reviewed this code and made several cosmetic issues already and I 
don't have any more that matter to me.  The only thing I wanted people's 
opinions on was the global register declarations in the beginning of the 
templateTable*cpp files.  I don't really have a good/easy alternate 
solution.  I tried changing them to __ bcp_register() (as declared in 
interp_masm_x86_32/64.hpp) but that looks really ugly and the static 
inline function like iaddress() would have to be added to 
templateTable.hpp.  I think if someone has a better idea, you could file 
an RFE and fix it in an update to this change.

The code looks great.  This came out well.  Thanks!

Coleen


On 2/27/15, 12:36 PM, Max Ockner wrote:
> Hello all,
> Please review this change which involves merging 32 and 64 bit 
> interpreter files.
>
> Bug ID: 8013393
> Webrev: cr.openjdk.java.net/~coleenp/8013393
>
> Summary: templateTable_x86_64.cpp and templateTable_x86_32.cpp have 
> been merged into one file*. These files originally shared thousands of 
> lines of duplicate code.
> There were also many nearly identical sections of code which differed 
> only in register usage (example: rsi vs. r13) or in the usage of 
> nearly identical functions (example: movptr vs. movq/movl).
> Given that (1) new bytecodes could be added soon, and (2) these files 
> have been tormenting Coleen for years, this change seems overdue.
>
> *There are currently two files. The updated templateTable_x86.cpp is 
> copied into both templateTable_x86_32.cpp and templateTable_x86_64.cpp 
> to make it easier to review (so the diff is not the entire file). This 
> will be changed back to one file after review.
>
> For functions that could be merged, one copy was kept. In some cases, 
> files were merged by factoring out small differences such as register 
> usage (example: rbcp equals r13 or rsi depending on the platform). For 
> functions that could not be merged, the 32 and 64 bit versions are 
> adjacent and are defined conditionally using #ifdef based on the 
> platform.
>
> There are still improvements to be made, but they are small and can be 
> filed seperately.
>
> Tested with:
> JPRT
> UTE nsk.jvmti.testlist
>
>
> Thanks,
> Max Ockner



More information about the hotspot-dev mailing list