src/share/vm/opto/doCall.cpp

changeset 3313
a04a201f0f5a
parent 3101
aa67216400d3
child 3631
b40ac3579043
     1.1 --- a/src/share/vm/opto/doCall.cpp	Wed Nov 16 19:42:58 2011 -0800
     1.2 +++ b/src/share/vm/opto/doCall.cpp	Thu Nov 17 04:07:30 2011 -0800
     1.3 @@ -62,7 +62,6 @@
     1.4  CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual,
     1.5                                         JVMState* jvms, bool allow_inline,
     1.6                                         float prof_factor) {
     1.7 -  CallGenerator*  cg;
     1.8    ciMethod*       caller   = jvms->method();
     1.9    int             bci      = jvms->bci();
    1.10    Bytecodes::Code bytecode = caller->java_code_at_bci(bci);
    1.11 @@ -110,7 +109,7 @@
    1.12    // We do this before the strict f.p. check below because the
    1.13    // intrinsics handle strict f.p. correctly.
    1.14    if (allow_inline) {
    1.15 -    cg = find_intrinsic(call_method, call_is_virtual);
    1.16 +    CallGenerator* cg = find_intrinsic(call_method, call_is_virtual);
    1.17      if (cg != NULL)  return cg;
    1.18    }
    1.19  
    1.20 @@ -121,33 +120,16 @@
    1.21    if (call_method->is_method_handle_invoke()) {
    1.22      if (bytecode != Bytecodes::_invokedynamic) {
    1.23        GraphKit kit(jvms);
    1.24 -      Node* n = kit.argument(0);
    1.25 -
    1.26 -      CallGenerator* cg = CallGenerator::for_method_handle_inline(n, jvms, caller, call_method, profile);
    1.27 -      if (cg != NULL) {
    1.28 -        return cg;
    1.29 -      }
    1.30 -      return CallGenerator::for_direct_call(call_method);
    1.31 +      Node* method_handle = kit.argument(0);
    1.32 +      return CallGenerator::for_method_handle_call(method_handle, jvms, caller, call_method, profile);
    1.33      }
    1.34      else {
    1.35 -      // Get the CallSite object.
    1.36 -      ciMethod* caller_method = jvms->method();
    1.37 -      ciBytecodeStream str(caller_method);
    1.38 -      str.force_bci(jvms->bci());  // Set the stream to the invokedynamic bci.
    1.39 -      ciCallSite* call_site = str.get_call_site();
    1.40 -
    1.41 -      CallGenerator* cg = CallGenerator::for_invokedynamic_inline(call_site, jvms, caller, call_method, profile);
    1.42 -      if (cg != NULL) {
    1.43 -        return cg;
    1.44 -      }
    1.45 -      // If something failed, generate a normal dynamic call.
    1.46 -      return CallGenerator::for_dynamic_call(call_method);
    1.47 +      return CallGenerator::for_invokedynamic_call(jvms, caller, call_method, profile);
    1.48      }
    1.49    }
    1.50  
    1.51    // Do not inline strict fp into non-strict code, or the reverse
    1.52 -  bool caller_method_is_strict = jvms->method()->is_strict();
    1.53 -  if( caller_method_is_strict ^ call_method->is_strict() ) {
    1.54 +  if (caller->is_strict() ^ call_method->is_strict()) {
    1.55      allow_inline = false;
    1.56    }
    1.57  
    1.58 @@ -258,7 +240,7 @@
    1.59              }
    1.60              if (miss_cg != NULL) {
    1.61                NOT_PRODUCT(trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count));
    1.62 -              cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0));
    1.63 +              CallGenerator* cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0));
    1.64                if (cg != NULL)  return cg;
    1.65              }
    1.66            }

mercurial