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/interpreter/linkResolver.cpp
          +++ new/src/share/vm/interpreter/linkResolver.cpp
↓ open down ↓ 74 lines elided ↑ open up ↑
  75   75    _selected_method = selected_method;
  76   76    _vtable_index    = vtable_index;
  77   77    if (CompilationPolicy::mustBeCompiled(selected_method)) {
  78   78      // Note: with several active threads, the mustBeCompiled may be true
  79   79      //       while canBeCompiled is false; remove assert
  80   80      // assert(CompilationPolicy::canBeCompiled(selected_method), "cannot compile");
  81   81      if (THREAD->is_Compiler_thread()) {
  82   82        // don't force compilation, resolve was on behalf of compiler
  83   83        return;
  84   84      }
       85 +    if (instanceKlass::cast(selected_method->method_holder())->is_not_initialized()) {
       86 +      // Do not force compilation of methods in uninitialized classes.
       87 +      // Note that doing this would throw an assert later,
       88 +      // in CompileBroker::compile_method.
       89 +      // We sometimes use the link resolver to do reflective lookups
       90 +      // even before classes are initialized.
       91 +      return;
       92 +    }
  85   93      CompileBroker::compile_method(selected_method, InvocationEntryBci,
  86   94                                    methodHandle(), 0, "mustBeCompiled", CHECK);
  87   95    }
  88   96  }
  89   97  
  90   98  
  91   99  //------------------------------------------------------------------------------------------------------------------------
  92  100  // Klass resolution
  93  101  
  94  102  void LinkResolver::check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS) {
↓ open down ↓ 121 lines elided ↑ open up ↑
 216  224    // resolve klass
 217  225    resolve_klass(resolved_klass, pool, index, CHECK);
 218  226  
 219  227    symbolHandle method_name      (THREAD, pool->name_ref_at(index));
 220  228    symbolHandle method_signature (THREAD, pool->signature_ref_at(index));
 221  229    KlassHandle  current_klass(THREAD, pool->pool_holder());
 222  230  
 223  231    resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK);
 224  232  }
 225  233  
      234 +void LinkResolver::resolve_dynamic_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) {
      235 +  // The class is java.dyn.MethodHandle
      236 +  resolved_klass = SystemDictionaryHandles::MethodHandle_klass();
      237 +
      238 +  symbolHandle method_name = vmSymbolHandles::invoke_name();
      239 +
      240 +  symbolHandle method_signature(THREAD, pool->signature_ref_at(index));
      241 +  KlassHandle  current_klass   (THREAD, pool->pool_holder());
      242 +
      243 +  resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK);
      244 +}
      245 +
 226  246  void LinkResolver::resolve_interface_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) {
 227  247  
 228  248    // resolve klass
 229  249    resolve_klass(resolved_klass, pool, index, CHECK);
 230  250    symbolHandle method_name      (THREAD, pool->name_ref_at(index));
 231  251    symbolHandle method_signature (THREAD, pool->signature_ref_at(index));
 232  252    KlassHandle  current_klass(THREAD, pool->pool_holder());
 233  253  
 234  254    resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK);
 235  255  }
↓ open down ↓ 806 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX