RFR: 8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out [v2]

Sandhya Viswanathan sviswanathan at openjdk.java.net
Tue May 11 01:06:25 UTC 2021


> LibraryCallKit::inline_preconditions_checkIndex can result in the following assert sometimes:
>    "# assert(ctrl == kit.control()) failed: Control flow was added although the intrinsic bailed out"
> 
> Consider the following code snippet:
>  ...
>  set_control(_gvn.transform(new IfTrueNode(rc)));
>  {
>    PreserveJVMState pjvms(this);
>    set_control(_gvn.transform(new IfFalseNode(rc)));
>    uncommon_trap(Deoptimization::Reason_range_check,
>                  Deoptimization::Action_make_not_entrant);
>  }
>  ..
>  Here the control is being modified by set_control even though a bailout is possible afterwards.
>  Moving the set_control later in the intrinsic fixes this.
> 
>  This is a small fix. Please review.
> 
> Best Regards,
> Sandhya

Sandhya Viswanathan has updated the pull request incrementally with one additional commit since the last revision:

  Implement review comments from Vladimir Kozlov

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3958/files
  - new: https://git.openjdk.java.net/jdk/pull/3958/files/40892c40..1283b4a6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3958&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3958&range=00-01

  Stats: 16 lines in 1 file changed: 7 ins; 8 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3958.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3958/head:pull/3958

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


More information about the hotspot-compiler-dev mailing list