[9] RFR (L): 8152590: C2: @Stable support doesn't always work w/ incremental inlining
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Apr 5 19:23:44 UTC 2016
On 4/5/16 8:12 AM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00
> https://bugs.openjdk.java.net/browse/JDK-8152590
>
> Constant folding of stable field loads only happens during parsing.
> During incremental (post-parse) inlining some loads can become foldable,
> but they aren't optimized.
>
> Though the fix is pretty trivial (webrev.00.02), I decided to refactor
> relevant code and get rid of redundant parts.
>
> To ease the review I split the change into 4 parts:
>
> (1) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.00
>
> * extracted all constant-related checks into
> ciField::constant_value()/ciField::constant_value_of();
>
> * common constant folding logic into
> GraphKit::make_constant_from_field()/Type::make_constant_*():
>
> Parse::do_get_xxx() / LibraryCallKit::inline_unsafe_access()
> GraphKit::make_constant_from_field(ciField*, Node*)
> Type::make_constant_from_field(ciField*, ...)
> Type::make_from_constant(ciConstant, ...)
>
> * fold_stable_ary_elem is moved to
> Type::make_constant_from_array_element()
>
> * check_mismatched_access is moved to type.cpp
Type::make_constant_from_field() - is_stable_array and stable_dimension
are needed only at the end for make_from_constant() call, move them there.
check_mismatched_access() result is used only in assert. Should you put
the call and assert under #ifdef ASSERT?
>
>
> (2) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.01
>
> Refactored constant folding logic for static final fields and unified
> folding logic with instance fields: is_constant() depends only on the
> flags and caller should check return value from
> ciField::constant_value() for validity (ciConstant.is_valid())
>
Good.
>
> (3) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.02
>
> Do constant folding for fields (both static and instance) in
> LoadNode::Value.
Good.
>
>
> (4) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.03
>
> Mark CallSite::target field as constant.
Okay.
Thanks,
Vladimir
>
>
> Also:
>
> * fixed test/compiler/unsafe/UnsafeGetStableArrayElement.java
>
> Testing: JPRT, RBT (pit-hs-comp w/ parse time folding on/off), octane.
>
> Thanks!
>
> Best regards,
> Vladimir Ivanov
More information about the hotspot-compiler-dev
mailing list