JDK-8222537 : Avoid fetching _klass twice in TypeArrayOop::size()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 8-shenandoah,11-shenandoah,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2019-04-16
  • Updated: 2019-07-04
  • Resolved: 2019-07-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
Currently, when calling TypeArrayOop::size(), we end up calling klass() twice: once before calling into size_given_klass() and then again before calling TypeArrayOop::object_size().

This is currently only a minor performance nuisance.

With upcoming Shenandoah's elimination of forwarding pointer, loading klass like this is not safe anymore, and therefore we only call size_given_klass(), and must avoid calling naked klass() altogether.
Comments
This is not an issue anymore. Shenandoah's elimination of forwarding pointer is not using the Klass* field now.
04-07-2019