Print this page
rev 1021 : 6858164: invokedynamic code needs some cleanup (post-6655638)
Note: The bug ID for this change set was erroneously used to call for review of 6815692.
Summary: Fix several crashers, remove needless paths for boxed-style bootstrap method call, refactor & simplify APIs for rewriter constantPoolOop, remove sun.dyn.CallSiteImpl
Reviewed-by: ?
rev 1024 : 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 ↓ 1962 lines elided ↑ open up ↑
1963 1963    WKID meth_group_end   = WK_KLASS_ENUM_NAME(WrongMethodTypeException_klass);
1964 1964    initialize_wk_klasses_until(meth_group_start, scan, CHECK);
1965 1965    if (EnableMethodHandles) {
1966 1966      initialize_wk_klasses_through(meth_group_end, scan, CHECK);
1967 1967    }
1968 1968    if (_well_known_klasses[meth_group_start] == NULL) {
1969 1969      // Skip the rest of the method handle classes, if MethodHandle is not loaded.
1970 1970      scan = WKID(meth_group_end+1);
1971 1971    }
1972 1972    WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass);
1973      -  WKID indy_group_end   = WK_KLASS_ENUM_NAME(Dynamic_klass);
     1973 +  WKID indy_group_end   = WK_KLASS_ENUM_NAME(InvokeDynamic_klass);
1974 1974    initialize_wk_klasses_until(indy_group_start, scan, CHECK);
1975 1975    if (EnableInvokeDynamic) {
1976 1976      initialize_wk_klasses_through(indy_group_end, scan, CHECK);
1977 1977    }
1978 1978    if (_well_known_klasses[indy_group_start] == NULL) {
1979 1979      // Skip the rest of the dynamic typing classes, if Linkage is not loaded.
1980 1980      scan = WKID(indy_group_end+1);
1981 1981    }
1982 1982  
1983 1983    initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
↓ open down ↓ 335 lines elided ↑ open up ↑
2319 2319           "cannot load specialized versions of MethodHandle.invoke");
2320 2320    if (invoke_method_table() == NULL) {
2321 2321      // create this side table lazily
2322 2322      _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
2323 2323    }
2324 2324    unsigned int hash  = invoke_method_table()->compute_hash(signature);
2325 2325    int          index = invoke_method_table()->hash_to_index(hash);
2326 2326    SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature);
2327 2327    if (spe == NULL || spe->property_oop() == NULL) {
2328 2328      // Must create lots of stuff here, but outside of the SystemDictionary lock.
     2329 +    if (THREAD->is_Compiler_thread())
     2330 +      return NULL;              // do not attempt from within compiler
2329 2331      Handle mt = compute_method_handle_type(signature(),
2330 2332                                             class_loader, protection_domain,
2331 2333                                             CHECK_NULL);
2332 2334      KlassHandle  mh_klass = SystemDictionaryHandles::MethodHandle_klass();
2333 2335      methodHandle m = methodOopDesc::make_invoke_method(mh_klass, signature,
2334 2336                                                         mt, CHECK_NULL);
2335 2337      // Now grab the lock.  We might have to throw away the new method,
2336 2338      // if a racing thread has managed to install one at the same time.
2337 2339      {
2338 2340        MutexLocker ml(SystemDictionary_lock, Thread::current());
↓ open down ↓ 422 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX