311 |
311 |
312 void Method::remove_unshareable_info() { |
312 void Method::remove_unshareable_info() { |
313 unlink_method(); |
313 unlink_method(); |
314 } |
314 } |
315 |
315 |
|
316 void Method::set_vtable_index(int index) { |
|
317 if (is_shared() && !MetaspaceShared::remapped_readwrite()) { |
|
318 // At runtime initialize_vtable is rerun as part of link_class_impl() |
|
319 // for a shared class loaded by the non-boot loader to obtain the loader |
|
320 // constraints based on the runtime classloaders' context. |
|
321 return; // don't write into the shared class |
|
322 } else { |
|
323 _vtable_index = index; |
|
324 } |
|
325 } |
|
326 |
|
327 void Method::set_itable_index(int index) { |
|
328 if (is_shared() && !MetaspaceShared::remapped_readwrite()) { |
|
329 // At runtime initialize_itable is rerun as part of link_class_impl() |
|
330 // for a shared class loaded by the non-boot loader to obtain the loader |
|
331 // constraints based on the runtime classloaders' context. The dumptime |
|
332 // itable index should be the same as the runtime index. |
|
333 assert(_vtable_index == itable_index_max - index, |
|
334 "archived itable index is different from runtime index"); |
|
335 return; // don’t write into the shared class |
|
336 } else { |
|
337 _vtable_index = itable_index_max - index; |
|
338 } |
|
339 assert(valid_itable_index(), ""); |
|
340 } |
|
341 |
|
342 |
316 |
343 |
317 bool Method::was_executed_more_than(int n) { |
344 bool Method::was_executed_more_than(int n) { |
318 // Invocation counter is reset when the Method* is compiled. |
345 // Invocation counter is reset when the Method* is compiled. |
319 // If the method has compiled code we therefore assume it has |
346 // If the method has compiled code we therefore assume it has |
320 // be excuted more than n times. |
347 // be excuted more than n times. |