hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
changeset 43673 bf2f6d3f8f5e
parent 39263 d139a133ba27
child 46630 75aa3e39d02c
equal deleted inserted replaced
43672:b188841d7ac8 43673:bf2f6d3f8f5e
   246     }
   246     }
   247 
   247 
   248   } else if ((lf = x->array()->as_LoadField()) != NULL) {
   248   } else if ((lf = x->array()->as_LoadField()) != NULL) {
   249     ciField* field = lf->field();
   249     ciField* field = lf->field();
   250     if (field->is_static_constant()) {
   250     if (field->is_static_constant()) {
   251       assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing");
   251       // Constant field loads are usually folded during parsing.
       
   252       // But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when
       
   253       // holder class is being initialized during parsing (for static fields).
   252       ciObject* c = field->constant_value().as_object();
   254       ciObject* c = field->constant_value().as_object();
   253       if (!c->is_null_object()) {
   255       if (!c->is_null_object()) {
   254         set_constant(c->as_array()->length());
   256         set_constant(c->as_array()->length());
   255       }
   257       }
   256     }
   258     }