RFR: 8241371: Refactor and consolidate package_from_name
Lois Foltan
lois.foltan at oracle.com
Mon Mar 23 13:41:57 UTC 2020
On 3/23/2020 6:44 AM, Claes Redestad wrote:
> On 2020-03-23 04:36, Ioi Lam wrote:
>>>>
>>>
>>> Ok, I just felt that as a static utility it's more coupled with a
>>> class/InstanceKlass than its class loader. If you insist I'll move it
>>> to ClassLoader instead.
>>>
>> classLoader.cpp also has other methods related to packages, so I
>> think it's a good place for this method, too. Plus, you don't need to
>> move the test cases, so there's less code churn.
>
> Ok:
>
> http://cr.openjdk.java.net/~redestad/8241371/open.01/
>
> /Claes
Hi Claes,
This looks great, thank you for looking into this improvement! Few
review comments:
- classfile/classLoader.cpp
line #181: ClassLoader::package_from_class_name(), could we remove all
the checks for "if (bad_class_name != NULL)" in favor of an assert ahead
of line #182 that just "assert(bad_class_name != NULL, "caller did not
set bad_class_name correctly");"
line #197: I still wish we could get rid of that do while loop. Would
searching for the last '[' be better performance wise? Like
UTF8::strrchr(start, utf_len, JVM_SIGNATURE_ARRAY)?
- gtest/runtime/test_classLoader.cpp
please include a test that has a multi-dimensional array
Thanks!
Lois
More information about the hotspot-runtime-dev
mailing list