RFR: 8337622: IllegalArgumentException in java.lang.reflect.Field.get

David Holmes dholmes at openjdk.org
Thu Aug 8 05:04:32 UTC 2024


On Wed, 7 Aug 2024 18:32:18 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Make the object init_lock be an injected field in the mirror so that reflecting on componentType will not inadvertently return the init_lock.  The init_lock is a Java object and the VM holds it during class linking and uses it to set state during class initialization.
> Tested with tier1-8.

Looks good but I have to wonder about the effect on memory footprint?

Thanks

src/hotspot/share/classfile/javaClasses.cpp line 1467:

> 1465: void java_lang_Class::serialize_offsets(SerializeClosure* f) {
> 1466:   f->do_bool(&_offsets_computed);
> 1467:   f->do_u4((u4*)&_init_lock_offset);

I can't figure out exactly what this code does and why the old code needed this to be explicit. ??

test/hotspot/jtreg/runtime/reflect/ComponentTypeFieldTest.java line 2:

> 1: /*
> 2:  * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.

New test should only have 2024 copyright year?

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

PR Review: https://git.openjdk.org/jdk/pull/20498#pullrequestreview-2226854674
PR Review Comment: https://git.openjdk.org/jdk/pull/20498#discussion_r1708616616
PR Review Comment: https://git.openjdk.org/jdk/pull/20498#discussion_r1708608491


More information about the hotspot-runtime-dev mailing list