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

8264538: Rename SystemDictionary::parse_stream #3289

Closed
wants to merge 3 commits into from

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Mar 31, 2021

This function is used to call the classfile parser for hidden or anonymous classes, and for use with jvmti RedefineClasses. The latter only calls KlassFactory::create_from_stream and skips the rest of the code in SystemDictionary::parse_stream.

Renamed SystemDictionary::parse_stream -> resolve_hidden_class_from_stream
resolve_from_stream -> resolve_class_from_stream
and have SystemDictionary::resolve_from_stream() call the right version depending on ClassLoadInfo flags. Callers of resolve_from_stream now pass protection domain via. ClassLoadInfo.

So the external API is resolve_from_stream.

Tested with tier1 on 4 Oracle supported platforms.


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/3289/head:pull/3289
$ git checkout pull/3289

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3289

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 31, 2021

👋 Welcome back coleenp! 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 Mar 31, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 31, 2021

@coleenp The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

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

@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 31, 2021

Webrevs

Copy link
Member

@lfoltan lfoltan left a comment

Nice clean up Coleen. One minor comment.

Thanks,
Lois

src/hotspot/share/prims/jvm.cpp Show resolved Hide resolved
@openjdk
Copy link

@openjdk openjdk bot commented Mar 31, 2021

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

8264538: Rename SystemDictionary::parse_stream

Reviewed-by: lfoltan, hseigel

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

  • fdfa1dd: 8264306: Non deterministic generation of java/lang/invoke/MemberName.class
  • 011f6d1: 8264223: CodeHeap::verify fails extra_hops assertion in fastdebug test
  • 0696fd0: 8263496: MetalHighContrastTheme.getControlHighlight cleanup
  • 6cf1095: 8264484: Replace uses of StringBuffer with StringBuilder in jdk.hotspot.agent
  • d2df9a7: 8264331: Use the blessed modifier order in jdk.compiler
  • 0228734: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows
  • 3997c99: 8264222: Use switch expression in jshell where possible
  • 39f0b27: 8176026: SA: Huge heap sizes cause a negative value to be displayed in the jhisto heap total
  • de495df: 8264413: Data is written to file header even if its CRC32 was calculated
  • 52d8a22: 8264054: Bad XMM performance on java.lang.MathBench.sqrtDouble
  • ... and 22 more: https://git.openjdk.java.net/jdk/compare/2c9365d79cffaabd5c4c26ee91a13ca16fa287aa...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 Mar 31, 2021
Copy link
Contributor Author

@coleenp coleenp left a comment

Thank you for reviewing this Lois and Harold. Some replies attached.

src/hotspot/share/prims/jvm.cpp Show resolved Hide resolved
src/hotspot/share/prims/jvmtiRedefineClasses.hpp Outdated Show resolved Hide resolved
hseigel
hseigel approved these changes Apr 1, 2021
Copy link
Member

@hseigel hseigel left a comment

The changes look good!
Thanks, Harold

@coleenp
Copy link
Contributor Author

@coleenp coleenp commented Apr 1, 2021

Thanks Harold and Lois!
/integrate

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

@openjdk openjdk bot commented Apr 1, 2021

@coleenp Since your change was applied there have been 33 commits pushed to the master branch:

  • 80681b5: 8264546: Dependencies: Context class is always an InstanceKlass
  • fdfa1dd: 8264306: Non deterministic generation of java/lang/invoke/MemberName.class
  • 011f6d1: 8264223: CodeHeap::verify fails extra_hops assertion in fastdebug test
  • 0696fd0: 8263496: MetalHighContrastTheme.getControlHighlight cleanup
  • 6cf1095: 8264484: Replace uses of StringBuffer with StringBuilder in jdk.hotspot.agent
  • d2df9a7: 8264331: Use the blessed modifier order in jdk.compiler
  • 0228734: 8262470: Printed GlyphVector outline with low DPI has bad quality on Windows
  • 3997c99: 8264222: Use switch expression in jshell where possible
  • 39f0b27: 8176026: SA: Huge heap sizes cause a negative value to be displayed in the jhisto heap total
  • de495df: 8264413: Data is written to file header even if its CRC32 was calculated
  • ... and 23 more: https://git.openjdk.java.net/jdk/compare/2c9365d79cffaabd5c4c26ee91a13ca16fa287aa...master

Your commit was automatically rebased without conflicts.

Pushed as commit 1dc75e9.

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

@coleenp coleenp deleted the rename-parse-stream branch Apr 1, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 2, 2021

Mailing list message from Coleen Phillimore on hotspot-dev:

On 4/1/21 9:48 AM, Lois Foltan wrote:

On Wed, 31 Mar 2021 21:22:39 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

src/hotspot/share/prims/jvm.cpp line 950:

948: InstanceKlass* ik = NULL;
949: if (!is_hidden) {
950: ClassLoadInfo cl_info(protection_domain);
Minor comment, you could pull the creation of ClassLoadInfo out of this if statement since both the the if and the else sections create a ClassLoadInfo with pretty much the same information.
That other ClassLoadInfo cl_info(protection_domain) you see is from another function, so I can't pull it out.
The other side of the 'if' statement creates a ClassLoadInfo with all the hidden class goodies.
In jvm_lookup_define_class there are 2 ClassLoadInfo cl_info constructions on line #950 and line #961 that could be pull out of the if statement. Again comment is minor and I am ok with how you decide to go forward with it.

Sorry I didn't see this comment in the pull request, and thanks for
explaining that the ClassLoadInfo from the 'else' clause could have been
pulled out of the if statement.? I was thinking the one in the 'if'
clause.? We can change it if we're in the area next time.

Thanks,
Coleen

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