< prev index next >

src/share/vm/oops/constantPool.cpp

Print this page




 204         source_file = s->as_C_string();
 205       }
 206     }
 207   }
 208   if (k() != this_cp->pool_holder()) {
 209     // only print something if the classes are different
 210     if (source_file != NULL) {
 211       log_info(classresolve)("%s %s %s:%d",
 212                  this_cp->pool_holder()->external_name(),
 213                  k->external_name(), source_file, line_number);
 214     } else {
 215       log_info(classresolve)("%s %s",
 216                  this_cp->pool_holder()->external_name(),
 217                  k->external_name());
 218     }
 219   }
 220 }
 221 
 222 Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
 223                                    bool save_resolution_error, TRAPS) {
 224   assert(THREAD->is_Java_thread(), "must be a Java thread");




 225 
 226   // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*.
 227   // It is not safe to rely on the tag bit's here, since we don't have a lock, and
 228   // the entry and tag is not updated atomicly.
 229   CPSlot entry = this_cp->slot_at(which);
 230   if (entry.is_resolved()) {
 231     assert(entry.get_klass()->is_klass(), "must be");
 232     // Already resolved - return entry.
 233     return entry.get_klass();
 234   }
 235 
 236   // This tag doesn't change back to unresolved class unless at a safepoint.
 237   if (this_cp->tag_at(which).is_unresolved_klass_in_error()) {
 238     // The original attempt to resolve this constant pool entry failed so find the
 239     // class of the original error and throw another error of the same class
 240     // (JVMS 5.4.3).
 241     // If there is a detail message, pass that detail message to the error.
 242     // The JVMS does not strictly require us to duplicate the same detail message,
 243     // or any internal exception fields such as cause or stacktrace.  But since the
 244     // detail message is often a class name or other literal string, we will repeat it




 204         source_file = s->as_C_string();
 205       }
 206     }
 207   }
 208   if (k() != this_cp->pool_holder()) {
 209     // only print something if the classes are different
 210     if (source_file != NULL) {
 211       log_info(classresolve)("%s %s %s:%d",
 212                  this_cp->pool_holder()->external_name(),
 213                  k->external_name(), source_file, line_number);
 214     } else {
 215       log_info(classresolve)("%s %s",
 216                  this_cp->pool_holder()->external_name(),
 217                  k->external_name());
 218     }
 219   }
 220 }
 221 
 222 Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
 223                                    bool save_resolution_error, TRAPS) {
 224   //assert(THREAD->is_Java_thread(), "must be a Java thread");
 225   // TODO re-enable this assert as soon as we have a better solution
 226   // With ValueTypePassFieldsAsArgs, we need to resolve call sites from the GC thread
 227   // to determine the callee signature in nmethod::preserve_callee_argument_oops().
 228   assert(ValueTypePassFieldsAsArgs || THREAD->is_Java_thread(), "must be a Java thread");
 229 
 230   // A resolved constantPool entry will contain a Klass*, otherwise a Symbol*.
 231   // It is not safe to rely on the tag bit's here, since we don't have a lock, and
 232   // the entry and tag is not updated atomicly.
 233   CPSlot entry = this_cp->slot_at(which);
 234   if (entry.is_resolved()) {
 235     assert(entry.get_klass()->is_klass(), "must be");
 236     // Already resolved - return entry.
 237     return entry.get_klass();
 238   }
 239 
 240   // This tag doesn't change back to unresolved class unless at a safepoint.
 241   if (this_cp->tag_at(which).is_unresolved_klass_in_error()) {
 242     // The original attempt to resolve this constant pool entry failed so find the
 243     // class of the original error and throw another error of the same class
 244     // (JVMS 5.4.3).
 245     // If there is a detail message, pass that detail message to the error.
 246     // The JVMS does not strictly require us to duplicate the same detail message,
 247     // or any internal exception fields such as cause or stacktrace.  But since the
 248     // detail message is often a class name or other literal string, we will repeat it


< prev index next >