hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
changeset 27643 fe8f95a2d9bc
parent 27148 a4b542d56e01
child 28650 772aaab2582f
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Mon Nov 10 19:04:38 2014 +0300
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Tue Nov 11 11:05:41 2014 +0100
@@ -54,13 +54,17 @@
 // Simple methods are as good being compiled with C1 as C2.
 // Determine if a given method is such a case.
 bool SimpleThresholdPolicy::is_trivial(Method* method) {
-  if (method->is_accessor()) return true;
-  if (method->code() != NULL) {
-    MethodData* mdo = method->method_data();
-    if (mdo != NULL && mdo->num_loops() == 0 &&
-        (method->code_size() < 5  || (mdo->num_blocks() < 4) && (method->code_size() < 15))) {
-      return !mdo->would_profile();
-    }
+  if (method->is_accessor() ||
+      method->is_constant_getter()) {
+    return true;
+  }
+  if (method->has_loops() || method->code_size() >= 15) {
+    return false;
+  }
+  MethodData* mdo = method->method_data();
+  if (mdo != NULL && !mdo->would_profile() &&
+      (method->code_size() < 5  || (mdo->num_blocks() < 4))) {
+    return true;
   }
   return false;
 }