RFR: 8217442: Optimize native accesses to String.value

Aleksey Shipilev shade at redhat.com
Mon Jan 21 15:07:00 UTC 2019


On 1/21/19 2:57 PM, Claes Redestad wrote:
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8217442
> Webrev: http://cr.openjdk.java.net/~redestad/8217442/open.00/

Mostly stylistics:

*) New line here:

 592 }
 593 int java_lang_String::utf8_length(oop java_string) {

*) Seems like new code uses 4-space indent, while the existing style is 2-spaces.

*) Stray space after "value":
  626   typeArrayOop value  = java_lang_String::value(java_string);

*) Pretty sure you need to use oopDesc::equals_raw instead of ==, as "oop::operator==" asserts in
some BarrierSets, e.g. Shenandoah's.

 581   assert(value == java_lang_String::value(java_string),
 582          "value must be same as java_lang_String::value(java_string)");

 612     assert(value == java_lang_String::value(java_string),
 613            "value must be same as java_lang_String::value(java_string)");

-Aleksey



More information about the hotspot-runtime-dev mailing list