-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8264142: Remove TRAPS/THREAD parameters for verifier related functions #3194
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
Conversation
|
👋 Welcome back hseigel! A progress list of the required criteria for merging this PR into |
Webrevs
|
gerard-ziemski
left a comment
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 to me.
How did you find these places in the first places? Is there more places possible with this kind of a cleanup?
|
Mailing list message from Ioi Lam on hotspot-runtime-dev: On 3/25/21 11:02 AM, Harold Seigel wrote:
But we have: ? ResourceMark() : ResourceMark(Thread::current()) {} So if the goal is to avoid calling Thread::current(), we do need to pass Thanks |
|
@hseigel 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: 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
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 |
|
Mailing list message from Ioi Lam on hotspot-runtime-dev: On 3/25/21 2:41 PM, Coleen Phillimore wrote:
OK, I agree that whether passing the Thread probably won't make much Thanks |
dholmes-ora
left a comment
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 Harold,
Some good cleanup here, but I have a couple of things that need adjusting - see comments inline.
Thanks,
David
|
|
||
| if (pending_exception != NULL) { | ||
| st->print("Verification for %s has", klassName); | ||
| oop message = java_lang_Throwable::message(PENDING_EXCEPTION); |
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 should be pending_exception
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.
fixed
| void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS) { | ||
| if (HAS_PENDING_EXCEPTION) { | ||
| void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, oop pending_exception) { | ||
| Thread* THREAD = Thread::current(); |
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 is not needed.
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.
removed. Thanks for pointing that out.
| log_info(class, init)("Start class verification for: %s", klass->external_name()); | ||
| if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) { | ||
| ClassVerifier split_verifier(klass, THREAD); | ||
| ClassVerifier split_verifier(THREAD->as_Java_thread(), klass); |
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.
You already have the "jt" JavaThread for this.
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.
Fixed.
| if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) { | ||
| ClassVerifier split_verifier(klass, THREAD); | ||
| ClassVerifier split_verifier(THREAD->as_Java_thread(), klass); | ||
| split_verifier.verify_class(THREAD); |
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.
Can you add the following comment before verify_class please
// We don't use CHECK here, or on inference_verify below, so that we can log any exception.
Thanks
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.
done, thanks for suggesting this.
| // Translate the signature into verification types. | ||
| ConstantPool* cp = _klass->constants(); | ||
| Symbol* const method_sig = cp->symbol_at(sig_index); | ||
| translate_signature(method_sig, sig_verif_types, CHECK_VERIFY(this)); |
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.
CHECK_VERIFY is not directly related to exceptions. Are there really no verification errors possible from all of these calls where CHECK_VERIFY has been removed?
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.
The calls where CHECK_VERIFY's were removed are to functions that deal with signatures. These methods do not check for errors because the signatures have already been verified by classFileParser.cpp in functions such as verify_legal_method_signature() and verify_legal_field_signature().
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.
Okay - thanks for confirming that.
|
I forgot to comment that I'm also surprised that annotations never cause any errors, but if invalid in any way are just ignored. I would have thought that any structural deviations from what is required by JVMS would have resulted in a verification error. David |
dholmes-ora
left a comment
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.
LGTM!
Thanks,
David
| // Translate the signature into verification types. | ||
| ConstantPool* cp = _klass->constants(); | ||
| Symbol* const method_sig = cp->symbol_at(sig_index); | ||
| translate_signature(method_sig, sig_verif_types, CHECK_VERIFY(this)); |
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.
Okay - thanks for confirming that.
|
Thanks Gerard, Ioi, Coleen, and David for the reviews! /integrate |
|
@hseigel Since your change was applied there have been 38 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 19a6ac4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this small change to remove unneeded TRAPS and THREAD parameters from functions in verifier related files. This change was tested with Mach5 tiers 1 and 2 on Linux, Mac OS, and Windows, and tiers 3-5 on Linux x64.
Thanks, Harold
Progress
Issue
Reviewers
Download
To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3194/head:pull/3194$ git checkout pull/3194To update a local copy of the PR:
$ git checkout pull/3194$ git pull https://git.openjdk.java.net/jdk pull/3194/head