JDK-8233466 : aarch64: remove unnecessary load of mdo when profiling return and parameters type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: openjdk8u292,11,14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: aarch64
  • Submitted: 2019-11-04
  • Updated: 2021-02-02
  • Resolved: 2019-11-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.7Fixed 13.0.4Fixed 14 b26Fixed
Description
When profiling return and parameters type from the interpreter on aarch64 platform, 'mdp' is loaded by test_method_data_pointer which is called by profile_return_type & profile_parameters_type.

It's not necessary to load mdo before calling __ profile_return_type or __ profile_parameters_type.

Patch:

diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
@@ -444,7 +444,6 @@
     Register obj = r0;
     Register mdp = r1;
     Register tmp = r2;
-    __ ldr(mdp, Address(rmethod, Method::method_data_offset()));
     __ profile_return_type(mdp, obj, tmp);
   }
 
@@ -1634,13 +1633,8 @@
   __ mov(rscratch2, true);
   __ strb(rscratch2, do_not_unlock_if_synchronized);
 
-  Label no_mdp;
   Register mdp = r3;
-  __ ldr(mdp, Address(rmethod, Method::method_data_offset()));
-  __ cbz(mdp, no_mdp);
-  __ add(mdp, mdp, in_bytes(MethodData::data_offset()));
   __ profile_parameters_type(mdp, r1, r2);
-  __ bind(no_mdp);
 
   // increment invocation count & check for overflow
   Label invocation_counter_overflow;
Comments
[13u] Fix Request Besides fixes for the issue described by Fei Yang, the patch is necessary for code base alignment. The path applies cleanly, tested with tier1
27-05-2020

Fix Request JDK11u What: Original patch applies cleanly to jdk11u-dev repo. Why: In addition to the redundancy issue, the way of preparing 'mdo' is not correct when profiling return type. We need another add to get the address of the data entries '_data[1]' in class MethodData. Backport this patch to 11u to avoid unnecessary confusion. Testing: Passes tier1 test
29-11-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/fc216dcef2bb User: fyang Date: 2019-11-28 15:13:17 +0000
28-11-2019