JDK-6621098 : "* HeapWordSize" for TrackedInitializationLimit is missing in set_output_for_allocation()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2007-10-24
  • Updated: 2011-04-20
  • Resolved: 2011-04-20
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.
JDK 6 Other
6u14Fixed hs12Fixed
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); }
20-02-2008

EVALUATION See description.
24-10-2007