> On Jan 5, 2017, at 8:47 AM, Claes Redestad <[email protected]> wrote:
>
> Hi,
>
> after a round of review comments I've now reworked this to do the
> transformations in the JNI layer rather than inside the VM, with
> similar - if not better - results.
>
> Webrevs:
> http://cr.openjdk.java.net/~redestad/8171855/hotspot.03/
> http://cr.openjdk.java.net/~redestad/8171855/jdk.03/
>
Happy to know the performance gain is comparable when pushing down the
conversion to internal form in native instead of doing it in the VM. This is
good work.
src/java.base/share/native/libjava/Module.c
This can be refactored e.g. adding a new function GetInternalPackageName that
takes a jstring and returns const char*.
GetStringUTFChars will return a copy of the utf-8 chars. That is an
alternative to malloc, GetStringUTFLength, GetStringLength, GetStringUTFRegion
calls. Use ReleaseStringUTFChars to free the copy after use.
Nit: it may be clearer to rename pkgs_len to num_pkgs
src/share/vm/classfile/modules.cpp
49 static bool verify_module_name(const char *module_name) {
To be consistent with the convention in this file: const char*
Otherwise, looks fine.
Mandy