src/hotspot/share/oops/constantPool.cpp
changeset 59247 56bf71d64d51
parent 58291 a013100f7a35
child 59252 623722a6aeb9
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
   230     build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
   230     build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
   231 
   231 
   232   symbol_at_put(name_index, name);
   232   symbol_at_put(name_index, name);
   233   name->increment_refcount();
   233   name->increment_refcount();
   234   Klass** adr = resolved_klasses()->adr_at(resolved_klass_index);
   234   Klass** adr = resolved_klasses()->adr_at(resolved_klass_index);
   235   OrderAccess::release_store(adr, k);
   235   Atomic::release_store(adr, k);
   236 
   236 
   237   // The interpreter assumes when the tag is stored, the klass is resolved
   237   // The interpreter assumes when the tag is stored, the klass is resolved
   238   // and the Klass* non-NULL, so we need hardware store ordering here.
   238   // and the Klass* non-NULL, so we need hardware store ordering here.
   239   if (k != NULL) {
   239   if (k != NULL) {
   240     release_tag_at_put(class_index, JVM_CONSTANT_Class);
   240     release_tag_at_put(class_index, JVM_CONSTANT_Class);
   247 void ConstantPool::klass_at_put(int class_index, Klass* k) {
   247 void ConstantPool::klass_at_put(int class_index, Klass* k) {
   248   assert(k != NULL, "must be valid klass");
   248   assert(k != NULL, "must be valid klass");
   249   CPKlassSlot kslot = klass_slot_at(class_index);
   249   CPKlassSlot kslot = klass_slot_at(class_index);
   250   int resolved_klass_index = kslot.resolved_klass_index();
   250   int resolved_klass_index = kslot.resolved_klass_index();
   251   Klass** adr = resolved_klasses()->adr_at(resolved_klass_index);
   251   Klass** adr = resolved_klasses()->adr_at(resolved_klass_index);
   252   OrderAccess::release_store(adr, k);
   252   Atomic::release_store(adr, k);
   253 
   253 
   254   // The interpreter assumes when the tag is stored, the klass is resolved
   254   // The interpreter assumes when the tag is stored, the klass is resolved
   255   // and the Klass* non-NULL, so we need hardware store ordering here.
   255   // and the Klass* non-NULL, so we need hardware store ordering here.
   256   release_tag_at_put(class_index, JVM_CONSTANT_Class);
   256   release_tag_at_put(class_index, JVM_CONSTANT_Class);
   257 }
   257 }
   523   // logging for class+resolve.
   523   // logging for class+resolve.
   524   if (log_is_enabled(Debug, class, resolve)){
   524   if (log_is_enabled(Debug, class, resolve)){
   525     trace_class_resolution(this_cp, k);
   525     trace_class_resolution(this_cp, k);
   526   }
   526   }
   527   Klass** adr = this_cp->resolved_klasses()->adr_at(resolved_klass_index);
   527   Klass** adr = this_cp->resolved_klasses()->adr_at(resolved_klass_index);
   528   OrderAccess::release_store(adr, k);
   528   Atomic::release_store(adr, k);
   529   // The interpreter assumes when the tag is stored, the klass is resolved
   529   // The interpreter assumes when the tag is stored, the klass is resolved
   530   // and the Klass* stored in _resolved_klasses is non-NULL, so we need
   530   // and the Klass* stored in _resolved_klasses is non-NULL, so we need
   531   // hardware store ordering here.
   531   // hardware store ordering here.
   532   this_cp->release_tag_at_put(which, JVM_CONSTANT_Class);
   532   this_cp->release_tag_at_put(which, JVM_CONSTANT_Class);
   533   return k;
   533   return k;