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

8265126: [REDO] unified handling for VectorMask object re-materialization during de-optimization #3721

Closed
wants to merge 3 commits into from

Conversation

@jatin-bhateja
Copy link
Member

@jatin-bhateja jatin-bhateja commented Apr 27, 2021

Following flow describes object reconstruction for de-optimization:-

  1. PhaseVector::scalarize_vbox_node() creates SafePointScalarObjectNode to captures the box type information, also it connects to node holding the boxed value.
  2. During code emit phase (PhaseOutput) C2 process above information to dumps ObjectValue holding the box information and LocationValue to holding the value information into ScopeDescriptor corresponding to Safepoint PC.
  3. De-optimization blobs dump the value held in registers to the stack locations using RegisterSave::save_live_registers() and a mapping b/w register and its stack location is added to RegisterMap.
  4. During de-optimization, compiled frame objects are re-allocated using identity information held in ObjectValue and their fields are initialized using values held in the stack locations accessed through register-stack mappings.

By inserting a VectorStoreMaskNode before stitching the mask holding node to Safepoint we make sure that value held in opmask/vector register is transferred to a byte vector. Thus rest of the flow works as it is, stack location will hold the value in the form of a byte array irrespective of the box shape.

tier1-tier3 regressions are clean with UseAVX=2/3.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8265126: [REDO] unified handling for VectorMask object re-materialization during de-optimization

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3721/head:pull/3721
$ git checkout pull/3721

Update a local copy of the PR:
$ git checkout pull/3721
$ git pull https://git.openjdk.java.net/jdk pull/3721/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3721

View PR using the GUI difftool:
$ git pr show -t 3721

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3721.diff

@jatin-bhateja
Copy link
Member Author

@jatin-bhateja jatin-bhateja commented Apr 27, 2021

/label hotspot-compiler-dev

Loading

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 27, 2021

👋 Welcome back jbhateja! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 27, 2021

@jatin-bhateja
The hotspot-compiler label was successfully added.

Loading

@jatin-bhateja jatin-bhateja changed the title 8265126:[REDO] unified handling for VectorMask object re-materialization during de-optimization 8265126: unified handling for VectorMask object re-materialization during de-optimization (re-submit) Apr 27, 2021
@openjdk openjdk bot added the rfr label Apr 27, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 27, 2021

Webrevs

Loading

Copy link

@iwanowww iwanowww left a comment

Submitted the patch for testing (hs-tier1 - hs-tier4).

Loading

while (safepoints.size() > 0) {
SafePointNode* sfpt = safepoints.pop()->as_SafePoint();

ciInstanceKlass* iklass = vec_box->box_type()->klass()->as_instance_klass();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove that code? It was added to avoid a crash with -XX:+PrintAssembly.

Loading

Copy link
Member Author

@jatin-bhateja jatin-bhateja May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vec_box is a loop invariant the check has just been moved out of the loop.

Loading


void VectorSupport::init_payload_element(typeArrayOop arr, BasicType elem_bt, int index, address addr) {
switch (elem_bt) {
case T_BOOLEAN: arr-> byte_at_put(index, *(jboolean*)addr); break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use bool_at_put and fix formatting.

Loading

@iwanowww
Copy link

@iwanowww iwanowww commented May 3, 2021

Test results (hs-tier1 - hs-tier5) are clean.

Loading

@jatin-bhateja
Copy link
Member Author

@jatin-bhateja jatin-bhateja commented May 3, 2021

Hi @iwanowww, your comments have been resolved.

Loading

Copy link

@iwanowww iwanowww left a comment

Looks good.

Loading

@jatin-bhateja
Copy link
Member Author

@jatin-bhateja jatin-bhateja commented May 4, 2021

Test results (hs-tier1 - hs-tier5) are clean.
Hi @iwanowww I presume following tests mention in PR comments have been cover in hs-tier1-5.

Vladimir Kozlov added a comment - 2021-04-13 09:16
Before pushing implementation someone from Oracle have to run mach5 testing up-to tier3 at least.

Loading

@iwanowww
Copy link

@iwanowww iwanowww commented May 5, 2021

Hi @iwanowww I presume following tests mention in PR comments have been cover in hs-tier1-5.

Yes, that's the case.

Loading

@jatin-bhateja jatin-bhateja changed the title 8265126: unified handling for VectorMask object re-materialization during de-optimization (re-submit) 8265126: [REDO] unified handling for VectorMask object re-materialization during de-optimization May 19, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 19, 2021

@jatin-bhateja This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8265126: [REDO] unified handling for VectorMask object re-materialization during de-optimization

Reviewed-by: vlivanov

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 246 new commits pushed to the master branch:

  • ff84577: 8267098: AArch64: C1 StubFrames end confusingly
  • 0daec49: 8267246: -XX:MaxRAMPercentage=0 is unreasonable for jtreg tests on many-core machines
  • 324defe: 8267212: test/jdk/java/util/Collections/FindSubList.java intermittent crash with "no reachable node should have no use"
  • bdbe23b: 8265462: Handle multiple slots in the NSS Internal Module from SunPKCS11's Secmod
  • 10236e7: 8263242: serviceability/sa/ClhsdbFindPC.java cannot find MaxJNILocalCapacity with ASLR
  • e6705c0: 8266949: Check possibility to disable OperationTimedOut on Unix
  • b92c5a4: 8265292: [macos_aarch64] java/foreign/TestDowncall.java crashes with SIGBUS
  • fadf580: 8262952: [macos_aarch64] os::commit_memory failure
  • f8f40ab: 8230486: G1BarrierSetAssembler::g1_write_barrier_post unnecessarily pushes/pops new_val
  • 9d168e2: 8266973: Migrate to ClassHierarchyIterator when enumerating subclasses
  • ... and 236 more: https://git.openjdk.java.net/jdk/compare/eb8db12ce67b10957fa94fbf61d9a30db34ec01a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

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

Loading

@openjdk openjdk bot added the ready label May 19, 2021
@jatin-bhateja
Copy link
Member Author

@jatin-bhateja jatin-bhateja commented May 19, 2021

/integrate

Loading

@openjdk openjdk bot closed this May 19, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 19, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 19, 2021

@jatin-bhateja Since your change was applied there have been 246 commits pushed to the master branch:

  • ff84577: 8267098: AArch64: C1 StubFrames end confusingly
  • 0daec49: 8267246: -XX:MaxRAMPercentage=0 is unreasonable for jtreg tests on many-core machines
  • 324defe: 8267212: test/jdk/java/util/Collections/FindSubList.java intermittent crash with "no reachable node should have no use"
  • bdbe23b: 8265462: Handle multiple slots in the NSS Internal Module from SunPKCS11's Secmod
  • 10236e7: 8263242: serviceability/sa/ClhsdbFindPC.java cannot find MaxJNILocalCapacity with ASLR
  • e6705c0: 8266949: Check possibility to disable OperationTimedOut on Unix
  • b92c5a4: 8265292: [macos_aarch64] java/foreign/TestDowncall.java crashes with SIGBUS
  • fadf580: 8262952: [macos_aarch64] os::commit_memory failure
  • f8f40ab: 8230486: G1BarrierSetAssembler::g1_write_barrier_post unnecessarily pushes/pops new_val
  • 9d168e2: 8266973: Migrate to ClassHierarchyIterator when enumerating subclasses
  • ... and 236 more: https://git.openjdk.java.net/jdk/compare/eb8db12ce67b10957fa94fbf61d9a30db34ec01a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 65a8bf5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

@jatin-bhateja jatin-bhateja deleted the JDK-8265126 branch May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants