Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6516018
Votes 0
Synopsis simplify object layout calculations to enable faster reflection
Category hotspot:compiler2
Reported Against
Release Fixed hs10(b08), 6u4(b03) (Bug ID:2171909) , 7(b08) (Bug ID:2176849)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 6481834 , 6528704 , 6530811
Submit Date 22-JAN-2007
Description
We want to intrinsify (open-code) certain reflective operations, notably metadata queries and heap allocation routines in java.lang.reflect.Array and java.lang.Class.  They are used in many components of modern Java-based systems.  In order to do this, some small cleanups and extensions are needed in src/share/vm/oops/.

We will remove these fields, used for ad hoc optimizations:
 Klass::size_helper
 Klass::is_objArray
 arrayKlass::array_header_in_bytes
 

We will add these fields, which subsume and extend the previous fields with no loss of performance:
 Klass::layout_helper
 arrayKlass::component_mirror
 java_lang_Class::array_klass

The component_mirror and array_klass fields are a bi-directional link between each array klass and the java.lang.Class mirror for the array component type.  They enable optimizable open-coding for the native method java.lang.Class.getComponentType and java.lang.reflect.Array.newInstance.  They work like the pre-existing pair of fields, Klass::java_mirror and java_lang_Class::klass, which are also a bi-directional link.

Relevant comments from klass.hpp:
// The "layout helper" is a combined descriptor of  customer  layout.
// For klasses which are neither instance nor array, the value is zero.
//
// For instances, layout helper is a positive number, the instance size.
// This size is already passed through align_object_size and scaled to bytes.
// The low order bit is set if instances of this class cannot be
// allocated using the fastpath.
//
// For arrays, layout helper is a negative number, containing four
// distinct bytes, as follows:
//    MSB:[tag, ebt, hsz, log2(esz)]:LSB
// where:
//    tag is 0x80 if the elements are non-oops, 0xC0 if oops
//    ebt is the BasicType of the elements
//    esz is the element size in bytes
//    hsz is array header size in bytes (i.e., offset of first element)
// This packed word is arranged so as to be quickly unpacked by the
// various fast paths that use the various subfields.
Posted Date : 2007-01-22 19:35:48.0
Work Around
N/A
Evaluation
yes, done
Posted Date : 2007-02-15 23:47:19.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang