void InlineCacheBuffer::create_transition_stub(CompiledIC *ic, oop cached_oop, address entry) { assert(!SafepointSynchronize::is_at_safepoint(), "should not be called during a safepoint"); assert (CompiledIC_lock->is_locked(), ""); assert(cached_oop == NULL || cached_oop->is_perm(), "must belong to perm. space"); if (TraceICBuffer) { tty->print_cr(" create transition stub for " INTPTR_FORMAT, ic->instruction_address()); } // If an transition stub is already associate with the inline cache, then we remove the association. if (ic->is_in_transition_state()) { ICStub* old_stub = ICStub_from_destination_address(ic->stub_address()); old_stub->clear(); } // allocate and initialize new "out-of-line" inline-cache ICStub* ic_stub = get_next_stub(); ic_stub->set_stub(ic, cached_oop, entry); // Update inline cache in nmethod to point to new "out-of-line" allocated inline cache ic->set_ic_destination(ic_stub->code_begin()); set_next_stub(new_ic_stub()); // can cause safepoint synchronization }
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); }