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

8268855: Cleanup name handling in the Thread class and subclasses #4569

Closed
wants to merge 2 commits into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Jun 23, 2021

Please review this small cleanup item.

We can simplify and cleanup up name() management:

  • make name() return "const char *" and only cast away constness at API boundaries when essential
  • add type_name() so that we can avoid code like "if (t->is_VM_Thread()) print("VMThread");
  • Rename JavaThread::get_thread_name() to name() (no need for the extra indirection)

There are a couple of minor changes to the appearance of some internal threads in the hs_err log e.g.

0x000055af03e5b1b0 WatcherThread [stack: 0x00007f685df00000,0x00007f685e000000] [id=15952]

is now:

0x000055af03e5b1b0 WatcherThread "VM Periodic Task Thread" [stack: 0x00007f685df00000,0x00007f685e000000] [id=15952]

but this shouldn't affect anything and makes things more consistent.

Notes:

  1. While "override" is the ideal style when declaring overriding methods it has to be applied to all virtual methods in a class. So unless "override" is already used in a class, I did not start using it. I have filed a separate RFE to convert the Thread classes to use "override" consistently.
  2. While there is no need to redeclare a virtual method as "virtual" I kept to the existing style in those classes where changes were made.
  3. I did not override type_name() for all the JavaThread subclasses as it seemed unnecessary, but happy to hear other views on this.

Testing (in progress):

  • All builds in tiers 1-5
  • GHA
  • tiers 1-3 as a sanity test

Thanks,
David


Progress

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

Issue

  • JDK-8268855: Cleanup name handling in the Thread class and subclasses

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4569

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 23, 2021

👋 Welcome back dholmes! 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
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@dholmes-ora 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.

@openjdk openjdk bot added the hotspot label Jun 23, 2021
@dholmes-ora
Copy link
Member Author

@dholmes-ora dholmes-ora commented Jun 23, 2021

/label add hotspot-runtime

@openjdk openjdk bot added the hotspot-runtime label Jun 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@dholmes-ora
The hotspot-runtime label was successfully added.

@dholmes-ora dholmes-ora marked this pull request as ready for review Jun 23, 2021
@openjdk openjdk bot added the rfr label Jun 23, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 23, 2021

Webrevs

Copy link
Member

@lfoltan lfoltan left a comment

Looks good!
Lois

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@dholmes-ora 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:

8268855: Cleanup name handling in the Thread class and subclasses

Reviewed-by: lfoltan, 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 11 new commits pushed to the master branch:

  • f375916: 8269186: [REDO] Remove CodeCache::mark_for_evol_deoptimization() method
  • 7621fa3: 8268464: Remove dependancy of TestHttpsServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/https/ tests
  • f3ba269: 8256306: ObjectMonitor::_contentions field should not be 'jint'
  • 52d5d1b: 8269188: [BACKOUT] Remove CodeCache::mark_for_evol_deoptimization() method
  • f2e690e: 8268720: Unspecified checks on NameAndType constants should not be performed
  • 2c29d79: 8269206: A small typo in comment in test/lib/sun/hotspot/WhiteBox.java
  • 6237630: 8269120: Build failure with GCC 6.3.0 after JDK-8017163
  • a5e4307: 8269134: Remove sparsePRT.inline.hpp after JDK-8017163
  • 17daf32: 8269138: Move typeArrayOop.inline.hpp include to vectorSupport.cpp
  • 36d82b6: 8268858: Determine register pressure automatically by the number of available registers for allocation
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/cd678a383f7b23ea40132b207ddfc041394ba4c1...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 Jun 23, 2021
@navyxliu
Copy link
Member

@navyxliu navyxliu commented Jun 23, 2021

LGTM.

Copy link
Contributor

@coleenp coleenp left a comment

This looks good.

@dholmes-ora
Copy link
Member Author

@dholmes-ora dholmes-ora commented Jun 24, 2021

Thanks for the reviews.

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Jun 24, 2021

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

  • c79034e: 8269303: Remove unnecessary forward declaration of PSPromotionManager in cpCache.hpp
  • 42968db: 8269293: ObjectMonitor thread id fields should be 64 bits.
  • 2fd7943: 8256425: Obsolete Biased Locking in JDK 18
  • 595446b: 8269087: CheckSegmentedCodeCache test fails in an emulated-client VM
  • 7c31903: 8267075: jcmd VM.cds should print directory of the output files
  • e515873: 8269216: Useless initialization in com/sun/crypto/provider/PBES2Parameters.java
  • 51d9159: 8236212: CompiledMethodLoad and CompiledMethodUnload events can be posted in START phase
  • 280f2d5: 8268433: serviceability/dcmd/framework/VMVersionTest.java fails with Unable to send object throw not established PipeIO Listener Thread connection
  • f375916: 8269186: [REDO] Remove CodeCache::mark_for_evol_deoptimization() method
  • 7621fa3: 8268464: Remove dependancy of TestHttpsServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/https/ tests
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/cd678a383f7b23ea40132b207ddfc041394ba4c1...master

Your commit was automatically rebased without conflicts.

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

@openjdk openjdk bot commented Jun 24, 2021

@dholmes-ora Pushed as commit 08ee7ae.

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

@dholmes-ora dholmes-ora deleted the 8268855 branch Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-runtime integrated
4 participants