3682 if (oop_type->isa_aryptr()) {
3683 const TypeAryPtr* arytype = oop_type->is_aryptr();
3684 if (arytype->klass()->is_value_array_klass()) {
3685 ciValueArrayKlass* vak = arytype->klass()->as_value_array_klass();
3686 ciValueKlass* vk = vak->element_klass()->as_value_klass();
3687 for (int i = 0, len = vk->nof_nonstatic_fields(); i < len; i++) {
3688 ciField* field = vk->nonstatic_field_at(i);
3689 if (field->offset() >= TrackedInitializationLimit * HeapWordSize)
3690 continue; // do not bother to track really large numbers of fields
3691 int off_in_vt = field->offset() - vk->first_field_offset();
3692 const TypePtr* adr_type = arytype->with_field_offset(off_in_vt)->add_offset(Type::OffsetBot);
3693 int fieldidx = C->get_alias_index(adr_type);
3694 hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
3695 }
3696 } else {
3697 const TypePtr* telemref = oop_type->add_offset(Type::OffsetBot);
3698 int elemidx = C->get_alias_index(telemref);
3699 hook_memory_on_init(*this, elemidx, minit_in, minit_out);
3700 }
3701 } else if (oop_type->isa_instptr()) {
3702 ciInstanceKlass* ik = oop_type->klass()->as_instance_klass();
3703 for (int i = 0, len = ik->nof_nonstatic_fields(); i < len; i++) {
3704 ciField* field = ik->nonstatic_field_at(i);
3705 if (field->offset() >= TrackedInitializationLimit * HeapWordSize)
3706 continue; // do not bother to track really large numbers of fields
3707 // Find (or create) the alias category for this field:
3708 int fieldidx = C->alias_type(field)->index();
3709 hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
3710 }
3711 }
3712 }
3713
3714 // Cast raw oop to the real thing...
3715 Node* javaoop = new CheckCastPPNode(control(), rawoop, oop_type);
3716 javaoop = _gvn.transform(javaoop);
3717 C->set_recent_alloc(control(), javaoop);
3718 assert(just_allocated_object(control()) == javaoop, "just allocated");
3719
3720 #ifdef ASSERT
3721 { // Verify that the AllocateNode::Ideal_allocation recognizers work:
|
3682 if (oop_type->isa_aryptr()) {
3683 const TypeAryPtr* arytype = oop_type->is_aryptr();
3684 if (arytype->klass()->is_value_array_klass()) {
3685 ciValueArrayKlass* vak = arytype->klass()->as_value_array_klass();
3686 ciValueKlass* vk = vak->element_klass()->as_value_klass();
3687 for (int i = 0, len = vk->nof_nonstatic_fields(); i < len; i++) {
3688 ciField* field = vk->nonstatic_field_at(i);
3689 if (field->offset() >= TrackedInitializationLimit * HeapWordSize)
3690 continue; // do not bother to track really large numbers of fields
3691 int off_in_vt = field->offset() - vk->first_field_offset();
3692 const TypePtr* adr_type = arytype->with_field_offset(off_in_vt)->add_offset(Type::OffsetBot);
3693 int fieldidx = C->get_alias_index(adr_type);
3694 hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
3695 }
3696 } else {
3697 const TypePtr* telemref = oop_type->add_offset(Type::OffsetBot);
3698 int elemidx = C->get_alias_index(telemref);
3699 hook_memory_on_init(*this, elemidx, minit_in, minit_out);
3700 }
3701 } else if (oop_type->isa_instptr()) {
3702 set_memory(minit_out, C->get_alias_index(oop_type)); // mark word
3703 ciInstanceKlass* ik = oop_type->klass()->as_instance_klass();
3704 for (int i = 0, len = ik->nof_nonstatic_fields(); i < len; i++) {
3705 ciField* field = ik->nonstatic_field_at(i);
3706 if (field->offset() >= TrackedInitializationLimit * HeapWordSize)
3707 continue; // do not bother to track really large numbers of fields
3708 // Find (or create) the alias category for this field:
3709 int fieldidx = C->alias_type(field)->index();
3710 hook_memory_on_init(*this, fieldidx, minit_in, minit_out);
3711 }
3712 }
3713 }
3714
3715 // Cast raw oop to the real thing...
3716 Node* javaoop = new CheckCastPPNode(control(), rawoop, oop_type);
3717 javaoop = _gvn.transform(javaoop);
3718 C->set_recent_alloc(control(), javaoop);
3719 assert(just_allocated_object(control()) == javaoop, "just allocated");
3720
3721 #ifdef ASSERT
3722 { // Verify that the AllocateNode::Ideal_allocation recognizers work:
|