Skip to content

Conversation

@iklam
Copy link
Member

@iklam iklam commented Aug 21, 2023

I added some documentation to make it easier to understand loaderConstraints.cpp. Please review and check if my description is actually correct. Thanks!


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8314684: Add overview docs to loaderConstraints.cpp (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15372/head:pull/15372
$ git checkout pull/15372

Update a local copy of the PR:
$ git checkout pull/15372
$ git pull https://git.openjdk.org/jdk.git pull/15372/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15372

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15372.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 21, 2023

👋 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 21, 2023
@openjdk
Copy link

openjdk bot commented Aug 21, 2023

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Aug 21, 2023
@mlbridge
Copy link

mlbridge bot commented Aug 21, 2023

Webrevs

Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

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

Looks good. Just noticed some typos.

//
// Management of LoaderConstraints
//
// When the SyswtemDictionary decides that loader_x and loader_y must resolve the name N to the same class:
Copy link
Member

Choose a reason for hiding this comment

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

Typo: SyswtemDictionary should be SystemDictionary

// we assign _klass_<m> = K;
//
// if _klass_<m> is non-null, when a loader loader_<m><n> tries to resolve the name N to a class K,
// where _klass_<m> != K, a LinkageError is thrown, and the resolution fails;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: '.' instead of ';'

// both loader_x and loader_y;
//
// Otherwise if LoaderConstraint_x exists but LoaderConstraint_y doesn't exist, add loader_y to LoaderConstraint_x;
// (and vice versa);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: s/and/or
Also, I think the parentheses could be removed.

@openjdk
Copy link

openjdk bot commented Aug 21, 2023

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

8314684: Add overview docs to loaderConstraints.cpp

Reviewed-by: ccheung, dholmes

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

  • 7e843c2: 8284772: GHA: Use GCC Major Version Dependencies Only
  • ba6cdbe: 8309214: sun/security/pkcs11/KeyStore/CertChainRemoval.java fails after 8301154
  • 9f4a9fe: 8312434: SPECjvm2008/xml.transform with CDS fails with "can't seal package nu.xom"
  • 7c169a4: 8312232: Remove sun.jvm.hotspot.runtime.VM.buildLongFromIntsPD()
  • 2eae13c: 8214248: (fs) Files:mismatch spec clarifications
  • ce1ded1: 8314749: Remove unimplemented _Copy_conjoint_oops_atomic
  • 32bf468: 8314274: G1: Fix -Wconversion warnings around G1CardSetArray::_data
  • eb06572: 8313408: Use SVG for BoxLayout example
  • 20e9478: 8314426: runtime/os/TestTrimNative.java is failing on slow machines
  • 69d900d: 8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev
  • ... and 7 more: https://git.openjdk.org/jdk/compare/78f74bc8ff1e673991d91a55ef70880d9fb3f6b5...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 Pull request is ready to be integrated label Aug 21, 2023
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Well it reads really well and is informative, but is it correct? Hard to evaluate. It would be clearer if the commentary tied into the code more so that I knew where to see each of the things mentioned, and also understand how the different types (LoaderConstraint, ConstraintSet) fit in that description.

Thanks.

@iklam
Copy link
Member Author

iklam commented Aug 22, 2023

Well it reads really well and is informative, but is it correct? Hard to evaluate. It would be clearer if the commentary tied into the code more so that I knew where to see each of the things mentioned, and also understand how the different types (LoaderConstraint, ConstraintSet) fit in that description.

Thanks.

I added ConstraintSet to the comments. I also added references to the add_entry and check_or_update functions which are the main entry points.

I have skipped some details to avoid being verbose. For example, add_entry won't add anything to the table if the two loaders have already resolved different classes for the same name.

//
// Otherwise if both LoaderConstraints have different values for _klass, a LinkageError is thrown.
//
// Otherwise the two LoaderConstraints are merged into one.
Copy link
Member

Choose a reason for hiding this comment

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

So I looked in LoaderConstraintTable::add_entry to see how this algorithm applied and I could not figure out what condition is actually left (regarding pp1 and pp2) when we get to the merge case at L396 ???

Copy link
Member

Choose a reason for hiding this comment

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

Never mind I see it now: pp1 != pp2 and neither is null.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Thanks for the update.

Looks good - very useful.

@iklam
Copy link
Member Author

iklam commented Aug 27, 2023

Thanks for the review @calvinccheung and @dholmes-ora
/integrate

@openjdk
Copy link

openjdk bot commented Aug 27, 2023

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

  • acd9310: 8313430: [JVMCI] fatal error: Never compilable: in JVMCI shutdown
  • 8a5db6b: 8237542: JMapHeapConfigTest.java doesn't work with negative jlong values
  • d0cc043: 8314550: [macosx-aarch64] serviceability/sa/TestJmapCore.java fails with "sun.jvm.hotspot.debugger.UnmappedAddressException: 801000800"
  • 837d2e1: 8314483: Optionally override copyright header in generated source
  • 3201623: 8310454: Introduce static-libs-graal bundle
  • e9ba8d5: 8314960: Add Certigna Root CA - 2
  • 837cf85: 8312547: Max/Min nodes Value implementation could be improved
  • 7342f5a: 8314333: Update com/sun/jdi/ProcessAttachTest.java to use ProcessTools.createTestJvm(..)
  • f139f30: 8315033: Problemlist java/lang/template/StringTemplateTest.java
  • f2383b3: 8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection
  • ... and 51 more: https://git.openjdk.org/jdk/compare/78f74bc8ff1e673991d91a55ef70880d9fb3f6b5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 27, 2023
@openjdk openjdk bot closed this Aug 27, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 27, 2023
@openjdk
Copy link

openjdk bot commented Aug 27, 2023

@iklam Pushed as commit 752a438.

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

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

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants