RFR[XS]: 8238272: Eliminate cast_from_oop to narrowOop*
Kim Barrett
kim.barrett at oracle.com
Fri Jan 31 06:51:28 UTC 2020
Please review this change to ObjArrayKlass::oop_oop_iterate_range to
eliminate a conditional cast_from_oop to either either narrowOop* or
oop*. Casting an oop to either of those types seems pretty
questionable, and is not actually necessary here.
(This appears to be the *only* place where cast_from_oop<narrowOop*>()
is used. There are other casts to oop* that should be examined.)
This change has the additional minor benefit that it allows the
compiler to eliminate the lower bounds clamp when start is a constant
zero, and eliminates the conditional test for zero when it isn't a
constant.
CR:
https://bugs.openjdk.java.net/browse/JDK-8238272
Webrev:
https://cr.openjdk.java.net/~kbarrett/8238272/open.00/
Testing:
mach5 tier1-5
Compared gcc generated code for linux-x64 with and without the change
for calls with and without a literal 0 start index.
More information about the hotspot-dev
mailing list