United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7118863 Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
JDK-7118863 : Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions

Details
Type:
Enhancement
Submit Date:
2011-12-07
Status:
Closed
Updated Date:
2012-03-29
Project Name:
JDK
Resolved Date:
2012-03-29
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23 (b10)

Related Reports
Backport:
Backport:

Sub Tasks

Description
The *Klass::*_offset_in_bytes() functions are used to get the offset to a field in a Klass. All places where they are used, we add something like sizeof(klassOopDesc) to make the offset against the klassOopDesc instead.

For example in opto/memnode.cpp:
 if (tkls->offset() == Klass::access_flags_offset_in_bytes() + (int)sizeof(oopDesc)) {

There's a couple of variants to this:
 instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)
 Klass::access_flags_offset_in_bytes() + (int)sizeof(oopDesc)
 Klass::secondary_supers_offset_in_bytes() + klassOopDesc::header_size() * HeapWordSize
 Klass::java_mirror_offset_in_bytes() klassOopDesc::klass_part_offset_in_bytes()

The proposal is to move all these size adjustments into the *Klass:*_offset_in_bytes() functions.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/069ab3f976d3
                                     
2011-12-21
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/069ab3f976d3
                                     
2012-03-22



Hardware and Software, Engineered to Work Together