< prev index next > src/hotspot/share/c1/c1_GraphBuilder.cpp
Print this page
#include "compiler/compileBroker.hpp"
#include "compiler/compilerEvent.hpp"
#include "interpreter/bytecode.hpp"
#include "jfr/jfrEvents.hpp"
#include "memory/resourceArea.hpp"
+ #include "oops/oop.inline.hpp"
+ #include "runtime/runtimeUpcalls.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_JFR
#include "jfr/jfr.hpp"
const bool needs_patching = !holder->is_loaded() ||
!field->will_link(method(), code) ||
PatchALot;
ValueStack* state_before = nullptr;
! if (!holder->is_initialized() || needs_patching) {
// save state before instruction for debug info when
// deoptimization happens during patching
state_before = copy_state_before();
}
const bool needs_patching = !holder->is_loaded() ||
!field->will_link(method(), code) ||
PatchALot;
ValueStack* state_before = nullptr;
! if (!holder->is_initialized() || needs_patching || compilation()->env()->is_precompile()) {
// save state before instruction for debug info when
// deoptimization happens during patching
state_before = copy_state_before();
}
// check if we could do inlining
if (!PatchALot && Inline && target->is_loaded() && !patch_for_appendix &&
callee_holder->is_loaded()) { // the effect of symbolic reference resolution
// callee is known => check if we have static binding
! if ((code == Bytecodes::_invokestatic && klass->is_initialized()) || // invokestatic involves an initialization barrier on declaring class
code == Bytecodes::_invokespecial ||
(code == Bytecodes::_invokevirtual && target->is_final_method()) ||
code == Bytecodes::_invokedynamic) {
// static binding => check if callee is ok
ciMethod* inline_target = (cha_monomorphic_target != nullptr) ? cha_monomorphic_target : target;
// check if we could do inlining
if (!PatchALot && Inline && target->is_loaded() && !patch_for_appendix &&
callee_holder->is_loaded()) { // the effect of symbolic reference resolution
// callee is known => check if we have static binding
! if ((code == Bytecodes::_invokestatic && klass->is_initialized() &&
+ !compilation()->env()->is_precompile()) || // invokestatic involves an initialization barrier on declaring class
code == Bytecodes::_invokespecial ||
(code == Bytecodes::_invokevirtual && target->is_final_method()) ||
code == Bytecodes::_invokedynamic) {
// static binding => check if callee is ok
ciMethod* inline_target = (cha_monomorphic_target != nullptr) ? cha_monomorphic_target : target;
!InlineMethodsWithExceptionHandlers) INLINE_BAILOUT("callee has exception handlers");
if (callee->is_synchronized() &&
!InlineSynchronizedMethods ) INLINE_BAILOUT("callee is synchronized");
if (!callee->holder()->is_linked()) INLINE_BAILOUT("callee's klass not linked yet");
if (bc == Bytecodes::_invokestatic &&
! !callee->holder()->is_initialized()) INLINE_BAILOUT("callee's klass not initialized yet");
if (!callee->has_balanced_monitors()) INLINE_BAILOUT("callee's monitors do not match");
// Proper inlining of methods with jsrs requires a little more work.
if (callee->has_jsrs() ) INLINE_BAILOUT("jsrs not handled properly by inliner yet");
!InlineMethodsWithExceptionHandlers) INLINE_BAILOUT("callee has exception handlers");
if (callee->is_synchronized() &&
!InlineSynchronizedMethods ) INLINE_BAILOUT("callee is synchronized");
if (!callee->holder()->is_linked()) INLINE_BAILOUT("callee's klass not linked yet");
if (bc == Bytecodes::_invokestatic &&
! (!callee->holder()->is_initialized() ||
+ compilation()->env()->is_precompile())) INLINE_BAILOUT("callee's klass not initialized yet");
if (!callee->has_balanced_monitors()) INLINE_BAILOUT("callee's monitors do not match");
// Proper inlining of methods with jsrs requires a little more work.
if (callee->has_jsrs() ) INLINE_BAILOUT("jsrs not handled properly by inliner yet");
Values* args = new Values(1);
args->push(append(new Constant(new MethodConstant(method()))));
append(new RuntimeCall(voidType, "dtrace_method_entry", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), args));
}
+ MethodDetails method_details(callee);
+ RuntimeUpcallInfo* upcall = RuntimeUpcalls::get_first_upcall(RuntimeUpcallType::onMethodEntry, method_details);
+ while (upcall != nullptr) {
+ Values* args = new Values(0);
+ append(new RuntimeCall(voidType, upcall->upcall_name(), upcall->upcall_address(), args));
+ upcall = RuntimeUpcalls::get_next_upcall(RuntimeUpcallType::onMethodEntry, method_details, upcall);
+ }
+
if (profile_inlined_calls()) {
profile_invocation(callee, copy_state_before_with_bci(SynchronizationEntryBCI));
}
BlockBegin* callee_start_block = block_at(0);
< prev index next >