Skip to content
This repository has been archived by the owner. It is now read-only.

8268522: InstanceKlass::can_be_verified_at_dumptime() returns opposite value #31

Conversation

calvinccheung
Copy link
Member

@calvinccheung calvinccheung commented Jun 11, 2021

Please review this small patch:

  • correct the return value of InstanceKlass::can_be_verified_at_dumptime() to match the function's name;

  • modify the call sites accordingly.

  • mach5 tiers 1,2,3


Progress

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

Issue

  • JDK-8268522: InstanceKlass::can_be_verified_at_dumptime() returns opposite value

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31

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

Using diff file

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

@calvinccheung
Copy link
Member Author

calvinccheung commented Jun 11, 2021

/label add hotspot-runtime

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 11, 2021

👋 Welcome back ccheung! 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 hotspot-runtime hotspot-runtime-dev@openjdk.java.net label Jun 11, 2021
@openjdk
Copy link

openjdk bot commented Jun 11, 2021

@calvinccheung
The hotspot-runtime label was successfully added.

@calvinccheung calvinccheung marked this pull request as ready for review Jun 11, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 11, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 11, 2021

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Calvin,

The logic negation seems fine.

The change to shared_old_class also seems fine in general.

But there is one change that I'm querying as it seems a functional change.

Thanks,
David

m->method_holder()->verified_at_dump_time() &&
klass->verified_at_dump_time()) {
Copy link
Member

@dholmes-ora dholmes-ora Jun 11, 2021

Choose a reason for hiding this comment

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

This change seems to go beyond the simple logic negation. Why the change here?

Copy link
Member Author

@calvinccheung calvinccheung Jun 11, 2021

Choose a reason for hiding this comment

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

Hi David,

Thanks for your review!

The block of code you mentioned is being called during runtime. So it is more consistent to call verified_at_dump_time().

Thanks,
Calvin

@openjdk
Copy link

openjdk bot commented Jun 11, 2021

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

8268522: InstanceKlass::can_be_verified_at_dumptime() returns opposite value

Reviewed-by: dholmes, minqi, iklam

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

  • 6171ae4: 8268630: ProblemList serviceability/jvmti/CompiledMethodLoad/Zombie.java on linux-aarch64
  • 01054e6: 8268470: CDS dynamic dump asserts with JFR RecordingStream
  • e39346e: 8268093: Manual Testcase: "sun/security/krb5/config/native/TestDynamicStore.java" Fails with NPE
  • cce8da2: 8268602: a couple runtime/os tests don't check exit code
  • da043e9: 8268555: Update HttpClient tests that use ITestContext to jtreg 6+1
  • a437ce8: 8268580: runtime/memory/LargePages/TestLargePagesFlags.java should be run in driver mode
  • bd9c2fa: 8268565: runtime/records/RedefineRecord.java should be run in driver mode
  • e3eef3b: 8268576: jdk/jfr/event/gc/collection/TestSystemGc.java fails
  • 7b2e7d8: 8268525: Some new memory leak after JDK-8248268 and JDK-8255557
  • 53b6e2c: 8267448: Add "ulimit -a" to environment.html

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Pull request is ready to be integrated label Jun 11, 2021
yminqi
yminqi approved these changes Jun 12, 2021
Copy link
Contributor

@yminqi yminqi left a comment

LGTM.

Copy link
Member

@iklam iklam left a comment

Just one request for change. The rest looks good to me.

set_is_shared_old_klass();
if (!can_be_verified_at_dumptime()) {
// Clear the _verified_at_dump_time bit.
clear_verified_at_dump_time();
Copy link
Member

@iklam iklam Jun 12, 2021

Choose a reason for hiding this comment

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

I think it's better to change this to

if (can_be_verified_at_dumptime()) {
  // Remember this so we can avoid walking the hierarchy at runtime.
  set_verified_at_dump_time();

and do not set this bit inside Klass::Klass(). This way, all the code that changes this bit are kept in a single place.

Copy link
Member Author

@calvinccheung calvinccheung Jun 12, 2021

Choose a reason for hiding this comment

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

Thanks Ioi.

I've pushed an update with your suggestion.

@calvinccheung
Copy link
Member Author

calvinccheung commented Jun 12, 2021

LGTM.

Thanks Yumin.

iklam
iklam approved these changes Jun 12, 2021
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Update looks good.

Thanks,
David

@calvinccheung
Copy link
Member Author

calvinccheung commented Jun 14, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jun 14, 2021

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

  • abe20c1: 8268333: javac crashes when pattern matching switch contains default case which is not last
  • b318535: 8267579: Thread::cooked_allocated_bytes() hits assert(left >= right) failed: avoid underflow
  • fe48ea9: 8268342: java/foreign/channels/TestAsyncSocketChannels.java fails with "IllegalStateException: This segment is already closed"
  • 6171ae4: 8268630: ProblemList serviceability/jvmti/CompiledMethodLoad/Zombie.java on linux-aarch64
  • 01054e6: 8268470: CDS dynamic dump asserts with JFR RecordingStream
  • e39346e: 8268093: Manual Testcase: "sun/security/krb5/config/native/TestDynamicStore.java" Fails with NPE
  • cce8da2: 8268602: a couple runtime/os tests don't check exit code
  • da043e9: 8268555: Update HttpClient tests that use ITestContext to jtreg 6+1
  • a437ce8: 8268580: runtime/memory/LargePages/TestLargePagesFlags.java should be run in driver mode
  • bd9c2fa: 8268565: runtime/records/RedefineRecord.java should be run in driver mode
  • ... and 3 more: https://git.openjdk.java.net/jdk17/compare/5b8c51f59a5f23930ee43bea30201c1ff88c44cd...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jun 14, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 14, 2021
@openjdk
Copy link

openjdk bot commented Jun 14, 2021

@calvinccheung Pushed as commit c088d09.

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

@calvinccheung calvinccheung deleted the 8268522-InstanceKlass-can-be-verified-at-dumptime branch Jun 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.java.net integrated Pull request has been integrated
4 participants