RFR: 8272778: Consolidate is_instance and is_instance_inlined in java_lang_String

Albert Mingkun Yang ayang at openjdk.java.net
Fri Aug 20 18:24:30 UTC 2021


On Fri, 20 Aug 2021 15:20:59 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Simple change of merging `is_instance` and `is_instance_inlined`.
>> 
>> Test: build
>
> src/hotspot/share/classfile/javaClasses.inline.hpp line 126:
> 
>> 124: }
>> 125: 
>> 126: bool java_lang_String::is_instance(oop obj) {
> 
> I don't really see anything wrong with this.  is_instance() is called above in asserts but that shouldn't affect performance by increasing the size of generated code.

`is_instance()` is called in non-assertion code as well, e.g. `ConstantPool::add_dumped_interned_strings`. By merging the two versions, one wouldn't use the potentially slower version by accident, and it's also more consistent with `is_instance` of other classes (e.g. `java_lang_Class`) in the same file.

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

PR: https://git.openjdk.java.net/jdk/pull/5201


More information about the shenandoah-dev mailing list