RFR: 8288477: nmethod header size reduction [v4]

Tom Rodriguez never at openjdk.org
Thu Jul 28 18:30:39 UTC 2022


On Thu, 28 Jul 2022 09:31:39 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> src/hotspot/share/jvmci/vmStructs_jvmci.cpp line 258:
>> 
>>> 256:                                                                                                                                      \
>>> 257:   nonstatic_field(nmethod,                     _verified_entry_point,                         address)                               \
>>> 258:   nonstatic_field(nmethod,                     _comp_level,                                   int)                                   \
>> 
>> You should declare CompLevel in this file as well.  I think it might be missing the sanity checking that detect missing type declarations.
>
> Hmm. Actually most of the types used in vmStructs_jvmci.cpp are not declared in VM_TYPES:
> - int, intptr_t, jbyte, jint, jlong, juint, u1, u2, u4, uint, uint64_t, uintptr_t, unsigned int, void*
> - AccessFlags, Annotations*, ClassLoaderData*, CollectedHeap*, CompiledMethod*, ConstMethod*, 
> - JavaFrameAnchor, JavaThread*, MethodCounters*, MethodData*, ObjectWaiter*, OopHandle, OSThread*, Thread*
> 
> is it an issue?

You're right, it's fine to leave it out.  Vladimir had added some sanity checks to the JVMCI vmStructs in https://bugs.openjdk.org/browse/JDK-8237497 and I'd assumed it was all of the checks that the regular vmStructs does but it's not.  The regular VMStructs requires that all reachable types are fully described but JVMCI actually doesn't use the VMTypeEntry/declare_toplevel_type stuff at all.  It's not exposed API so it should be dropped I think.  A debug build will catch the field type mismatches at compile time which is the primary thing we care about, though I think that should enabled in all builds instead of being debug only.  The required checks should fold away or produce a compile time error.  You can see that jvmci_vmStructs_init compiles into an empty method in the fastdebug build.  Anyway, I filed https://bugs.openjdk.org/browse/JDK-8291513 to remove those declarations completely.

-------------

PR: https://git.openjdk.org/jdk/pull/9165


More information about the hotspot-dev mailing list