278
279 address Method::bcp_from(int bci) const {
280 assert((is_native() && bci == 0) || (!is_native() && 0 <= bci && bci < code_size()), "illegal bci: %d", bci);
281 address bcp = code_base() + bci;
282 assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
283 return bcp;
284 }
285
286 address Method::bcp_from(address bcp) const {
287 if (is_native() && bcp == NULL) {
288 return code_base();
289 } else {
290 return bcp;
291 }
292 }
293
294 int Method::size(bool is_native) {
295 // If native, then include pointers for native_function and signature_handler
296 int extra_bytes = (is_native) ? 2*sizeof(address*) : 0;
297 int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
298 return align_object_size(header_size() + extra_words);
299 }
300
301
302 Symbol* Method::klass_name() const {
303 return method_holder()->name();
304 }
305
306
307 // Attempt to return method oop to original state. Clear any pointers
308 // (to objects outside the shared spaces). We won't be able to predict
309 // where they should point in a new JVM. Further initialize some
310 // entries now in order allow them to be write protected later.
311
312 void Method::remove_unshareable_info() {
313 unlink_method();
314 }
315
316
317 bool Method::was_executed_more_than(int n) {
318 // Invocation counter is reset when the Method* is compiled.
|
278
279 address Method::bcp_from(int bci) const {
280 assert((is_native() && bci == 0) || (!is_native() && 0 <= bci && bci < code_size()), "illegal bci: %d", bci);
281 address bcp = code_base() + bci;
282 assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
283 return bcp;
284 }
285
286 address Method::bcp_from(address bcp) const {
287 if (is_native() && bcp == NULL) {
288 return code_base();
289 } else {
290 return bcp;
291 }
292 }
293
294 int Method::size(bool is_native) {
295 // If native, then include pointers for native_function and signature_handler
296 int extra_bytes = (is_native) ? 2*sizeof(address*) : 0;
297 int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
298 return align_metadata_size(header_size() + extra_words);
299 }
300
301
302 Symbol* Method::klass_name() const {
303 return method_holder()->name();
304 }
305
306
307 // Attempt to return method oop to original state. Clear any pointers
308 // (to objects outside the shared spaces). We won't be able to predict
309 // where they should point in a new JVM. Further initialize some
310 // entries now in order allow them to be write protected later.
311
312 void Method::remove_unshareable_info() {
313 unlink_method();
314 }
315
316
317 bool Method::was_executed_more_than(int n) {
318 // Invocation counter is reset when the Method* is compiled.
|