< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page
*** 32,16 ***
--- 32,18 ---
  #include "c1/c1_ValueStack.hpp"
  #include "ci/ciArrayKlass.hpp"
  #include "ci/ciInstance.hpp"
  #include "ci/ciObjArray.hpp"
  #include "ci/ciUtilities.hpp"
+ #include "code/SCCache.hpp"
  #include "compiler/compilerDefinitions.inline.hpp"
  #include "compiler/compilerOracle.hpp"
  #include "gc/shared/barrierSet.hpp"
  #include "gc/shared/c1/barrierSetC1.hpp"
  #include "oops/klass.inline.hpp"
  #include "oops/methodCounters.hpp"
+ #include "runtime/runtimeUpcalls.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "runtime/stubRoutines.hpp"
  #include "runtime/vm_version.hpp"
  #include "utilities/bitMap.inline.hpp"
  #include "utilities/macros.hpp"

*** 2673,10 ***
--- 2675,21 ---
      __ metadata2reg(method()->constant_encoding(), meth);
      args->append(meth);
      call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, nullptr);
    }
  
+   MethodDetails method_details(method());
+   RuntimeUpcallInfo* upcall = RuntimeUpcalls::get_first_upcall(RuntimeUpcallType::onMethodEntry, method_details);
+   while (upcall != nullptr) {
+     BasicTypeList signature;
+     signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
+     LIR_OprList* args = new LIR_OprList();
+     args->append(getThreadPointer());
+     call_runtime(&signature, args, upcall->upcall_address(), voidType, nullptr);
+     upcall = RuntimeUpcalls::get_next_upcall(RuntimeUpcallType::onMethodEntry, method_details, upcall);
+   }
+ 
    if (method()->is_synchronized()) {
      LIR_Opr obj;
      if (method()->is_static()) {
        obj = new_register(T_OBJECT);
        __ oop2reg(method()->holder()->java_mirror()->constant_encoding(), obj);

*** 3278,12 ***
--- 3291,17 ---
      MethodCounters* counters_adr = method->ensure_method_counters();
      if (counters_adr == nullptr) {
        bailout("method counters allocation failed");
        return;
      }
+ if (SCCache::is_on()) {
+     counter_holder = new_register(T_METADATA);
+     __ metadata2reg(counters_adr, counter_holder);
+ } else {
      counter_holder = new_pointer_register();
      __ move(LIR_OprFact::intptrConst(counters_adr), counter_holder);
+ }
      offset = in_bytes(backedge ? MethodCounters::backedge_counter_offset() :
                                   MethodCounters::invocation_counter_offset());
    } else if (level == CompLevel_full_profile) {
      counter_holder = new_register(T_METADATA);
      offset = in_bytes(backedge ? MethodData::backedge_counter_offset() :
< prev index next >