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