< prev index next >

src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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.

@@ -24,10 +24,11 @@
 
 #ifndef SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
 #define SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
 
 #include "compiler/compilerOracle.hpp"
+#include "oops/method.inline.hpp"
 
 #ifdef TIERED
 
 template<CompLevel level>
 bool SimpleThresholdPolicy::call_predicate_helper(int i, int b, double scale, Method* method) {

@@ -92,8 +93,16 @@
     return true;
   }
   return false;
 }
 
+inline CompLevel SimpleThresholdPolicy::comp_level(Method* method) {
+  CompiledMethod *nm = method->code();
+  if (nm != NULL && nm->is_in_use()) {
+    return (CompLevel)nm->comp_level();
+  }
+  return CompLevel_none;
+}
+
 #endif // TIERED
 
 #endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_INLINE_HPP
< prev index next >