Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8251442: [lworld] C2 compilation fails with assert(value->bottom_type()->higher_equal(_type)) #151

Closed
wants to merge 2 commits into from

Conversation

TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Aug 18, 2020

Similar to JDK-8242453 [1], the problem is that a load from a non-flat array can be pushed through an arraycopy from a flat array (see LoadNode::can_see_arraycopy_value) and end up with an inconsistent memory input (oop load from a flat array). The checks emitted by the arraycopy intrinsic will catch this and the load will be removed but other Ideal transformations can still be executed before that happens and encounter this inconsistent state.

The fix is to add CheckCastPPNodes to the arraycopy intrinsic that propagate the information that the src/dst array is not flat. This makes sure that the data path consistently dies if the input array is in fact a flat array. I've also removed the workaround from the JDK-8242453 [1] fix.

When updating the type of CheckCastPPNodes, we need to make sure that the not_null_free and not_flat properties of TypeAryPtr are propagated. This is done by TypeAryPtr::update_properties. A CheckCastPPNode that ends up with an inconsistent input is then simply replaced by TOP.

This change also includes:

  • Optimize subtype checks based on not_null_free/not_flat properties of array types
  • New tests to verify that checkcasts are folded if one array type is known to be not null-free/flat and the other type is null-free/flat
  • Test suite should detect compilation bailouts and fail (currently, only completely missing compilations were detected)
  • Renamed "flat_array" to "flatten_array" (which means "flattened in arrays") for consistency with runtime code. We should think about a better name.
  • Lots of refactoring, removal of default arguments in calls and dead code

[1] https://bugs.openjdk.java.net/browse/JDK-8242453


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8251442: [lworld] C2 compilation fails with assert(value->bottom_type()->higher_equal(_type))

Download

$ git fetch https://git.openjdk.java.net/valhalla pull/151/head:pull/151
$ git checkout pull/151

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 18, 2020

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request.

@openjdk
Copy link

openjdk bot commented Aug 18, 2020

@TobiHartmann This change now passes all automated pre-integration checks, type /integrate in a new comment to proceed. After integration, the commit message will be:

8251442: [lworld] C2 compilation fails with assert(value->bottom_type()->higher_equal(_type))
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there has been 1 commit pushed to the lworld branch:

  • 248fdec: 8251940: [lworld] Incorrect Signature attribute in class file.

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge lworld into your branch, and then specify the current head hash when integrating, like this: /integrate 248fdec9dccbff9fadf68669a400b743d05f3621.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@mlbridge
Copy link

mlbridge bot commented Aug 18, 2020

Webrevs

@TobiHartmann
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Aug 18, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Aug 18, 2020
@openjdk
Copy link

openjdk bot commented Aug 18, 2020

@TobiHartmann The following commits have been pushed to lworld since your change was applied:

  • 248fdec: 8251940: [lworld] Incorrect Signature attribute in class file.

Your commit was automatically rebased without conflicts.

Pushed as commit 5d1350e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant