diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index ddc1fc9..9aed89f 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -459,6 +459,9 @@ bool CompiledMethod::clean_ic_if_metadata_is_dead(CompiledIC *ic) { } } + if (ic->is_clean()) { + return true; + } return ic->set_to_clean(); } diff --git a/src/hotspot/share/code/icBuffer.cpp b/src/hotspot/share/code/icBuffer.cpp index 5c38142..341ca85 100644 --- a/src/hotspot/share/code/icBuffer.cpp +++ b/src/hotspot/share/code/icBuffer.cpp @@ -42,7 +42,6 @@ DEF_STUB_INTERFACE(ICStub); StubQueue* InlineCacheBuffer::_buffer = NULL; -ICStub* InlineCacheBuffer::_next_stub = NULL; CompiledICHolder* InlineCacheBuffer::_pending_released = NULL; int InlineCacheBuffer::_pending_count = 0; @@ -103,12 +102,6 @@ void ICStub::print() { //----------------------------------------------------------------------------------------------- // Implementation of InlineCacheBuffer -void InlineCacheBuffer::init_next_stub() { - ICStub* ic_stub = (ICStub*)buffer()->request_committed (ic_stub_code_size()); - assert (ic_stub != NULL, "no room for a single stub"); - set_next_stub(ic_stub); -} - void InlineCacheBuffer::initialize() { if (_buffer != NULL) return; // already initialized @@ -156,7 +149,7 @@ bool InlineCacheBuffer::contains(address instruction_address) { bool InlineCacheBuffer::is_empty() { - return buffer()->number_of_stubs() == 0; // always has sentinel + return buffer()->number_of_stubs() == 0; } diff --git a/src/hotspot/share/code/icBuffer.hpp b/src/hotspot/share/code/icBuffer.hpp index 43a35a7..4821e30 100644 --- a/src/hotspot/share/code/icBuffer.hpp +++ b/src/hotspot/share/code/icBuffer.hpp @@ -100,17 +100,11 @@ class InlineCacheBuffer: public AllStatic { static int ic_stub_code_size(); static StubQueue* _buffer; - static ICStub* _next_stub; static CompiledICHolder* _pending_released; static int _pending_count; static StubQueue* buffer() { return _buffer; } - static void set_next_stub(ICStub* next_stub) { _next_stub = next_stub; } - static ICStub* get_next_stub() { return _next_stub; } - - static void init_next_stub(); - static ICStub* new_ic_stub(); diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 8636857..05f53a8 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -1625,7 +1625,7 @@ void nmethod::do_unloading(bool unloading_occurred) { #endif guarantee(unload_nmethod_caches(unloading_occurred), - "Should not need tranisition stubs"); + "Should not need transition stubs"); } } diff --git a/src/hotspot/share/code/relocInfo.cpp b/src/hotspot/share/code/relocInfo.cpp index 5d38311..08afb8f 100644 --- a/src/hotspot/share/code/relocInfo.cpp +++ b/src/hotspot/share/code/relocInfo.cpp @@ -677,7 +677,8 @@ bool opt_virtual_call_Relocation::clear_inline_cache() { // Clean IC ResourceMark rm; CompiledIC* icache = CompiledIC_at(this); - guarantee(icache->set_to_clean(), "opt_virtual_call cleaning should never fail"); + guarantee(icache->set_to_clean(), + "Should not need transition stubs"); return true; } @@ -719,7 +720,8 @@ void static_call_Relocation::unpack_data() { bool static_call_Relocation::clear_inline_cache() { // Safe call site info CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this); - guarantee(handler->set_to_clean(), "CompiledStaticCall cleaning should not fail"); + guarantee(handler->set_to_clean(), + "Should not need transition stubs"); return true; } diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 8bf1b9a..279b02e 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1760,11 +1760,15 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) { CompiledICLocker ml(caller_nm); if (is_static_call) { CompiledStaticCall* ssc = caller_nm->compiledStaticCall_at(call_addr); - ssc->set_to_clean(); + if (!ssc->is_clean()) { + ssc->set_to_clean(); + } } else { // compiled, dispatched call (which used to call an interpreted method) CompiledIC* inline_cache = CompiledIC_at(caller_nm, call_addr); - inline_cache->set_to_clean(); + if (!inline_cache->is_clean()) { + inline_cache->set_to_clean(); + } } } }