Print this page
rev 1081 : imported patch indy-cleanup-6893081.patch

Split Close
Expand all
Collapse all
          --- old/src/share/vm/classfile/systemDictionary.cpp
          +++ new/src/share/vm/classfile/systemDictionary.cpp
↓ open down ↓ 1976 lines elided ↑ open up ↑
1977 1977    WKID meth_group_end   = WK_KLASS_ENUM_NAME(WrongMethodTypeException_klass);
1978 1978    initialize_wk_klasses_until(meth_group_start, scan, CHECK);
1979 1979    if (EnableMethodHandles) {
1980 1980      initialize_wk_klasses_through(meth_group_end, scan, CHECK);
1981 1981    }
1982 1982    if (_well_known_klasses[meth_group_start] == NULL) {
1983 1983      // Skip the rest of the method handle classes, if MethodHandle is not loaded.
1984 1984      scan = WKID(meth_group_end+1);
1985 1985    }
1986 1986    WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass);
1987      -  WKID indy_group_end   = WK_KLASS_ENUM_NAME(Dynamic_klass);
     1987 +  WKID indy_group_end   = WK_KLASS_ENUM_NAME(InvokeDynamic_klass);
1988 1988    initialize_wk_klasses_until(indy_group_start, scan, CHECK);
1989 1989    if (EnableInvokeDynamic) {
1990 1990      initialize_wk_klasses_through(indy_group_end, scan, CHECK);
1991 1991    }
1992 1992    if (_well_known_klasses[indy_group_start] == NULL) {
1993 1993      // Skip the rest of the dynamic typing classes, if Linkage is not loaded.
1994 1994      scan = WKID(indy_group_end+1);
1995 1995    }
1996 1996  
1997 1997    initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
↓ open down ↓ 335 lines elided ↑ open up ↑
2333 2333           "cannot load specialized versions of MethodHandle.invoke");
2334 2334    if (invoke_method_table() == NULL) {
2335 2335      // create this side table lazily
2336 2336      _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
2337 2337    }
2338 2338    unsigned int hash  = invoke_method_table()->compute_hash(signature);
2339 2339    int          index = invoke_method_table()->hash_to_index(hash);
2340 2340    SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature);
2341 2341    if (spe == NULL || spe->property_oop() == NULL) {
2342 2342      // Must create lots of stuff here, but outside of the SystemDictionary lock.
     2343 +    if (THREAD->is_Compiler_thread())
     2344 +      return NULL;              // do not attempt from within compiler
2343 2345      Handle mt = compute_method_handle_type(signature(),
2344 2346                                             class_loader, protection_domain,
2345 2347                                             CHECK_NULL);
2346 2348      KlassHandle  mh_klass = SystemDictionaryHandles::MethodHandle_klass();
2347 2349      methodHandle m = methodOopDesc::make_invoke_method(mh_klass, signature,
2348 2350                                                         mt, CHECK_NULL);
2349 2351      // Now grab the lock.  We might have to throw away the new method,
2350 2352      // if a racing thread has managed to install one at the same time.
2351 2353      {
2352 2354        MutexLocker ml(SystemDictionary_lock, Thread::current());
↓ open down ↓ 422 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX