1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
230 assert(index == itable_index, "CallInfo pre-computes this"); |
230 assert(index == itable_index, "CallInfo pre-computes this"); |
231 InstanceKlass* k = call_info->resolved_method()->method_holder(); |
231 InstanceKlass* k = call_info->resolved_method()->method_holder(); |
232 assert(k->verify_itable_index(itable_index), "sanity check"); |
232 assert(k->verify_itable_index(itable_index), "sanity check"); |
233 #endif //ASSERT |
233 #endif //ASSERT |
234 CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(), |
234 CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(), |
235 call_info->resolved_klass()()); |
235 call_info->resolved_klass()(), false); |
236 holder->claim(); |
236 holder->claim(); |
237 InlineCacheBuffer::create_transition_stub(this, holder, entry); |
237 InlineCacheBuffer::create_transition_stub(this, holder, entry); |
238 } else { |
238 } else { |
239 assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable"); |
239 assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable"); |
240 // Can be different than selected_method->vtable_index(), due to package-private etc. |
240 // Can be different than selected_method->vtable_index(), due to package-private etc. |
268 bool CompiledIC::is_megamorphic() const { |
268 bool CompiledIC::is_megamorphic() const { |
269 assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); |
269 assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); |
270 assert(!is_optimized(), "an optimized call cannot be megamorphic"); |
270 assert(!is_optimized(), "an optimized call cannot be megamorphic"); |
271 |
271 |
272 // Cannot rely on cached_value. It is either an interface or a method. |
272 // Cannot rely on cached_value. It is either an interface or a method. |
273 return VtableStubs::is_entry_point(ic_destination()); |
273 return VtableStubs::entry_point(ic_destination()) != NULL; |
274 } |
274 } |
275 |
275 |
276 bool CompiledIC::is_call_to_compiled() const { |
276 bool CompiledIC::is_call_to_compiled() const { |
277 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); |
277 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); |
278 |
278 |
532 CodeBlob* cb = CodeCache::find_blob_unsafe(entry); |
532 CodeBlob* cb = CodeCache::find_blob_unsafe(entry); |
533 if (cb != NULL && cb->is_adapter_blob()) { |
533 if (cb != NULL && cb->is_adapter_blob()) { |
534 return true; |
534 return true; |
535 } |
535 } |
536 // itable stubs also use CompiledICHolder |
536 // itable stubs also use CompiledICHolder |
537 if (VtableStubs::is_entry_point(entry) && VtableStubs::stub_containing(entry)->is_itable_stub()) { |
537 if (cb != NULL && cb->is_vtable_blob()) { |
538 return true; |
538 VtableStub* s = VtableStubs::entry_point(entry); |
539 } |
539 return (s != NULL) && s->is_itable_stub(); |
|
540 } |
|
541 |
540 return false; |
542 return false; |
541 } |
543 } |
542 |
544 |
543 // ---------------------------------------------------------------------------- |
545 // ---------------------------------------------------------------------------- |
544 |
546 |