diff src/share/vm/runtime/simpleThresholdPolicy.inline.hpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents f2bdbfe9201b 600c44255e5f
children be896a1983c0
line wrap: on
line diff
--- a/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Tue Apr 07 11:20:51 2015 +0200
+++ b/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp	Tue Apr 07 14:58:49 2015 +0200
@@ -54,7 +54,10 @@
 // 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->is_accessor() ||
+      method->is_constant_getter()) {
+    return true;
+  }
 #ifdef COMPILERGRAAL
   if (TieredCompilation && GraalCompileWithC1Only &&
       SystemDictionary::graal_loader() != NULL &&
@@ -62,12 +65,13 @@
     return true;
   }
 #endif
-  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->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;
 }