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

8277824: Remove empty RefProcSubPhasesWorkerTimeTracker destructor #6555

Closed
wants to merge 2 commits into from

Conversation

albertnetymk
Copy link
Member

@albertnetymk albertnetymk commented Nov 25, 2021

Simple change removing effectively dead code, and some general cleanup.

Test: hotspot_gc


Progress

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

Issue

  • JDK-8277824: Remove empty RefProcSubPhasesWorkerTimeTracker destructor

Reviewers

Contributors

  • Kim Barrett <kbarrett@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6555

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 25, 2021

👋 Welcome back ayang! 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.

@openjdk openjdk bot added the rfr label Nov 25, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

@albertnetymk The following label will be automatically applied to this pull request:

  • hotspot-gc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-gc label Nov 25, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 25, 2021

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm and trivial.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

@albertnetymk 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:

8277824: Remove empty RefProcSubPhasesWorkerTimeTracker destructor

Co-authored-by: Kim Barrett <kbarrett@openjdk.org>
Reviewed-by: tschatzl, kbarrett

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 39 new commits pushed to the master branch:

  • 27299ea: 8277803: vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001 fails with "Synthetic fields not found"
  • 560f9c9: 8277426: Optimize mask reduction operations on x86
  • 3a4a94e: 8277854: The upper bound of GCCardSizeInBytes should be limited to 512 for 32-bit platforms
  • 825e633: 8277944: JDK 18 - update GA Release Date
  • 3d39f09: 8277654: Shenandoah: Don't produce new memory state in C2 LRB runtime call
  • 05ab176: 8277797: Remove undefined/unused SharedRuntime::trampoline_size()
  • ad51d06: 8277789: G1: G1CardSetConfiguration prefixes num_ and max_ used interchangeably
  • 614c6e6: 8277878: Fix compiler tests after JDK-8275908
  • 960bdde: 8277904: G1: Remove G1CardSetArray::max_entries
  • 45e8973: 8277896: Remove unused BOTConstants member methods
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/b5841ba3f3d079f3cfee532a4e7f23b00f5cd063...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.

@openjdk openjdk bot added the ready label Nov 25, 2021
protected:
WorkerDataArray<double>* _worker_time;
double _start_time;
uint _worker_id;
public:
RefProcWorkerTimeTracker(WorkerDataArray<double>* worker_time, uint worker_id);
virtual ~RefProcWorkerTimeTracker();
~RefProcWorkerTimeTracker();

Choose a reason for hiding this comment

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

The usual guideline is that the destructor for a baseclass should be either
public and virtual or protected and non-virtual. This prevents destructor
slicing by delete. That the base class in question is a StackObj mitigates
against that kind of error.

And indeed, if I recall correctly, because it's now a StackObj its destructor
can't be virtual, because that would run afoul of the induced "deleting
destructor".

There are some relevant warning options that I occasionally look at and
remember why I think they aren't right for us, so we can't ever enable them
(-Wdelete-non-virtual-dtor and -Wnon-virtual-dtor).

But all that is kind of irrelevant. The real design problem here is that
RefProcSubPhasesWorkerTimeTracker is derived from RefProcWorkerTimeTracker.
It should instead have a RefProceWorkerTimeTracker. That would eliminate
all the discussion about base class destructors, and would also make
RefProcWorkerTimeTracker no longer need to perform double-duty as both a base
class and as a concrete class (which is often problematic).

@albertnetymk
Copy link
Member Author

@albertnetymk albertnetymk commented Nov 29, 2021

Switched to composition from inheritance as suggested.

/contributor add kbarrett

@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

@albertnetymk
Contributor Kim Barrett <kbarrett@openjdk.org> successfully added.

Copy link
Contributor

@tschatzl tschatzl left a comment

Still good.

Copy link

@kimbarrett kimbarrett left a comment

Looks good.

@albertnetymk
Copy link
Member Author

@albertnetymk albertnetymk commented Nov 30, 2021

Thanks for the review.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 30, 2021

Going to push as commit fde6fe7.
Since your change was applied there have been 39 commits pushed to the master branch:

  • 27299ea: 8277803: vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001 fails with "Synthetic fields not found"
  • 560f9c9: 8277426: Optimize mask reduction operations on x86
  • 3a4a94e: 8277854: The upper bound of GCCardSizeInBytes should be limited to 512 for 32-bit platforms
  • 825e633: 8277944: JDK 18 - update GA Release Date
  • 3d39f09: 8277654: Shenandoah: Don't produce new memory state in C2 LRB runtime call
  • 05ab176: 8277797: Remove undefined/unused SharedRuntime::trampoline_size()
  • ad51d06: 8277789: G1: G1CardSetConfiguration prefixes num_ and max_ used interchangeably
  • 614c6e6: 8277878: Fix compiler tests after JDK-8275908
  • 960bdde: 8277904: G1: Remove G1CardSetArray::max_entries
  • 45e8973: 8277896: Remove unused BOTConstants member methods
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/b5841ba3f3d079f3cfee532a4e7f23b00f5cd063...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Nov 30, 2021

@albertnetymk Pushed as commit fde6fe7.

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

@albertnetymk albertnetymk deleted the rp-time-tracker branch Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants