< prev index next >
src/hotspot/share/code/compiledIC.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 241,260 ****
// stubs, or due to running out of IC stubs in an attempted transition to a
// transitional state. The needs_ic_stub_refill value will be set if the failure
// was due to running out of IC stubs, in which case the caller will refill IC
// stubs and retry.
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode,
! bool& needs_ic_stub_refill, TRAPS) {
assert(CompiledICLocker::is_safe(_method), "mt unsafe call");
assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic");
assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?");
address entry;
if (call_info->call_kind() == CallInfo::itable_call) {
assert(bytecode == Bytecodes::_invokeinterface, "");
int itable_index = call_info->itable_index();
! entry = VtableStubs::find_itable_stub(itable_index);
if (entry == NULL) {
return false;
}
#ifdef ASSERT
int index = call_info->resolved_method()->itable_index();
--- 241,260 ----
// stubs, or due to running out of IC stubs in an attempted transition to a
// transitional state. The needs_ic_stub_refill value will be set if the failure
// was due to running out of IC stubs, in which case the caller will refill IC
// stubs and retry.
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode,
! bool& needs_ic_stub_refill, bool caller_is_c1, TRAPS) {
assert(CompiledICLocker::is_safe(_method), "mt unsafe call");
assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic");
assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?");
address entry;
if (call_info->call_kind() == CallInfo::itable_call) {
assert(bytecode == Bytecodes::_invokeinterface, "");
int itable_index = call_info->itable_index();
! entry = VtableStubs::find_itable_stub(itable_index, caller_is_c1);
if (entry == NULL) {
return false;
}
#ifdef ASSERT
int index = call_info->resolved_method()->itable_index();
*** 273,283 ****
} else {
assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable");
// Can be different than selected_method->vtable_index(), due to package-private etc.
int vtable_index = call_info->vtable_index();
assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
! entry = VtableStubs::find_vtable_stub(vtable_index);
if (entry == NULL) {
return false;
}
if (!InlineCacheBuffer::create_transition_stub(this, NULL, entry)) {
needs_ic_stub_refill = true;
--- 273,283 ----
} else {
assert(call_info->call_kind() == CallInfo::vtable_call, "either itable or vtable");
// Can be different than selected_method->vtable_index(), due to package-private etc.
int vtable_index = call_info->vtable_index();
assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
! entry = VtableStubs::find_vtable_stub(vtable_index, caller_is_c1);
if (entry == NULL) {
return false;
}
if (!InlineCacheBuffer::create_transition_stub(this, NULL, entry)) {
needs_ic_stub_refill = true;
*** 508,517 ****
--- 508,518 ----
void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
Klass* receiver_klass,
bool is_optimized,
bool static_bound,
bool caller_is_nmethod,
+ bool caller_is_c1,
CompiledICInfo& info,
TRAPS) {
CompiledMethod* method_code = method->code();
address entry = NULL;
*** 549,559 ****
if (far_c2a) {
// Call to aot code from nmethod.
info.set_aot_entry(entry, method());
} else {
// Use stub entry
! info.set_interpreter_entry(method()->get_c2i_entry(), method());
}
} else {
// Use icholder entry
assert(method_code == NULL || method_code->is_compiled(), "must be compiled");
CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass);
--- 550,561 ----
if (far_c2a) {
// Call to aot code from nmethod.
info.set_aot_entry(entry, method());
} else {
// Use stub entry
! address entry = caller_is_c1 ? method()->get_c2i_value_entry() : method()->get_c2i_entry();
! info.set_interpreter_entry(entry, method());
}
} else {
// Use icholder entry
assert(method_code == NULL || method_code->is_compiled(), "must be compiled");
CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass);
*** 654,664 ****
}
}
// Compute settings for a CompiledStaticCall. Since we might have to set
// the stub when calling to the interpreter, we need to return arguments.
! void CompiledStaticCall::compute_entry(const methodHandle& m, bool caller_is_nmethod, StaticCallInfo& info) {
CompiledMethod* m_code = m->code();
info._callee = m;
if (m_code != NULL && m_code->is_in_use()) {
if (caller_is_nmethod && m_code->is_far_code()) {
// Call to far aot code from nmethod.
--- 656,667 ----
}
}
// Compute settings for a CompiledStaticCall. Since we might have to set
// the stub when calling to the interpreter, we need to return arguments.
! void CompiledStaticCall::compute_entry(const methodHandle& m, CompiledMethod* caller_nm, StaticCallInfo& info) {
! bool caller_is_nmethod = caller_nm->is_nmethod();
CompiledMethod* m_code = m->code();
info._callee = m;
if (m_code != NULL && m_code->is_in_use()) {
if (caller_is_nmethod && m_code->is_far_code()) {
// Call to far aot code from nmethod.
*** 671,682 ****
--- 674,692 ----
} else {
// Callee is interpreted code. In any case entering the interpreter
// puts a converter-frame on the stack to save arguments.
assert(!m->is_method_handle_intrinsic(), "Compiled code should never call interpreter MH intrinsics");
info._to_interpreter = true;
+
+ if (caller_nm->is_c1()) {
+ // C1 -> interp: values passed as oops
+ info._entry = m()->get_c2i_value_entry();
+ } else {
+ // C2 -> interp: values passed fields
info._entry = m()->get_c2i_entry();
}
+ }
}
address CompiledDirectStaticCall::find_stub_for(address instruction, bool is_aot) {
// Find reloc. information containing this call-site
RelocIterator iter((nmethod*)NULL, instruction);
< prev index next >