JDK-8329174 : update CodeBuffer layout in comment after constants section moved
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P3
  • Status: New
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2024-03-25
  • Updated: 2024-03-27
Description
A DESCRIPTION OF THE PROBLEM :
The initial CodeBuffer layout is depicted in file src/hotspot/share/asm/codeBuffer.cpp as below, and the order is code, stubs and constants.
```
// The structure of the CodeBuffer while code is being accumulated:
//
//    _total_start ->    \
//    _insts._start ->              +----------------+
//                                  |                |
//                                  |     Code       |
//                                  |                |
//    _stubs._start ->     |----------------|
//                                  |                    |
//                                  |    Stubs       | (also handlers for deopt/exception)
//                                  |                    |
//    _consts._start ->   |----------------|
//                                  |                       |
//                                  |   Constants    |
//                                  |                        |
//                                  +----------------+
//    + _total_size ->      |                        |

After JKD-6961697, constants section was moved to the front of code section, but this layout was not updated correspondingly, which is misunderstanding. Therefore, we'd better to fix it.



Comments
Reply from Submitter =============== Enhancement JDK-6961697(https://bugs.openjdk.org/browse/JDK-6961697) moved nmethod constants section before instruction section, but the layout scheme was not changed correspondingly. As a result, it still shows that the instruction section was before constants section(https://github.com/openjdk/jdk/blob/master/src/hotspot/share/asm/codeBuffer.cpp#L66). Therefore, this enhancement report is not relevant with java version or OS version. The mismatch between layout scheme in source code and actual layout should be fixed. Please contact me if you have any questions.
27-03-2024

Mailed submitter =========== Hi Quan Zhang , Regarding the incident it indicates as an Enhancement reporting "update CodeBuffer layout in comment after constants section moved". Notes didn't cover the java version and OS version. Could you provide below info # Which JDK version is the issue reported.Provide java -version output. # uname -a # With which version of JDK was the structure of the CodeBuffer verified ? Thanks
27-03-2024