< prev index next >

src/share/vm/opto/parse3.cpp

Print this page




 296 
 297   if (is_field) {
 298     set_wrote_fields(true);
 299   }
 300 
 301   // If the field is final, the rules of Java say we are in <init> or <clinit>.
 302   // Note the presence of writes to final non-static fields, so that we
 303   // can insert a memory barrier later on to keep the writes from floating
 304   // out of the constructor.
 305   // Any method can write a @Stable field; insert memory barriers after those also.
 306   if (is_field && (field->is_final() || field->is_stable())) {
 307     if (field->is_final()) {
 308         set_wrote_final(true);
 309     }
 310     if (field->is_stable()) {
 311         set_wrote_stable(true);
 312     }
 313 
 314     // Preserve allocation ptr to create precedent edge to it in membar
 315     // generated on exit from constructor.
 316     if (C->eliminate_boxing() &&
 317         adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&
 318         AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {
 319       set_alloc_with_final(obj);
 320     }
 321   }
 322 }
 323 
 324 //=============================================================================
 325 void Parse::do_anewarray() {
 326   bool will_link;
 327   ciKlass* klass = iter().get_klass(will_link);
 328 
 329   // Uncommon Trap when class that array contains is not loaded
 330   // we need the loaded class for the rest of graph; do not
 331   // initialize the container class (see Java spec)!!!
 332   assert(will_link, "anewarray: typeflow responsibility");
 333 
 334   ciObjArrayKlass* array_klass = ciObjArrayKlass::make(klass);
 335   // Check that array_klass object is loaded
 336   if (!array_klass->is_loaded()) {
 337     // Generate uncommon_trap for unloaded array_class
 338     uncommon_trap(Deoptimization::Reason_unloaded,




 296 
 297   if (is_field) {
 298     set_wrote_fields(true);
 299   }
 300 
 301   // If the field is final, the rules of Java say we are in <init> or <clinit>.
 302   // Note the presence of writes to final non-static fields, so that we
 303   // can insert a memory barrier later on to keep the writes from floating
 304   // out of the constructor.
 305   // Any method can write a @Stable field; insert memory barriers after those also.
 306   if (is_field && (field->is_final() || field->is_stable())) {
 307     if (field->is_final()) {
 308         set_wrote_final(true);
 309     }
 310     if (field->is_stable()) {
 311         set_wrote_stable(true);
 312     }
 313 
 314     // Preserve allocation ptr to create precedent edge to it in membar
 315     // generated on exit from constructor.
 316     // can't bind stable with its allocation, only record allocation for final field.
 317     if (field->is_final() && AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {

 318       set_alloc_with_final(obj);
 319     }
 320   }
 321 }
 322 
 323 //=============================================================================
 324 void Parse::do_anewarray() {
 325   bool will_link;
 326   ciKlass* klass = iter().get_klass(will_link);
 327 
 328   // Uncommon Trap when class that array contains is not loaded
 329   // we need the loaded class for the rest of graph; do not
 330   // initialize the container class (see Java spec)!!!
 331   assert(will_link, "anewarray: typeflow responsibility");
 332 
 333   ciObjArrayKlass* array_klass = ciObjArrayKlass::make(klass);
 334   // Check that array_klass object is loaded
 335   if (!array_klass->is_loaded()) {
 336     // Generate uncommon_trap for unloaded array_class
 337     uncommon_trap(Deoptimization::Reason_unloaded,


< prev index next >