hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
changeset 15205 17da82a12ff4
parent 14622 8e94e4186d35
child 15207 86fd7c602ddf
equal deleted inserted replaced
15204:a8960bf92b09 15205:17da82a12ff4
  1028   // Array methods are all inherited from Object and are monomorphic
  1028   // Array methods are all inherited from Object and are monomorphic
  1029   if (receiver_type->is_array_klass() &&
  1029   if (receiver_type->is_array_klass() &&
  1030       dest_method->holder() == java_lang_Object_klass())
  1030       dest_method->holder() == java_lang_Object_klass())
  1031     return dest_method;
  1031     return dest_method;
  1032 
  1032 
  1033 #ifdef SHARK_CAN_DEOPTIMIZE_ANYWHERE
       
  1034   // This code can replace a virtual call with a direct call if this
  1033   // This code can replace a virtual call with a direct call if this
  1035   // class is the only one in the entire set of loaded classes that
  1034   // class is the only one in the entire set of loaded classes that
  1036   // implements this method.  This makes the compiled code dependent
  1035   // implements this method.  This makes the compiled code dependent
  1037   // on other classes that implement the method not being loaded, a
  1036   // on other classes that implement the method not being loaded, a
  1038   // condition which is enforced by the dependency tracker.  If the
  1037   // condition which is enforced by the dependency tracker.  If the
  1061   ciInstanceKlass *calling_klass = caller->holder();
  1060   ciInstanceKlass *calling_klass = caller->holder();
  1062   ciMethod* monomorphic_target =
  1061   ciMethod* monomorphic_target =
  1063     dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver);
  1062     dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver);
  1064   if (monomorphic_target != NULL) {
  1063   if (monomorphic_target != NULL) {
  1065     assert(!monomorphic_target->is_abstract(), "shouldn't be");
  1064     assert(!monomorphic_target->is_abstract(), "shouldn't be");
       
  1065 
       
  1066     function()->dependencies()->assert_unique_concrete_method(actual_receiver, monomorphic_target);
  1066 
  1067 
  1067     // Opto has a bunch of type checking here that I don't
  1068     // Opto has a bunch of type checking here that I don't
  1068     // understand.  It's to inhibit casting in one direction,
  1069     // understand.  It's to inhibit casting in one direction,
  1069     // possibly because objects in Opto can have inexact
  1070     // possibly because objects in Opto can have inexact
  1070     // types, but I can't even tell which direction it
  1071     // types, but I can't even tell which direction it
  1095   // Because Opto distinguishes exact types from inexact ones
  1096   // Because Opto distinguishes exact types from inexact ones
  1096   // it can perform a further optimization to replace calls
  1097   // it can perform a further optimization to replace calls
  1097   // with non-monomorphic targets if the receiver has an exact
  1098   // with non-monomorphic targets if the receiver has an exact
  1098   // type.  We don't mark types this way, so we can't do this.
  1099   // type.  We don't mark types this way, so we can't do this.
  1099 
  1100 
  1100 #endif // SHARK_CAN_DEOPTIMIZE_ANYWHERE
       
  1101 
  1101 
  1102   return NULL;
  1102   return NULL;
  1103 }
  1103 }
  1104 
  1104 
  1105 Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) {
  1105 Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) {
  1296     }
  1296     }
  1297   }
  1297   }
  1298 
  1298 
  1299   // Try to inline the call
  1299   // Try to inline the call
  1300   if (!call_is_virtual) {
  1300   if (!call_is_virtual) {
  1301     if (SharkInliner::attempt_inline(call_method, current_state()))
  1301     if (SharkInliner::attempt_inline(call_method, current_state())) {
  1302       return;
  1302       return;
       
  1303     }
  1303   }
  1304   }
  1304 
  1305 
  1305   // Find the method we are calling
  1306   // Find the method we are calling
  1306   Value *callee;
  1307   Value *callee;
  1307   if (call_is_virtual) {
  1308   if (call_is_virtual) {