hotspot/src/share/vm/oops/method.cpp
changeset 33105 294e48b4f704
parent 31790 4a08476437e8
child 33148 68fa8b6c4340
equal deleted inserted replaced
33104:a7c0f60a1294 33105:294e48b4f704
   244 int Method::bci_from(address bcp) const {
   244 int Method::bci_from(address bcp) const {
   245   if (is_native() && bcp == 0) {
   245   if (is_native() && bcp == 0) {
   246     return 0;
   246     return 0;
   247   }
   247   }
   248 #ifdef ASSERT
   248 #ifdef ASSERT
   249   { ResourceMark rm;
   249   {
   250   assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(),
   250     ResourceMark rm;
   251          err_msg("bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s", bcp, name_and_sig_as_C_string()));
   251     assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(),
       
   252            "bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s",
       
   253            bcp, name_and_sig_as_C_string());
   252   }
   254   }
   253 #endif
   255 #endif
   254   return bcp - code_base();
   256   return bcp - code_base();
   255 }
   257 }
   256 
   258 
   277   assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0");
   279   assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0");
   278   return bci;
   280   return bci;
   279 }
   281 }
   280 
   282 
   281 address Method::bcp_from(int bci) const {
   283 address Method::bcp_from(int bci) const {
   282   assert((is_native() && bci == 0)  || (!is_native() && 0 <= bci && bci < code_size()), err_msg("illegal bci: %d", bci));
   284   assert((is_native() && bci == 0) || (!is_native() && 0 <= bci && bci < code_size()), "illegal bci: %d", bci);
   283   address bcp = code_base() + bci;
   285   address bcp = code_base() + bci;
   284   assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
   286   assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
   285   return bcp;
   287   return bcp;
   286 }
   288 }
   287 
   289 
   571   if (is_final_method(class_access_flags))  return true;
   573   if (is_final_method(class_access_flags))  return true;
   572 #ifdef ASSERT
   574 #ifdef ASSERT
   573   ResourceMark rm;
   575   ResourceMark rm;
   574   bool is_nonv = (vtable_index() == nonvirtual_vtable_index);
   576   bool is_nonv = (vtable_index() == nonvirtual_vtable_index);
   575   if (class_access_flags.is_interface()) {
   577   if (class_access_flags.is_interface()) {
   576       assert(is_nonv == is_static(), err_msg("is_nonv=%s", name_and_sig_as_C_string()));
   578     assert(is_nonv == is_static(), "is_nonv=%s", name_and_sig_as_C_string());
   577   }
   579   }
   578 #endif
   580 #endif
   579   assert(valid_vtable_index() || valid_itable_index(), "method must be linked before we ask this question");
   581   assert(valid_vtable_index() || valid_itable_index(), "method must be linked before we ask this question");
   580   return vtable_index() == nonvirtual_vtable_index;
   582   return vtable_index() == nonvirtual_vtable_index;
   581 }
   583 }
  1570       return bp->orig_bytecode();
  1572       return bp->orig_bytecode();
  1571     }
  1573     }
  1572   }
  1574   }
  1573   {
  1575   {
  1574     ResourceMark rm;
  1576     ResourceMark rm;
  1575     fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci));
  1577     fatal("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci);
  1576   }
  1578   }
  1577   return Bytecodes::_shouldnotreachhere;
  1579   return Bytecodes::_shouldnotreachhere;
  1578 }
  1580 }
  1579 
  1581 
  1580 void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
  1582 void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {