-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8267870: Remove unnecessary char_converter during class loading #4173
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
Webrevs
|
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,
Looks like a nice simplification if we never need a general purpose conversion utility.
I take it that Symbol::as_klass_external_name works correctly regardless of whether the name may be unicode or not? i.e that a /
is always truly a slash and not part of some unicode sequence?
Thanks,
David
@@ -135,8 +136,8 @@ objArrayHandle names, typeArrayHandle enabled, TRAPS) { | |||
int index; | |||
for (index = len - 1; p != 0; p = p->next(), --index) { | |||
assert(index >= 0, "length does not match list"); | |||
Handle s = java_lang_String::create_from_str(p->name(), CHECK); | |||
s = java_lang_String::char_converter(s, JVM_SIGNATURE_SLASH, JVM_SIGNATURE_DOT, CHECK); | |||
TempNewSymbol name = SymbolTable::new_symbol(p->name()); |
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.
Why do we need a temp symbol?
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.
Because the new_symbol call will increment the Symbol* refcount in the SymbolTable, it's then copied to the java.lang.String, so the name isn't needed after 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.
Ah I see. The types were confusing me. We start with a char* convert to a Symbol, then convert that back to char* but with the externalized format. The irony there being that it seems these Options start in external format but then get stored in internal format!
No issue.
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.
Yes, Ioi and I discussed this part of the change but since we substitute slashes for dots and then back again, it is correct. Thanks!
@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:
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 25 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 |
Since Symbol* comes from class_name_symbol, it's verified to be valid UTF8 and not unicode, so I believe it's valid to translate '/' to '.' using char conversion. |
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. I check the code paths and they seem to be equivalent to the existing code. A small nit with CHECK_NULL.
Thanks David and Ioi for the code reviews. |
Going to push as commit af13fe1.
Your commit was automatically rebased without conflicts. |
We create a String object from a Symbol, then swap the '/' for '.' characters, and create another String object. Seems wasteful. Removed java_lang_String::char_converted and made externalize_classname take a Symbol.
Tested with tier1-3 in mach5.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4173/head:pull/4173
$ git checkout pull/4173
Update a local copy of the PR:
$ git checkout pull/4173
$ git pull https://git.openjdk.java.net/jdk pull/4173/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4173
View PR using the GUI difftool:
$ git pr show -t 4173
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4173.diff