diff --git a/src/hotspot/share/code/icBuffer.cpp b/src/hotspot/share/code/icBuffer.cpp index 341ca85..8e0fee4 100644 --- a/src/hotspot/share/code/icBuffer.cpp +++ b/src/hotspot/share/code/icBuffer.cpp @@ -45,6 +45,7 @@ StubQueue* InlineCacheBuffer::_buffer = NULL; CompiledICHolder* InlineCacheBuffer::_pending_released = NULL; int InlineCacheBuffer::_pending_count = 0; +DEBUG_ONLY(volatile int InlineCacheBuffer::_needs_refill = 0;) void ICStub::finalize() { if (!is_empty()) { @@ -116,6 +117,7 @@ ICStub* InlineCacheBuffer::new_ic_stub() { void InlineCacheBuffer::refill_ic_stubs() { + DEBUG_ONLY(Atomic::store(0, &_needs_refill)); // we ran out of inline cache buffer space; must enter safepoint. // We do this by forcing a safepoint EXCEPTION_MARK; @@ -133,6 +135,8 @@ void InlineCacheBuffer::refill_ic_stubs() { void InlineCacheBuffer::update_inline_caches() { + assert(_needs_refill == 0, + "Forgot to handle a failed IC transition requiring IC stubs"); if (buffer()->number_of_stubs() > 0) { if (TraceICBuffer) { tty->print_cr("[updating inline caches with %d stubs]", buffer()->number_of_stubs()); @@ -169,6 +173,7 @@ bool InlineCacheBuffer::create_transition_stub(CompiledIC *ic, void* cached_valu // allocate and initialize new "out-of-line" inline-cache ICStub* ic_stub = new_ic_stub(); if (ic_stub == NULL) { + DEBUG_ONLY(Atomic::inc(&_needs_refill)); return false; }