src/hotspot/share/runtime/compilationPolicy.cpp
changeset 54015 cd701366fcf8
parent 53194 c4a64760b1b0
child 54983 81becad91321
--- a/src/hotspot/share/runtime/compilationPolicy.cpp	Thu Mar 07 00:23:45 2019 +0100
+++ b/src/hotspot/share/runtime/compilationPolicy.cpp	Thu Mar 07 08:38:16 2019 +0100
@@ -176,6 +176,14 @@
 }
 
 CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) {
+  // Remove unloaded methods from the queue
+  for (CompileTask* task = compile_queue->first(); task != NULL; ) {
+    CompileTask* next = task->next();
+    if (task->is_unloaded()) {
+      compile_queue->remove_and_mark_stale(task);
+    }
+    task = next;
+  }
 #if INCLUDE_JVMCI
   if (UseJVMCICompiler && !BackgroundCompilation) {
     /*