RFR: JDK-8310510: WordsPerLong is wrong for 64-bit platforms

Amit Kumar amitkumar at openjdk.org
Wed Jun 21 12:37:05 UTC 2023


On Wed, 21 Jun 2023 08:08:44 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Trivial patch.
> 
> We have WordsPerLong defined as this:
> 
> 
> const int WordsPerLong = 2; // Number of stack entries for longs
> 
> 
> which is wrong for 64-bit platforms. Historically used only for ppc/s390.
> 
> Patch removes the unnecessary align (BasicLock is always 2 words, no need to align to 2) and removes WordsPerLong, since it is not needed anymore.

So I grep-ed usages for this method and found out these occurrences, for both ppc/s390 could be replace by the method “frame::interpreter_frame_monitor_size_in_bytes”.

./interp_masm_s390.cpp:842:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./interp_masm_s390.cpp:2037:  const jint delta = -frame::interpreter_frame_monitor_size() * wordSize;
./templateTable_s390.cpp:4147:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./templateTable_s390.cpp:4242:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./templateTable_ppc_64.cpp:4150:    __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
./templateTable_ppc_64.cpp:4164:    __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
./templateTable_ppc_64.cpp:4173:  __ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));
./templateTable_ppc_64.cpp:4174:  __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size() * wordSize);
./templateTable_ppc_64.cpp:4232:    __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
./templateTable_ppc_64.cpp:4243:    __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
./templateTable_ppc_64.cpp:4257:          -(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));



inline int frame::interpreter_frame_monitor_size_in_bytes() {
  // Number of bytes for a monitor.
  return frame::interpreter_frame_monitor_size() * wordSize;
}


Should I open a RFE for this ?

for other Arch this method isn't there or we can update these as well: 

./x86/templateInterpreterGenerator_x86.cpp:481:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./x86/templateInterpreterGenerator_x86.cpp:570:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./x86/interp_masm_x86.cpp:1078:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./x86/templateTable_x86.cpp:4323:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./x86/templateTable_x86.cpp:4420:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./arm/templateTable_arm.cpp:4274:  const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
./arm/templateTable_arm.cpp:4385:  const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
./arm/templateInterpreterGenerator_arm.cpp:534:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./arm/templateInterpreterGenerator_arm.cpp:573:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./arm/interp_masm_arm.cpp:818:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./riscv/templateTable_riscv.cpp:3743:   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./riscv/templateTable_riscv.cpp:3841:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./riscv/templateInterpreterGenerator_riscv.cpp:604:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./riscv/templateInterpreterGenerator_riscv.cpp:677:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./riscv/interp_masm_riscv.cpp:694:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./aarch64/interp_masm_aarch64.cpp:626:    const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./aarch64/templateTable_aarch64.cpp:3817:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./aarch64/templateTable_aarch64.cpp:3920:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./aarch64/templateInterpreterGenerator_aarch64.cpp:692:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
./aarch64/templateInterpreterGenerator_aarch64.cpp:773:  const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14580#issuecomment-1600753032


More information about the hotspot-dev mailing list