JDK-8020484 : hotspot src/cpu/x86/vm directory contains too much redundant code for 32- and 64-bit versions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2013-07-13
  • Updated: 2017-04-07
  • Resolved: 2017-04-07
Related Reports
Relates :  
Description
The files listed below in src/cpu/x86/vm contain about 33k LOC.  About 47% of the code is for 32-bit x86 and the rest for 64-bit.  It is likely that much of the combined code is redundant, making it likely that we could remove many kLOC from our system.  Removing redundancy would (as always) reduce bugs, such as JDK-8020433.

More specifically, the 32-bit files have 8.6k ULOC (unique lines of code), while the 64-bit files have 9.4k ULOC.  The corpus taken together has 13k ULOC, meaning there are 4.6k ULOC which are identical between the two versions of the code.  This is a large percentage, more than 1/3 of the total ULOC.

Previous work merging files has been largely successful, but was not completed.  This reports requests another attempt at completion.  Filing under "compiler" since (a) much of the code is compiler or interpreter related, and (b) previous work merging has been done in the compiler group.

interp_masm_x86_{32,64}.{h,c}pp
interpreterRT_x86_{32,64}.cpp
interpreter_x86_{32,64}.cpp
jniFastGetField_x86_{32,64}.cpp
metaspaceShared_x86_{32,64}.cpp
runtime_x86_{32,64}.cpp
sharedRuntime_x86_{32,64}.cpp
stubGenerator_x86_{32,64}.cpp
stubRoutines_x86_{32,64}.{h,c}pp
templateInterpreter_x86_{32,64}.cpp
templateTable_x86_{32,64}.{h,c}pp
vtableStubs_x86_{32,64}.cpp

Comments
The interpreter ones are done and vtable_stubs_x86_32/64.cpp would be worth consolidating but the rest are too different and not worth doing. I agree with closing as WNF.
07-04-2017

We're doing some interpreter merging in the runtime group, but this RFE should be for the compiler group for vtableStubs and runtime_x86 at least. I'm not sure if there's any way to merge sharedRuntime_x86 though. They are too different.
04-03-2015

Is the proposal to factor out the common code into shared files? It wasn't that long ago that we had single files full of ifdefs.
03-07-2014