[9] RFR (L): 8152590: C2: @Stable support doesn't always work w/ incremental inlining

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Apr 5 15:12:19 UTC 2016


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 

   * common constant folding logic into 

     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 

   * check_mismatched_access is moved to type.cpp

(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())

(3) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.02

Do constant folding for fields (both static and instance) in 

(4) http://cr.openjdk.java.net/~vlivanov/8152590/webrev.00.03

Mark CallSite::target field as constant.


   * fixed test/compiler/unsafe/UnsafeGetStableArrayElement.java

Testing: JPRT, RBT (pit-hs-comp w/ parse time folding on/off), octane.


Best regards,
Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list