hotspot/src/share/vm/oops/method.cpp
changeset 38144 0976c0c5c5d3
parent 38133 78b95467b9f1
parent 38060 954c9575f653
child 39421 a9652c919db8
equal deleted inserted replaced
38143:3b732f17ea7d 38144:0976c0c5c5d3
    82 
    82 
    83 Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
    83 Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
    84   NoSafepointVerifier no_safepoint;
    84   NoSafepointVerifier no_safepoint;
    85   set_constMethod(xconst);
    85   set_constMethod(xconst);
    86   set_access_flags(access_flags);
    86   set_access_flags(access_flags);
    87 #ifdef CC_INTERP
       
    88   set_result_index(T_VOID);
       
    89 #endif
       
    90   set_intrinsic_id(vmIntrinsics::_none);
    87   set_intrinsic_id(vmIntrinsics::_none);
    91   set_jfr_towrite(false);
    88   set_jfr_towrite(false);
    92   set_force_inline(false);
    89   set_force_inline(false);
    93   set_hidden(false);
    90   set_hidden(false);
    94   set_dont_inline(false);
    91   set_dont_inline(false);
   443 void Method::compute_size_of_parameters(Thread *thread) {
   440 void Method::compute_size_of_parameters(Thread *thread) {
   444   ArgumentSizeComputer asc(signature());
   441   ArgumentSizeComputer asc(signature());
   445   set_size_of_parameters(asc.size() + (is_static() ? 0 : 1));
   442   set_size_of_parameters(asc.size() + (is_static() ? 0 : 1));
   446 }
   443 }
   447 
   444 
   448 #ifdef CC_INTERP
       
   449 void Method::set_result_index(BasicType type)          {
       
   450   _result_index = Interpreter::BasicType_as_index(type);
       
   451 }
       
   452 #endif
       
   453 
       
   454 BasicType Method::result_type() const {
   445 BasicType Method::result_type() const {
   455   ResultTypeFinder rtf(signature());
   446   ResultTypeFinder rtf(signature());
   456   return rtf.type();
   447   return rtf.type();
   457 }
   448 }
   458 
   449 
  1218   m->set_constants(cp());
  1209   m->set_constants(cp());
  1219   m->set_name_index(_imcp_invoke_name);
  1210   m->set_name_index(_imcp_invoke_name);
  1220   m->set_signature_index(_imcp_invoke_signature);
  1211   m->set_signature_index(_imcp_invoke_signature);
  1221   assert(MethodHandles::is_signature_polymorphic_name(m->name()), "");
  1212   assert(MethodHandles::is_signature_polymorphic_name(m->name()), "");
  1222   assert(m->signature() == signature, "");
  1213   assert(m->signature() == signature, "");
  1223 #ifdef CC_INTERP
       
  1224   ResultTypeFinder rtf(signature);
  1214   ResultTypeFinder rtf(signature);
  1225   m->set_result_index(rtf.type());
  1215   m->constMethod()->set_result_type(rtf.type());
  1226 #endif
       
  1227   m->compute_size_of_parameters(THREAD);
  1216   m->compute_size_of_parameters(THREAD);
  1228   m->init_intrinsic_id();
  1217   m->init_intrinsic_id();
  1229   assert(m->is_method_handle_intrinsic(), "");
  1218   assert(m->is_method_handle_intrinsic(), "");
  1230 #ifdef ASSERT
  1219 #ifdef ASSERT
  1231   if (!MethodHandles::is_signature_polymorphic(m->intrinsic_id()))  m->print();
  1220   if (!MethodHandles::is_signature_polymorphic(m->intrinsic_id()))  m->print();
  1637     _line += next & 0x7;
  1626     _line += next & 0x7;
  1638   }
  1627   }
  1639   return true;
  1628   return true;
  1640 }
  1629 }
  1641 
  1630 
       
  1631 #if INCLUDE_JVMTI
  1642 
  1632 
  1643 Bytecodes::Code Method::orig_bytecode_at(int bci) const {
  1633 Bytecodes::Code Method::orig_bytecode_at(int bci) const {
  1644   BreakpointInfo* bp = method_holder()->breakpoints();
  1634   BreakpointInfo* bp = method_holder()->breakpoints();
  1645   for (; bp != NULL; bp = bp->next()) {
  1635   for (; bp != NULL; bp = bp->next()) {
  1646     if (bp->match(this, bci)) {
  1636     if (bp->match(this, bci)) {
  1717 
  1707 
  1718 void Method::clear_all_breakpoints() {
  1708 void Method::clear_all_breakpoints() {
  1719   clear_matches(this, -1);
  1709   clear_matches(this, -1);
  1720 }
  1710 }
  1721 
  1711 
       
  1712 #endif // INCLUDE_JVMTI
  1722 
  1713 
  1723 int Method::invocation_count() {
  1714 int Method::invocation_count() {
  1724   MethodCounters *mcs = method_counters();
  1715   MethodCounters *mcs = method_counters();
  1725   if (TieredCompilation) {
  1716   if (TieredCompilation) {
  1726     MethodData* const mdo = method_data();
  1717     MethodData* const mdo = method_data();
  1782   if (mcs != NULL) {
  1773   if (mcs != NULL) {
  1783     mcs->set_highest_osr_comp_level(level);
  1774     mcs->set_highest_osr_comp_level(level);
  1784   }
  1775   }
  1785 }
  1776 }
  1786 
  1777 
       
  1778 #if INCLUDE_JVMTI
       
  1779 
  1787 BreakpointInfo::BreakpointInfo(Method* m, int bci) {
  1780 BreakpointInfo::BreakpointInfo(Method* m, int bci) {
  1788   _bci = bci;
  1781   _bci = bci;
  1789   _name_index = m->name_index();
  1782   _name_index = m->name_index();
  1790   _signature_index = m->signature_index();
  1783   _signature_index = m->signature_index();
  1791   _orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
  1784   _orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
  1818 void BreakpointInfo::clear(Method* method) {
  1811 void BreakpointInfo::clear(Method* method) {
  1819   *method->bcp_from(_bci) = orig_bytecode();
  1812   *method->bcp_from(_bci) = orig_bytecode();
  1820   assert(method->number_of_breakpoints() > 0, "must not go negative");
  1813   assert(method->number_of_breakpoints() > 0, "must not go negative");
  1821   method->decr_number_of_breakpoints(Thread::current());
  1814   method->decr_number_of_breakpoints(Thread::current());
  1822 }
  1815 }
       
  1816 
       
  1817 #endif // INCLUDE_JVMTI
  1823 
  1818 
  1824 // jmethodID handling
  1819 // jmethodID handling
  1825 
  1820 
  1826 // This is a block allocating object, sort of like JNIHandleBlock, only a
  1821 // This is a block allocating object, sort of like JNIHandleBlock, only a
  1827 // lot simpler.
  1822 // lot simpler.