RFR: 8253900: SA: wrong size computation when JVM was built without AOT [v5]

Ziviani github.com+670087+jrziviani at openjdk.java.net
Fri Oct 2 02:40:16 UTC 2020


> TestInstanceKlassSize was failing because, for PowerPC, the following code (instanceKlass.cpp) always compiles to
> `return false;` bool InstanceKlass::has_stored_fingerprint() const {
> #if INCLUDE_AOT
>   return should_store_fingerprint() || is_shared();
> #else
>   return false;
> #endif
> }
> However, in `hasStoredFingerprint()@InstanceKlass.java` the condition `shouldStoreFingerprint() || isShared();` is
> always evaluated and may return true (_AFAIK isShared() returns true_). Such condition adds 8 bytes in the
> `getSize()@InstanceKlass.java` causing the failure in TestInstanceKlassSize: public long getSize() { // in number of
> bytes
>   ...
>   if (hasStoredFingerprint()) {
>     size += 8; // uint64_t
>   }
>   return alignSize(size);
> }
> Considering these tests are failing for PowerPC only (_based on ProblemList.txt_), my solution checks if
> `hasStoredFingerprint()` is running on a PowerPC platform. I decided to go this way because there is no existing flag
> informing whether AOT is included or not and creating a new one just to handle the PowerPC case seems too much.  This
> patch is an attempt to fix https://bugs.openjdk.java.net/browse/JDK-8230664

Ziviani has refreshed the contents of this pull request, and previous commits have been removed. The incremental views
will show differences compared to the previous content of the PR. The pull request contains one new commit since the
last revision:

  8253900: SA: wrong size computation when JVM was built without AOT
  
  The code hasStoredFingerprint() at InstanceKlass.java is not considering
  AOT disabled at compilation time, like has_stored_fingerprint() at
  instanceKlass.cpp does. Such difference can cause TestInstanceKlassSize
  failures because all objects will have an extra 8-bytes.
  
  TestInstanceKlassSize and TestInstanceKlassSizeForInterface were removed
  from ProblemList.txt because it cannot be reproduced after this change,
  but, if JDK-8230664 starts to reproduce again, these tests can be
  disabled.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/358/files
  - new: https://git.openjdk.java.net/jdk/pull/358/files/5c08095f..8e9d1368

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=358&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=358&range=03-04

  Stats: 3 lines in 1 file changed: 0 ins; 3 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/358.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/358/head:pull/358

PR: https://git.openjdk.java.net/jdk/pull/358


More information about the hotspot-dev mailing list