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
8195744: Avoid calling ClassLoader.checkPackageAccess if security manager is not installed #2410
Conversation
…ager is not installed
|
Webrevs
|
It's good to see this change benefitting from |
Thanks Mandy! It's nice to be able to optimize this. How's this comment? Is it an @implNote ?? |
I think it's better to define |
I didn't think a static final field would have an offset? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Coleen,
Basic optimization looks good. I have a concern over the locking change. Some minor comments below.
Thanks,
David
test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments remain confusing.
Thanks,
David
// This field means that a security manager can be installed so we still have to | ||
// populate the ProtectionDomainCacheTable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this field returns the installed SM if any. It doesn't tell you anything about whether you can install a SM or not (though obviously if non-NULL then you could).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This field tells us that a security manager is installed.
How about I just put this. I had a bug earlier that this explained to me but the allow_security_manager() also explains it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates seem fine to me.
Thanks,
David
@coleenp This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
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 47 new commits pushed to the
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.
|
Thanks for the code review, David. |
Thanks for the code review Ioi, and thank you Mandy for looking at it. |
@coleenp Since your change was applied there have been 47 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit ace8f94. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thanks Mandy! |
This change does not call up to Java for checkPackageAccess if the security manager is NULL, but still saves the protection domain in the pd_set for that dictionary entry. If the option -Djava.security.manager=disallow is set, that means that there will never be a security manager and the JVM code can avoid saving the protection domains completely.
See the two functions java_lang_System::has_security_manager() and java_lang_System::allow_security_manager() for details.
Also deleted ProtectionDomainVerification because there's no use for this option.
Tested with tier1 hotspot, jdk and langtools.
and tier2-6.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2410/head:pull/2410
$ git checkout pull/2410