Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/callGenerator.cpp
          +++ new/src/share/vm/opto/callGenerator.cpp
↓ open down ↓ 767 lines elided ↑ open up ↑
 768  768    CompileLog* log = kit.C->log();
 769  769    if (log != NULL) {
 770  770      log->elem("predicted_dynamic_call bci='%d'", jvms->bci());
 771  771    }
 772  772  
 773  773    const TypeOopPtr* predicted_mh_ptr = TypeOopPtr::make_from_constant(_predicted_method_handle, true);
 774  774    Node* predicted_mh = kit.makecon(predicted_mh_ptr);
 775  775  
 776  776    Node* bol = NULL;
 777  777    int bc = jvms->method()->java_code_at_bci(jvms->bci());
 778      -  if (bc == Bytecodes::_invokespecial) {
 779      -    // This is the selectAlternative idiom for guardWithTest
      778 +  if (bc != Bytecodes::_invokedynamic) {
      779 +    // This is the selectAlternative idiom for guardWithTest or
      780 +    // similar idioms.
 780  781      Node* receiver = kit.argument(0);
 781  782  
 782  783      // Check if the MethodHandle is the expected one
 783  784      Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(receiver, predicted_mh));
 784  785      bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
 785  786    } else {
 786      -    assert(bc == Bytecodes::_invokedynamic, "must be");
 787  787      // Get the constant pool cache from the caller class.
 788  788      ciMethod* caller_method = jvms->method();
 789  789      ciBytecodeStream str(caller_method);
 790  790      str.force_bci(jvms->bci());  // Set the stream to the invokedynamic bci.
 791  791      ciCPCache* cpcache = str.get_cpcache();
 792  792  
 793  793      // Get the offset of the CallSite from the constant pool cache
 794  794      // pointer.
 795  795      int index = str.get_method_index();
 796  796      size_t call_site_offset = cpcache->get_f1_offset(index);
↓ open down ↓ 302 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX