src/share/vm/code/icBuffer.cpp
Print this page
rev 2893 : 7121756: Improve C1 inlining policy by using profiling at call sites
Summary: profile based recompilation of methods with C1 with more inlining.
Reviewed-by:
*** 66,76 ****
CompiledIC *ic = CompiledIC_at(ic_site());
assert(CodeCache::find_nmethod(ic->instruction_address()) != NULL, "inline cache in non-nmethod?");
assert(this == ICStub_from_destination_address(ic->stub_address()), "wrong owner of ic buffer");
ic->set_cached_oop(cached_oop());
! ic->set_ic_destination(destination());
}
}
address ICStub::destination() const {
--- 66,76 ----
CompiledIC *ic = CompiledIC_at(ic_site());
assert(CodeCache::find_nmethod(ic->instruction_address()) != NULL, "inline cache in non-nmethod?");
assert(this == ICStub_from_destination_address(ic->stub_address()), "wrong owner of ic buffer");
ic->set_cached_oop(cached_oop());
! ic->set_ic_destination(destination(), ic->is_profiled());
}
}
address ICStub::destination() const {
*** 177,187 ****
void InlineCacheBuffer_init() {
InlineCacheBuffer::initialize();
}
! 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()); }
--- 177,187 ----
void InlineCacheBuffer_init() {
InlineCacheBuffer::initialize();
}
! void InlineCacheBuffer::create_transition_stub(CompiledIC *ic, oop cached_oop, address entry, bool set_profiled) {
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()); }
*** 194,204 ****
// 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
}
--- 194,204 ----
// 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_profiled);
set_next_stub(new_ic_stub()); // can cause safepoint synchronization
}