< prev index next >

src/hotspot/share/c1/c1_GraphBuilder.cpp

Print this page
@@ -38,10 +38,12 @@
  #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"

@@ -1709,11 +1711,11 @@
    const bool needs_patching = !holder->is_loaded() ||
                                !field->will_link(method(), code) ||
                                PatchALot;
  
    ValueStack* state_before = nullptr;
-   if (!holder->is_initialized() || needs_patching) {
+   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();
    }
  

@@ -2118,11 +2120,12 @@
    // 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
+     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;

@@ -3861,11 +3864,12 @@
        !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");
+       (!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");
  

@@ -4036,10 +4040,18 @@
      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 >