< 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,
 339                   Deoptimization::Action_reinterpret,




 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 (AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {
 317       if (field->is_final()) {

 318         set_alloc_with_final(obj);
 319       }
 320       if (field->is_stable()) {
 321         set_alloc_with_stable(obj);
 322       }
 323     }
 324     else if (field->is_stable()) {
 325       // stable field doesn't have allocation, set alloc_with_stable as NULL
 326       // because its initialize vlaue is NodeSentinel. If not set NULL, 
 327       // next set_alloc_with_stable call might set none-NULL value successfully.  
 328       set_alloc_with_stable(NULL);
 329     }
 330   }
 331 }
 332 
 333 //=============================================================================
 334 void Parse::do_anewarray() {
 335   bool will_link;
 336   ciKlass* klass = iter().get_klass(will_link);
 337 
 338   // Uncommon Trap when class that array contains is not loaded
 339   // we need the loaded class for the rest of graph; do not
 340   // initialize the container class (see Java spec)!!!
 341   assert(will_link, "anewarray: typeflow responsibility");
 342 
 343   ciObjArrayKlass* array_klass = ciObjArrayKlass::make(klass);
 344   // Check that array_klass object is loaded
 345   if (!array_klass->is_loaded()) {
 346     // Generate uncommon_trap for unloaded array_class
 347     uncommon_trap(Deoptimization::Reason_unloaded,
 348                   Deoptimization::Action_reinterpret,


< prev index next >