Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/code/compiledIC.cpp
32285 views
/*1* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "classfile/systemDictionary.hpp"26#include "code/codeCache.hpp"27#include "code/compiledIC.hpp"28#include "code/icBuffer.hpp"29#include "code/nmethod.hpp"30#include "code/vtableStubs.hpp"31#include "interpreter/interpreter.hpp"32#include "interpreter/linkResolver.hpp"33#include "memory/metadataFactory.hpp"34#include "memory/oopFactory.hpp"35#include "oops/method.hpp"36#include "oops/oop.inline.hpp"37#include "oops/symbol.hpp"38#include "runtime/icache.hpp"39#include "runtime/sharedRuntime.hpp"40#include "runtime/stubRoutines.hpp"41#include "utilities/events.hpp"424344// Every time a compiled IC is changed or its type is being accessed,45// either the CompiledIC_lock must be set or we must be at a safe point.4647//-----------------------------------------------------------------------------48// Low-level access to an inline cache. Private, since they might not be49// MT-safe to use.5051void* CompiledIC::cached_value() const {52assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");53assert (!is_optimized(), "an optimized virtual call does not have a cached metadata");5455if (!is_in_transition_state()) {56void* data = (void*)_value->data();57// If we let the metadata value here be initialized to zero...58assert(data != NULL || Universe::non_oop_word() == NULL,59"no raw nulls in CompiledIC metadatas, because of patching races");60return (data == (void*)Universe::non_oop_word()) ? NULL : data;61} else {62return InlineCacheBuffer::cached_value_for((CompiledIC *)this);63}64}656667void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub, void* cache, bool is_icholder) {68assert(entry_point != NULL, "must set legal entry point");69assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");70assert (!is_optimized() || cache == NULL, "an optimized virtual call does not have a cached metadata");71assert (cache == NULL || cache != (Metadata*)badOopVal, "invalid metadata");7273assert(!is_icholder || is_icholder_entry(entry_point), "must be");7475// Don't use ic_destination for this test since that forwards76// through ICBuffer instead of returning the actual current state of77// the CompiledIC.78if (is_icholder_entry(_ic_call->destination())) {79// When patching for the ICStub case the cached value isn't80// overwritten until the ICStub copied into the CompiledIC during81// the next safepoint. Make sure that the CompiledICHolder* is82// marked for release at this point since it won't be identifiable83// once the entry point is overwritten.84InlineCacheBuffer::queue_for_release((CompiledICHolder*)_value->data());85}8687if (TraceCompiledIC) {88tty->print(" ");89print_compiled_ic();90tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point));91if (!is_optimized()) {92tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache));93}94if (is_icstub) {95tty->print(" (icstub)");96}97tty->cr();98}99100{101MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);102#ifdef ASSERT103CodeBlob* cb = CodeCache::find_blob_unsafe(_ic_call);104assert(cb != NULL && cb->is_nmethod(), "must be nmethod");105#endif106_ic_call->set_destination_mt_safe(entry_point);107}108109if (is_optimized() || is_icstub) {110// Optimized call sites don't have a cache value and ICStub call111// sites only change the entry point. Changing the value in that112// case could lead to MT safety issues.113assert(cache == NULL, "must be null");114return;115}116117if (cache == NULL) cache = (void*)Universe::non_oop_word();118119_value->set_data((intptr_t)cache);120}121122123void CompiledIC::set_ic_destination(ICStub* stub) {124internal_set_ic_destination(stub->code_begin(), true, NULL, false);125}126127128129address CompiledIC::ic_destination() const {130assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");131if (!is_in_transition_state()) {132return _ic_call->destination();133} else {134return InlineCacheBuffer::ic_destination_for((CompiledIC *)this);135}136}137138139bool CompiledIC::is_in_transition_state() const {140assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");141return InlineCacheBuffer::contains(_ic_call->destination());142}143144145bool CompiledIC::is_icholder_call() const {146assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");147return !_is_optimized && is_icholder_entry(ic_destination());148}149150// Returns native address of 'call' instruction in inline-cache. Used by151// the InlineCacheBuffer when it needs to find the stub.152address CompiledIC::stub_address() const {153assert(is_in_transition_state(), "should only be called when we are in a transition state");154return _ic_call->destination();155}156157// Clears the IC stub if the compiled IC is in transition state158void CompiledIC::clear_ic_stub() {159if (is_in_transition_state()) {160ICStub* stub = ICStub_from_destination_address(stub_address());161stub->clear();162}163}164165166//-----------------------------------------------------------------------------167// High-level access to an inline cache. Guaranteed to be MT-safe.168169void CompiledIC::initialize_from_iter(RelocIterator* iter) {170assert(iter->addr() == _ic_call->instruction_address(), "must find ic_call");171172if (iter->type() == relocInfo::virtual_call_type) {173virtual_call_Relocation* r = iter->virtual_call_reloc();174_is_optimized = false;175_value = nativeMovConstReg_at(r->cached_value());176} else {177assert(iter->type() == relocInfo::opt_virtual_call_type, "must be a virtual call");178_is_optimized = true;179_value = NULL;180}181}182183CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)184: _ic_call(call)185{186address ic_call = _ic_call->instruction_address();187188assert(ic_call != NULL, "ic_call address must be set");189assert(nm != NULL, "must pass nmethod");190assert(nm->contains(ic_call), "must be in nmethod");191192// Search for the ic_call at the given address.193RelocIterator iter(nm, ic_call, ic_call+1);194bool ret = iter.next();195assert(ret == true, "relocInfo must exist at this address");196assert(iter.addr() == ic_call, "must find ic_call");197198initialize_from_iter(&iter);199}200201CompiledIC::CompiledIC(RelocIterator* iter)202: _ic_call(nativeCall_at(iter->addr()))203{204address ic_call = _ic_call->instruction_address();205206nmethod* nm = iter->code();207assert(ic_call != NULL, "ic_call address must be set");208assert(nm != NULL, "must pass nmethod");209assert(nm->contains(ic_call), "must be in nmethod");210211initialize_from_iter(iter);212}213214bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {215assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");216assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic");217assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?");218219address entry;220if (call_info->call_kind() == CallInfo::itable_call) {221assert(bytecode == Bytecodes::_invokeinterface, "");222int itable_index = call_info->itable_index();223entry = VtableStubs::find_itable_stub(itable_index);224if (entry == NULL /* false */ ) {225return false;226}227#ifdef ASSERT228int index = call_info->resolved_method()->itable_index();229assert(index == itable_index, "CallInfo pre-computes this");230InstanceKlass* k = call_info->resolved_method()->method_holder();231assert(k->verify_itable_index(itable_index), "sanity check");232#endif //ASSERT233CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(),234call_info->resolved_klass()(), false);235holder->claim();236InlineCacheBuffer::create_transition_stub(this, holder, entry);237} else {238assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable");239// Can be different than selected_method->vtable_index(), due to package-private etc.240int vtable_index = call_info->vtable_index();241assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");242entry = VtableStubs::find_vtable_stub(vtable_index);243if (entry == NULL) {244return false;245}246InlineCacheBuffer::create_transition_stub(this, NULL, entry);247}248249if (TraceICs) {250ResourceMark rm;251tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,252p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));253}254255// We can't check this anymore. With lazy deopt we could have already256// cleaned this IC entry before we even return. This is possible if257// we ran out of space in the inline cache buffer trying to do the258// set_next and we safepointed to free up space. This is a benign259// race because the IC entry was complete when we safepointed so260// cleaning it immediately is harmless.261// assert(is_megamorphic(), "sanity check");262return true;263}264265266// true if destination is megamorphic stub267bool CompiledIC::is_megamorphic() const {268assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");269assert(!is_optimized(), "an optimized call cannot be megamorphic");270271// Cannot rely on cached_value. It is either an interface or a method.272return VtableStubs::entry_point(ic_destination()) != NULL;273}274275bool CompiledIC::is_call_to_compiled() const {276assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");277278// Use unsafe, since an inline cache might point to a zombie method. However, the zombie279// method is guaranteed to still exist, since we only remove methods after all inline caches280// has been cleaned up281CodeBlob* cb = CodeCache::find_blob_unsafe(ic_destination());282bool is_monomorphic = (cb != NULL && cb->is_nmethod());283// Check that the cached_value is a klass for non-optimized monomorphic calls284// This assertion is invalid for compiler1: a call that does not look optimized (no static stub) can be used285// for calling directly to vep without using the inline cache (i.e., cached_value == NULL)286#ifdef ASSERT287CodeBlob* caller = CodeCache::find_blob_unsafe(instruction_address());288bool is_c1_method = caller->is_compiled_by_c1();289assert( is_c1_method ||290!is_monomorphic ||291is_optimized() ||292!caller->is_alive() ||293(cached_metadata() != NULL && cached_metadata()->is_klass()), "sanity check");294#endif // ASSERT295return is_monomorphic;296}297298299bool CompiledIC::is_call_to_interpreted() const {300assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");301// Call to interpreter if destination is either calling to a stub (if it302// is optimized), or calling to an I2C blob303bool is_call_to_interpreted = false;304if (!is_optimized()) {305// must use unsafe because the destination can be a zombie (and we're cleaning)306// and the print_compiled_ic code wants to know if site (in the non-zombie)307// is to the interpreter.308CodeBlob* cb = CodeCache::find_blob_unsafe(ic_destination());309is_call_to_interpreted = (cb != NULL && cb->is_adapter_blob());310assert(!is_call_to_interpreted || (is_icholder_call() && cached_icholder() != NULL), "sanity check");311} else {312// Check if we are calling into our own codeblob (i.e., to a stub)313CodeBlob* cb = CodeCache::find_blob(_ic_call->instruction_address());314address dest = ic_destination();315#ifdef ASSERT316{317CodeBlob* db = CodeCache::find_blob_unsafe(dest);318assert(!db->is_adapter_blob(), "must use stub!");319}320#endif /* ASSERT */321is_call_to_interpreted = cb->contains(dest);322}323return is_call_to_interpreted;324}325326327void CompiledIC::set_to_clean(bool in_use) {328assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");329if (TraceInlineCacheClearing || TraceICs) {330tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));331print();332}333334address entry;335if (is_optimized()) {336entry = SharedRuntime::get_resolve_opt_virtual_call_stub();337} else {338entry = SharedRuntime::get_resolve_virtual_call_stub();339}340341// A zombie transition will always be safe, since the metadata has already been set to NULL, so342// we only need to patch the destination343bool safe_transition = !in_use || is_optimized() || SafepointSynchronize::is_at_safepoint();344345if (safe_transition) {346// Kill any leftover stub we might have too347clear_ic_stub();348if (is_optimized()) {349set_ic_destination(entry);350} else {351set_ic_destination_and_value(entry, (void*)NULL);352}353} else {354// Unsafe transition - create stub.355InlineCacheBuffer::create_transition_stub(this, NULL, entry);356}357// We can't check this anymore. With lazy deopt we could have already358// cleaned this IC entry before we even return. This is possible if359// we ran out of space in the inline cache buffer trying to do the360// set_next and we safepointed to free up space. This is a benign361// race because the IC entry was complete when we safepointed so362// cleaning it immediately is harmless.363// assert(is_clean(), "sanity check");364}365366367bool CompiledIC::is_clean() const {368assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");369bool is_clean = false;370address dest = ic_destination();371is_clean = dest == SharedRuntime::get_resolve_opt_virtual_call_stub() ||372dest == SharedRuntime::get_resolve_virtual_call_stub();373assert(!is_clean || is_optimized() || cached_value() == NULL, "sanity check");374return is_clean;375}376377378void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {379assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");380// Updating a cache to the wrong entry can cause bugs that are very hard381// to track down - if cache entry gets invalid - we just clean it. In382// this way it is always the same code path that is responsible for383// updating and resolving an inline cache384//385// The above is no longer true. SharedRuntime::fixup_callers_callsite will change optimized386// callsites. In addition ic_miss code will update a site to monomorphic if it determines387// that an monomorphic call to the interpreter can now be monomorphic to compiled code.388//389// In both of these cases the only thing being modifed is the jump/call target and these390// transitions are mt_safe391392Thread *thread = Thread::current();393if (info.to_interpreter()) {394// Call to interpreter395if (info.is_optimized() && is_optimized()) {396assert(is_clean(), "unsafe IC path");397MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);398// the call analysis (callee structure) specifies that the call is optimized399// (either because of CHA or the static target is final)400// At code generation time, this call has been emitted as static call401// Call via stub402assert(info.cached_metadata() != NULL && info.cached_metadata()->is_method(), "sanity check");403CompiledStaticCall* csc = compiledStaticCall_at(instruction_address());404methodHandle method (thread, (Method*)info.cached_metadata());405csc->set_to_interpreted(method, info.entry());406if (TraceICs) {407ResourceMark rm(thread);408tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",409p2i(instruction_address()),410method->print_value_string());411}412} else {413// Call via method-klass-holder414InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());415if (TraceICs) {416ResourceMark rm(thread);417tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));418}419}420} else {421// Call to compiled code422bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL);423#ifdef ASSERT424CodeBlob* cb = CodeCache::find_blob_unsafe(info.entry());425assert (cb->is_nmethod(), "must be compiled!");426#endif /* ASSERT */427428// This is MT safe if we come from a clean-cache and go through a429// non-verified entry point430bool safe = SafepointSynchronize::is_at_safepoint() ||431(!is_in_transition_state() && (info.is_optimized() || static_bound || is_clean()));432433if (!safe) {434InlineCacheBuffer::create_transition_stub(this, info.cached_metadata(), info.entry());435} else {436if (is_optimized()) {437set_ic_destination(info.entry());438} else {439set_ic_destination_and_value(info.entry(), info.cached_metadata());440}441}442443if (TraceICs) {444ResourceMark rm(thread);445assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");446tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s",447p2i(instruction_address()),448((Klass*)info.cached_metadata())->print_value_string(),449(safe) ? "" : "via stub");450}451}452// We can't check this anymore. With lazy deopt we could have already453// cleaned this IC entry before we even return. This is possible if454// we ran out of space in the inline cache buffer trying to do the455// set_next and we safepointed to free up space. This is a benign456// race because the IC entry was complete when we safepointed so457// cleaning it immediately is harmless.458// assert(is_call_to_compiled() || is_call_to_interpreted(), "sanity check");459}460461462// is_optimized: Compiler has generated an optimized call (i.e., no inline463// cache) static_bound: The call can be static bound (i.e, no need to use464// inline cache)465void CompiledIC::compute_monomorphic_entry(methodHandle method,466KlassHandle receiver_klass,467bool is_optimized,468bool static_bound,469CompiledICInfo& info,470TRAPS) {471nmethod* method_code = method->code();472address entry = NULL;473if (method_code != NULL && method_code->is_in_use()) {474// Call to compiled code475if (static_bound || is_optimized) {476entry = method_code->verified_entry_point();477} else {478entry = method_code->entry_point();479}480}481if (entry != NULL) {482// Call to compiled code483info.set_compiled_entry(entry, (static_bound || is_optimized) ? NULL : receiver_klass(), is_optimized);484} else {485// Note: the following problem exists with Compiler1:486// - at compile time we may or may not know if the destination is final487// - if we know that the destination is final, we will emit an optimized488// virtual call (no inline cache), and need a Method* to make a call489// to the interpreter490// - if we do not know if the destination is final, we emit a standard491// virtual call, and use CompiledICHolder to call interpreted code492// (no static call stub has been generated)493// However in that case we will now notice it is static_bound494// and convert the call into what looks to be an optimized495// virtual call. This causes problems in verifying the IC because496// it look vanilla but is optimized. Code in is_call_to_interpreted497// is aware of this and weakens its asserts.498499// static_bound should imply is_optimized -- otherwise we have a500// performance bug (statically-bindable method is called via501// dynamically-dispatched call note: the reverse implication isn't502// necessarily true -- the call may have been optimized based on compiler503// analysis (static_bound is only based on "final" etc.)504#ifdef COMPILER2505#ifdef TIERED506#if defined(ASSERT)507// can't check the assert because we don't have the CompiledIC with which to508// find the address if the call instruction.509//510// CodeBlob* cb = find_blob_unsafe(instruction_address());511// assert(cb->is_compiled_by_c1() || !static_bound || is_optimized, "static_bound should imply is_optimized");512#endif // ASSERT513#else514assert(!static_bound || is_optimized, "static_bound should imply is_optimized");515#endif // TIERED516#endif // COMPILER2517if (is_optimized) {518// Use stub entry519info.set_interpreter_entry(method()->get_c2i_entry(), method());520} else {521// Use icholder entry522CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass());523info.set_icholder_entry(method()->get_c2i_unverified_entry(), holder);524}525}526assert(info.is_optimized() == is_optimized, "must agree");527}528529530bool CompiledIC::is_icholder_entry(address entry) {531CodeBlob* cb = CodeCache::find_blob_unsafe(entry);532if (cb != NULL && cb->is_adapter_blob()) {533return true;534}535// itable stubs also use CompiledICHolder536if (cb != NULL && cb->is_vtable_blob()) {537VtableStub* s = VtableStubs::entry_point(entry);538return (s != NULL) && s->is_itable_stub();539}540541return false;542}543544// ----------------------------------------------------------------------------545546void CompiledStaticCall::set_to_clean() {547assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");548// Reset call site549MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);550#ifdef ASSERT551CodeBlob* cb = CodeCache::find_blob_unsafe(this);552assert(cb != NULL && cb->is_nmethod(), "must be nmethod");553#endif554set_destination_mt_safe(SharedRuntime::get_resolve_static_call_stub());555556// Do not reset stub here: It is too expensive to call find_stub.557// Instead, rely on caller (nmethod::clear_inline_caches) to clear558// both the call and its stub.559}560561562bool CompiledStaticCall::is_clean() const {563return destination() == SharedRuntime::get_resolve_static_call_stub();564}565566bool CompiledStaticCall::is_call_to_compiled() const {567return CodeCache::contains(destination());568}569570571bool CompiledStaticCall::is_call_to_interpreted() const {572// It is a call to interpreted, if it calls to a stub. Hence, the destination573// must be in the stub part of the nmethod that contains the call574nmethod* nm = CodeCache::find_nmethod(instruction_address());575return nm->stub_contains(destination());576}577578void CompiledStaticCall::set(const StaticCallInfo& info) {579assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");580MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);581// Updating a cache to the wrong entry can cause bugs that are very hard582// to track down - if cache entry gets invalid - we just clean it. In583// this way it is always the same code path that is responsible for584// updating and resolving an inline cache585assert(is_clean(), "do not update a call entry - use clean");586587if (info._to_interpreter) {588// Call to interpreted code589set_to_interpreted(info.callee(), info.entry());590} else {591if (TraceICs) {592ResourceMark rm;593tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT,594p2i(instruction_address()),595p2i(info.entry()));596}597// Call to compiled code598assert (CodeCache::contains(info.entry()), "wrong entry point");599set_destination_mt_safe(info.entry());600}601}602603604// Compute settings for a CompiledStaticCall. Since we might have to set605// the stub when calling to the interpreter, we need to return arguments.606void CompiledStaticCall::compute_entry(methodHandle m, StaticCallInfo& info) {607nmethod* m_code = m->code();608info._callee = m;609if (m_code != NULL && m_code->is_in_use()) {610info._to_interpreter = false;611info._entry = m_code->verified_entry_point();612} else {613// Callee is interpreted code. In any case entering the interpreter614// puts a converter-frame on the stack to save arguments.615assert(!m->is_method_handle_intrinsic(), "Compiled code should never call interpreter MH intrinsics");616info._to_interpreter = true;617info._entry = m()->get_c2i_entry();618}619}620621address CompiledStaticCall::find_stub() {622// Find reloc. information containing this call-site623RelocIterator iter((nmethod*)NULL, instruction_address());624while (iter.next()) {625if (iter.addr() == instruction_address()) {626switch(iter.type()) {627case relocInfo::static_call_type:628return iter.static_call_reloc()->static_stub();629// We check here for opt_virtual_call_type, since we reuse the code630// from the CompiledIC implementation631case relocInfo::opt_virtual_call_type:632return iter.opt_virtual_call_reloc()->static_stub();633case relocInfo::poll_type:634case relocInfo::poll_return_type: // A safepoint can't overlap a call.635default:636ShouldNotReachHere();637}638}639}640return NULL;641}642643644//-----------------------------------------------------------------------------645// Non-product mode code646#ifndef PRODUCT647648void CompiledIC::verify() {649// make sure code pattern is actually a call imm32 instruction650_ic_call->verify();651if (os::is_MP()) {652_ic_call->verify_alignment();653}654assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted()655|| is_optimized() || is_megamorphic(), "sanity check");656}657658void CompiledIC::print() {659print_compiled_ic();660tty->cr();661}662663void CompiledIC::print_compiled_ic() {664tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,665p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));666}667668void CompiledStaticCall::print() {669tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address()));670if (is_clean()) {671tty->print("clean");672} else if (is_call_to_compiled()) {673tty->print("compiled");674} else if (is_call_to_interpreted()) {675tty->print("interpreted");676}677tty->cr();678}679680#endif // !PRODUCT681682683