hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 33160 c59f1676d27e
parent 32349 8b5eb3750c41
child 33198 b37ad9fbf681
equal deleted inserted replaced
33159:89b942323bd1 33160:c59f1676d27e
    64 #include "utilities/ticks.hpp"
    64 #include "utilities/ticks.hpp"
    65 #if INCLUDE_CDS
    65 #if INCLUDE_CDS
    66 #include "classfile/sharedClassUtil.hpp"
    66 #include "classfile/sharedClassUtil.hpp"
    67 #include "classfile/systemDictionaryShared.hpp"
    67 #include "classfile/systemDictionaryShared.hpp"
    68 #endif
    68 #endif
       
    69 #if INCLUDE_JVMCI
       
    70 #include "jvmci/jvmciRuntime.hpp"
       
    71 #endif
    69 #if INCLUDE_TRACE
    72 #if INCLUDE_TRACE
    70 #include "trace/tracing.hpp"
    73 #include "trace/tracing.hpp"
    71 #endif
    74 #endif
    72 
    75 
    73 Dictionary*            SystemDictionary::_dictionary          = NULL;
    76 Dictionary*            SystemDictionary::_dictionary          = NULL;
   226 
   229 
   227 
   230 
   228 // Forwards to resolve_instance_class_or_null
   231 // Forwards to resolve_instance_class_or_null
   229 
   232 
   230 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
   233 Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) {
   231   assert(!THREAD->is_Compiler_thread(),
   234   assert(THREAD->can_call_java(),
   232          err_msg("can not load classes with compiler thread: class=%s, classloader=%s",
   235          err_msg("can not load classes with compiler thread: class=%s, classloader=%s",
   233                  class_name->as_C_string(),
   236                  class_name->as_C_string(),
   234                  class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
   237                  class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
   235   if (FieldType::is_array(class_name)) {
   238   if (FieldType::is_array(class_name)) {
   236     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
   239     return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
  1915   // JSR 292 classes
  1918   // JSR 292 classes
  1916   WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
  1919   WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
  1917   WKID jsr292_group_end   = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
  1920   WKID jsr292_group_end   = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
  1918   initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
  1921   initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
  1919   initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
  1922   initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
  1920   initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
  1923   initialize_wk_klasses_until(NOT_JVMCI(WKID_LIMIT) JVMCI_ONLY(FIRST_JVMCI_WKID), scan, CHECK);
  1921 
  1924 
  1922   _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
  1925   _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
  1923   _box_klasses[T_CHAR]    = WK_KLASS(Character_klass);
  1926   _box_klasses[T_CHAR]    = WK_KLASS(Character_klass);
  1924   _box_klasses[T_FLOAT]   = WK_KLASS(Float_klass);
  1927   _box_klasses[T_FLOAT]   = WK_KLASS(Float_klass);
  1925   _box_klasses[T_DOUBLE]  = WK_KLASS(Double_klass);
  1928   _box_klasses[T_DOUBLE]  = WK_KLASS(Double_klass);
  2341                                                           KlassHandle accessing_klass,
  2344                                                           KlassHandle accessing_klass,
  2342                                                           Handle *appendix_result,
  2345                                                           Handle *appendix_result,
  2343                                                           Handle *method_type_result,
  2346                                                           Handle *method_type_result,
  2344                                                           TRAPS) {
  2347                                                           TRAPS) {
  2345   methodHandle empty;
  2348   methodHandle empty;
  2346   assert(!THREAD->is_Compiler_thread(), "");
  2349   assert(THREAD->can_call_java() ,"");
  2347   Handle method_type =
  2350   Handle method_type =
  2348     SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
  2351     SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
  2349 
  2352 
  2350   KlassHandle  mh_klass = SystemDictionary::MethodHandle_klass();
  2353   KlassHandle  mh_klass = SystemDictionary::MethodHandle_klass();
  2351   int ref_kind = JVM_REF_invokeVirtual;
  2354   int ref_kind = JVM_REF_invokeVirtual;
  2409   int          index = invoke_method_table()->hash_to_index(hash);
  2412   int          index = invoke_method_table()->hash_to_index(hash);
  2410   SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
  2413   SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
  2411   if (spe != NULL && spe->method_type() != NULL) {
  2414   if (spe != NULL && spe->method_type() != NULL) {
  2412     assert(java_lang_invoke_MethodType::is_instance(spe->method_type()), "");
  2415     assert(java_lang_invoke_MethodType::is_instance(spe->method_type()), "");
  2413     return Handle(THREAD, spe->method_type());
  2416     return Handle(THREAD, spe->method_type());
  2414   } else if (THREAD->is_Compiler_thread()) {
  2417   } else if (!THREAD->can_call_java()) {
  2415     warning("SystemDictionary::find_method_handle_type called from compiler thread");  // FIXME
  2418     warning("SystemDictionary::find_method_handle_type called from compiler thread");  // FIXME
  2416     return Handle();  // do not attempt from within compiler, unless it was cached
  2419     return Handle();  // do not attempt from within compiler, unless it was cached
  2417   }
  2420   }
  2418 
  2421 
  2419   Handle class_loader, protection_domain;
  2422   Handle class_loader, protection_domain;