hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp
changeset 36597 ee256e343585
parent 36556 7f092a7ce938
child 38133 78b95467b9f1
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Thu Mar 10 14:53:09 2016 +0000
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp	Thu Mar 03 16:21:16 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, 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
@@ -177,9 +177,7 @@
 
 // Called with the queue locked and with at least one element
 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
-#if INCLUDE_JVMCI
   CompileTask *max_blocking_task = NULL;
-#endif
   CompileTask *max_task = NULL;
   Method* max_method = NULL;
   jlong t = os::javaTimeMillis();
@@ -193,7 +191,8 @@
       max_method = method;
     } else {
       // If a method has been stale for some time, remove it from the queue.
-      if (is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method)) {
+      // Blocking tasks don't become stale
+      if (!task->is_blocking() && is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method)) {
         if (PrintTieredEvents) {
           print_event(REMOVE_FROM_QUEUE, method, method, task->osr_bci(), (CompLevel)task->comp_level());
         }
@@ -210,29 +209,25 @@
         max_method = method;
       }
     }
-#if INCLUDE_JVMCI
-    if (UseJVMCICompiler && task->is_blocking()) {
+
+    if (task->is_blocking()) {
       if (max_blocking_task == NULL || compare_methods(method, max_blocking_task->method())) {
         max_blocking_task = task;
       }
     }
-#endif
+
     task = next_task;
   }
 
-#if INCLUDE_JVMCI
-  if (UseJVMCICompiler) {
-    if (max_blocking_task != NULL) {
-      // In blocking compilation mode, the CompileBroker will make
-      // compilations submitted by a JVMCI compiler thread non-blocking. These
-      // compilations should be scheduled after all blocking compilations
-      // to service non-compiler related compilations sooner and reduce the
-      // chance of such compilations timing out.
-      max_task = max_blocking_task;
-      max_method = max_task->method();
-    }
+  if (max_blocking_task != NULL) {
+    // In blocking compilation mode, the CompileBroker will make
+    // compilations submitted by a JVMCI compiler thread non-blocking. These
+    // compilations should be scheduled after all blocking compilations
+    // to service non-compiler related compilations sooner and reduce the
+    // chance of such compilations timing out.
+    max_task = max_blocking_task;
+    max_method = max_task->method();
   }
-#endif
 
   if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile
       && is_method_profiled(max_method)) {