[16] RFR(S): 8248791: sun/util/resources/cldr/TimeZoneNamesTest.java fails with -XX:-ReduceInitialCardMarks -XX:-ReduceBulkZeroing
Tobias Hartmann
tobias.hartmann at oracle.com
Thu Aug 13 06:41:14 UTC 2020
Hi Christian,
what about other allocations that are marked as 'complete_with_arraycoppy'? Not all of them use an
ArrayCopyNode for the actual initialization and therefore find_array_copy_clone will return false.
For example, LibraryCallKit::inline_string_copy.
Can't you just check if InitializeNode::is_complete_with_arraycopy is set?
Best regards,
Tobias
On 12.08.20 15:34, Christian Hagedorn wrote:
> Hi
>
> Please review the following patch:
> https://bugs.openjdk.java.net/browse/JDK-8248791
> http://cr.openjdk.java.net/~chagedorn/8248791/webrev.00/
>
> The problem can be traced back to cloning an object and wrongly optimizing a field load from it to a
> constant zero. In LoadNode::Value(), we check if a load is performed on a freshly-allocated object.
> If that is the case we can replace the load by a constant zero. This is done by calling
> can_see_stored_value() at [1]. In this method, we first check if we can find a captured store with
> find_captured_store() [2].
>
> When enabling ReduceBulkZeroing in the testcase, then this method returns NULL because
> captured_store_insertion_point() bails out at [3] for completed InitializationNodes (is set to
> complete at [4] since ReduceBulkZeroing is enabled and the allocation belongs to a clone).
>
> When disabling ReduceBulkZeroing in the testcase, find_caputured_store() returns a non-NULL ProjNode
> because the InitializationNode of the allocation is not marked completed. We loop one more time and
> then return a constant zero at [5] because there is no store for the allocation (the ArrayCopyNode
> is responsible for the initialization of the cloned object).
>
> The fix now only returns a constant zero if ReduceBulkZeroing is enabled or when the allocation does
> not belong to an ArrayCopyNode clone (if ReduceBulkZeroing is disabled).
>
> Thank you!
>
> Best regards,
> Christian
>
>
> [1] http://hg.openjdk.java.net/jdk/jdk/file/e7109ed4bbb0/src/hotspot/share/opto/memnode.cpp#l1968
> [2] http://hg.openjdk.java.net/jdk/jdk/file/e7109ed4bbb0/src/hotspot/share/opto/memnode.cpp#l1115
> [3] http://hg.openjdk.java.net/jdk/jdk/file/e7109ed4bbb0/src/hotspot/share/opto/memnode.cpp#l3737
> [4] http://hg.openjdk.java.net/jdk/jdk/file/e7109ed4bbb0/src/hotspot/share/opto/library_call.cpp#l4236
> [5] http://hg.openjdk.java.net/jdk/jdk/file/e7109ed4bbb0/src/hotspot/share/opto/memnode.cpp#l1106
More information about the hotspot-compiler-dev
mailing list