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

8270059: Remove KVHashtable #4715

Closed
wants to merge 2 commits into from
Closed

Conversation

@iklam
Copy link
Member

@iklam iklam commented Jul 8, 2021

There are now only 2 uses of KVHashtable in the HotSpot code. They can be easily rewritten to use ResourceHashtable and ResizeableResourceHashtable.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4715

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 8, 2021

👋 Welcome back iklam! 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 Jul 8, 2021

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

  • hotspot

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.

Loading

@openjdk openjdk bot added the hotspot label Jul 8, 2021
@iklam iklam marked this pull request as ready for review Jul 8, 2021
@openjdk openjdk bot added the rfr label Jul 8, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Webrevs

Loading

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Ioi,

This seems okay to me. One query: why did the AsyncLogWriter usage have to specify all 7 template parameters when the ArchiveBuilder usage didn't ??

Thanks,
David

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 8, 2021

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

8270059: Remove KVHashtable

Reviewed-by: dholmes, coleenp

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Jul 8, 2021
@iklam
Copy link
Member Author

@iklam iklam commented Jul 8, 2021

Hi Ioi,

This seems okay to me. One query: why did the AsyncLogWriter usage have to specify all 7 template parameters when the ArchiveBuilder usage didn't ??

That's because AsyncLogWriter uses ResourceHashtable and ArchiveBuilder uses ResizeableResourceHashtable. These two templates have different order for the template parameters. It will be all sorted out in https://github.com/iklam/jdk/pull/new/8270061-reorder-resource-hash-params. I will do that after this PR.

Loading

@dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Jul 8, 2021

Thanks for clarifying.

Loading

coleenp
coleenp approved these changes Jul 8, 2021
Copy link
Contributor

@coleenp coleenp left a comment

Nice cleanup!

Loading

bool do_entry(address key, const SourceObjInfo* value) {
delete value->ref();
bool do_entry(address key, const SourceObjInfo& value) {
delete value.ref();
Copy link
Contributor

@coleenp coleenp Jul 8, 2021

Choose a reason for hiding this comment

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

One of the things that I thought that should change with the _src_obj_table is that SourceObjInfo should have a destructor that should call this delete. But then the table would have to take SourceObjInfo elements and not copy from a stack object. I think ResourceHashtable's destructor calls delete on all the nodes. Anyway, that can be a future improvement if you've followed what I mean.

Loading

Copy link
Member Author

@iklam iklam Jul 8, 2021

Choose a reason for hiding this comment

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

Yes, I plan to add calls to the elements' destructors (perhaps both ~K() and ~V()?) in a separate PR. This would be similar to what GrowableArray does when the array elements are removed, or when the array is destroyed.

To do this, we need to get SourceObjInfo to work with C++ Move Semantics so that the _ref field will not be freed more than once. I am still trying to learn how that works ....

Loading

@iklam
Copy link
Member Author

@iklam iklam commented Jul 9, 2021

Thanks @dholmes-ora and @coleenp for the review.
/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 9, 2021

Going to push as commit d6c0f5f.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 7bfa39f: 8270108: Update JCov version to 3.0.9

Your commit was automatically rebased without conflicts.

Loading

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

@openjdk openjdk bot commented Jul 9, 2021

@iklam Pushed as commit d6c0f5f.

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

Loading

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