< 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.
*** 242,261 **** // 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(); --- 242,261 ---- // 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();
*** 274,284 **** } 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; --- 274,284 ---- } 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;
*** 509,518 **** --- 509,519 ---- 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;
*** 534,546 **** // null check on a call when the target isn't loaded). // This causes problems when verifying the IC because // it looks vanilla but is optimized. Code in is_call_to_interpreted // is aware of this and weakens its asserts. if (is_optimized) { ! entry = method_code->verified_entry_point(); } else { ! entry = method_code->entry_point(); } } bool far_c2a = entry != NULL && caller_is_nmethod && method_code->is_far_code(); if (entry != NULL && !far_c2a) { // Call to near compiled code (nmethod or aot). --- 535,547 ---- // null check on a call when the target isn't loaded). // This causes problems when verifying the IC because // it looks vanilla but is optimized. Code in is_call_to_interpreted // is aware of this and weakens its asserts. if (is_optimized) { ! entry = caller_is_c1 ? method_code->verified_value_entry_point() : method_code->verified_entry_point(); } else { ! entry = caller_is_c1 ? method_code->value_entry_point() : method_code->entry_point(); } } bool far_c2a = entry != NULL && caller_is_nmethod && method_code->is_far_code(); if (entry != NULL && !far_c2a) { // Call to near compiled code (nmethod or aot).
*** 550,566 **** 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); ! info.set_icholder_entry(method()->get_c2i_unverified_entry(), holder); } } assert(info.is_optimized() == is_optimized, "must agree"); } --- 551,569 ---- 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); ! entry = (caller_is_c1)? method()->get_c2i_unverified_value_entry() : method()->get_c2i_unverified_entry(); ! info.set_icholder_entry(entry, holder); } } assert(info.is_optimized() == is_optimized, "must agree"); }
*** 655,682 **** } } // 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. info._to_aot = true; } else { info._to_aot = false; } info._to_interpreter = false; ! info._entry = m_code->verified_entry_point(); } 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; ! info._entry = m()->get_c2i_entry(); } } address CompiledDirectStaticCall::find_stub_for(address instruction, bool is_aot) { // Find reloc. information containing this call-site --- 658,697 ---- } } // 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. info._to_aot = true; } else { info._to_aot = false; } info._to_interpreter = false; ! if (caller_nm->is_compiled_by_c1()) { ! info._entry = m_code->verified_value_entry_point(); ! } else { ! info._entry = m_code->verified_entry_point(); ! } } 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_compiled_by_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
< prev index next >