Integrated: 8270794: Avoid loading Klass* twice in TypeArrayKlass::oop_size()
Roman Kennke
rkennke at openjdk.java.net
Tue Jul 27 16:41:32 UTC 2021
On Thu, 15 Jul 2021 19:56:04 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> TypeArrayKlass::oop_size() calls into TypoArrayOopDesc::object_size() which loads the Klass* from the object, but this is not necessary because we're coming from TypeArrayKlass.
>
> Note: This came up in Lilliput, where we need to be careful how to load the Klass, and must figure out the object size using oopDesc::size_given_klass() without blindly re-loading the Klass*. Outside of Lilliput I consider this a cosmetic change (i.e. no substantial performance improvement expected because most cases should be covered by layout-helper).
>
> Testing:
> - [x] tier1
> - [x] tier2
This pull request has now been integrated.
Changeset: ea49691f
Author: Roman Kennke <rkennke at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/ea49691f1dbb4f57ed0c5982f004e7aabcd15d13
Stats: 5 lines in 4 files changed: 0 ins; 1 del; 4 mod
8270794: Avoid loading Klass* twice in TypeArrayKlass::oop_size()
Reviewed-by: shade, coleenp
-------------
PR: https://git.openjdk.java.net/jdk/pull/4799
More information about the hotspot-dev
mailing list