src/hotspot/share/oops/instanceKlass.cpp
changeset 53864 81a9748bc86c
parent 53838 c8c9bd65c198
child 53884 1a7b57d02107
equal deleted inserted replaced
53863:d001808c57e8 53864:81a9748bc86c
   181     else {
   181     else {
   182       Symbol* name = _constants->klass_name_at(cp_index);
   182       Symbol* name = _constants->klass_name_at(cp_index);
   183       if (name == k->name()) {
   183       if (name == k->name()) {
   184         log_trace(class, nestmates)("- Found it at nest_members[%d] => cp[%d]", i, cp_index);
   184         log_trace(class, nestmates)("- Found it at nest_members[%d] => cp[%d]", i, cp_index);
   185 
   185 
   186         // names match so check actual klass - this may trigger class loading if
   186         // Names match so check actual klass - this may trigger class loading if
   187         // it doesn't match (but that should be impossible)
   187         // it doesn't match (though that should be impossible). But to be safe we
       
   188         // have to check for a compiler thread executing here.
       
   189         if (!THREAD->can_call_java() && !_constants->tag_at(cp_index).is_klass()) {
       
   190           log_trace(class, nestmates)("- validation required resolution in an unsuitable thread");
       
   191           return false;
       
   192         }
       
   193 
   188         Klass* k2 = _constants->klass_at(cp_index, CHECK_false);
   194         Klass* k2 = _constants->klass_at(cp_index, CHECK_false);
   189         if (k2 == k) {
   195         if (k2 == k) {
   190           log_trace(class, nestmates)("- class is listed as a nest member");
   196           log_trace(class, nestmates)("- class is listed as a nest member");
   191           return true;
   197           return true;
   192         }
   198         }
   294            k->external_name(),
   300            k->external_name(),
   295            k->class_loader_data()->loader_name_and_id(),
   301            k->class_loader_data()->loader_name_and_id(),
   296            error);
   302            error);
   297       }
   303       }
   298 
   304 
   299       if (validationException != NULL) {
   305       if (validationException != NULL && THREAD->can_call_java()) {
   300         ResourceMark rm(THREAD);
   306         ResourceMark rm(THREAD);
   301         Exceptions::fthrow(THREAD_AND_LOCATION,
   307         Exceptions::fthrow(THREAD_AND_LOCATION,
   302                            validationException,
   308                            validationException,
   303                            "Type %s (loader: %s) is not a nest member of %s (loader: %s): %s",
   309                            "Type %s (loader: %s) is not a nest member of %s (loader: %s): %s",
   304                            this->external_name(),
   310                            this->external_name(),