United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6621098 "* HeapWordSize" for TrackedInitializationLimit is missing in set_output_for_allocation()
6621098 : "* HeapWordSize" for TrackedInitializationLimit is missing in set_output_for_allocation()

Details
Type:
Bug
Submit Date:
2007-10-24
Status:
Closed
Updated Date:
2011-04-20
Project Name:
JDK
Resolved Date:
2011-04-20
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs12

Related Reports
Backport:
Backport:

Sub Tasks

Description
I investigated EA problem when I see NULL pointer
exception of the oop field of scalar replaced object.
And during investigation I noticed that InitializeNode
doesn't cover all fields. Looking further I found
that global flag TrackedInitializationLimit is treated
differently:

c2_globals.hpp
   product(intx, TrackedInitializationLimit, 50,                             \
           "When initializing fields, track up to this many words")          \

GraphKit::set_output_for_allocation()

2810         if (field->offset() >= TrackedInitializationLimit)
2811           continue;  // do not bother to track really large numbers of fields

InitializeNode::captured_store_insertion_point()

2075   // after a certain size, we bail out on tracking all the stores:
2076   intptr_t ti_limit = (TrackedInitializationLimit * HeapWordSize);
2077   if (start >= ti_limit)  return FAIL;

It seems, "* HeapWordSize" is missing in set_output_for_allocation().
As result, my field with offset +48 was initialized to 0, but with offset
+56 is not.

                                    

Comments
SUGGESTED FIX

***************
*** 2809,2819 ****
        hook_memory_on_init(*this, elemidx, minit_in, minit_out);
      } else if (oop_type->isa_instptr()) {
        ciInstanceKlass* ik = oop_type->klass()->as_instance_klass();
        for (int i = 0, len = ik->nof_nonstatic_fields(); i < len; i++) {
          ciField* field = ik->nonstatic_field_at(i);
!         if (field->offset() >= TrackedInitializationLimit)
            continue;  // do not bother to track really large numbers of fields
          // Find (or create) the alias category for this field:
          int fieldidx = C->alias_type(field)->index();
          hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
        }
--- 2809,2819 ----
        hook_memory_on_init(*this, elemidx, minit_in, minit_out);
      } else if (oop_type->isa_instptr()) {
        ciInstanceKlass* ik = oop_type->klass()->as_instance_klass();
        for (int i = 0, len = ik->nof_nonstatic_fields(); i < len; i++) {
          ciField* field = ik->nonstatic_field_at(i);
!         if (field->offset() >= TrackedInitializationLimit * HeapWordSize)
            continue;  // do not bother to track really large numbers of fields
          // Find (or create) the alias category for this field:
          int fieldidx = C->alias_type(field)->index();
          hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
        }
                                     
2008-02-20
EVALUATION

See description.
                                     
2007-10-24



Hardware and Software, Engineered to Work Together