src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8031320_9 Sdiff src/share/vm/oops

src/share/vm/oops/method.cpp

Print this page




 256 int Method::validate_bci_from_bcx(intptr_t bcx) const {
 257   // keep bci as -1 if not a valid bci
 258   int bci = -1;
 259   if (bcx == 0 || (address)bcx == code_base()) {
 260     // code_size() may return 0 and we allow 0 here
 261     // the method may be native
 262     bci = 0;
 263   } else if (frame::is_bci(bcx)) {
 264     if (bcx < code_size()) {
 265       bci = (int)bcx;
 266     }
 267   } else if (contains((address)bcx)) {
 268     bci = (address)bcx - code_base();
 269   }
 270   // Assert that if we have dodged any asserts, bci is negative.
 271   assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0");
 272   return bci;
 273 }
 274 
 275 address Method::bcp_from(int bci) const {
 276   assert((is_native() && bci == 0)  || (!is_native() && 0 <= bci && bci < code_size()), "illegal bci");
 277   address bcp = code_base() + bci;
 278   assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
 279   return bcp;
 280 }
 281 
 282 
 283 int Method::size(bool is_native) {
 284   // If native, then include pointers for native_function and signature_handler
 285   int extra_bytes = (is_native) ? 2*sizeof(address*) : 0;
 286   int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
 287   return align_object_size(header_size() + extra_words);
 288 }
 289 
 290 
 291 Symbol* Method::klass_name() const {
 292   Klass* k = method_holder();
 293   assert(k->is_klass(), "must be klass");
 294   InstanceKlass* ik = (InstanceKlass*) k;
 295   return ik->name();
 296 }




 256 int Method::validate_bci_from_bcx(intptr_t bcx) const {
 257   // keep bci as -1 if not a valid bci
 258   int bci = -1;
 259   if (bcx == 0 || (address)bcx == code_base()) {
 260     // code_size() may return 0 and we allow 0 here
 261     // the method may be native
 262     bci = 0;
 263   } else if (frame::is_bci(bcx)) {
 264     if (bcx < code_size()) {
 265       bci = (int)bcx;
 266     }
 267   } else if (contains((address)bcx)) {
 268     bci = (address)bcx - code_base();
 269   }
 270   // Assert that if we have dodged any asserts, bci is negative.
 271   assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0");
 272   return bci;
 273 }
 274 
 275 address Method::bcp_from(int bci) const {
 276   assert((is_native() && bci == 0)  || (!is_native() && 0 <= bci && bci < code_size()), err_msg("illegal bci: %d", bci));
 277   address bcp = code_base() + bci;
 278   assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
 279   return bcp;
 280 }
 281 
 282 
 283 int Method::size(bool is_native) {
 284   // If native, then include pointers for native_function and signature_handler
 285   int extra_bytes = (is_native) ? 2*sizeof(address*) : 0;
 286   int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
 287   return align_object_size(header_size() + extra_words);
 288 }
 289 
 290 
 291 Symbol* Method::klass_name() const {
 292   Klass* k = method_holder();
 293   assert(k->is_klass(), "must be klass");
 294   InstanceKlass* ik = (InstanceKlass*) k;
 295   return ik->name();
 296 }


src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File