changeset 23288:d2cd0b15957c

Restore previous order of pushing and popping JNI handle blocks
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 25 Jan 2016 09:21:40 -0800
parents bd88fd590f4e
children 7f298e4d1afb
files src/share/vm/compiler/compileBroker.cpp
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Fri Jan 08 15:46:55 2016 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Mon Jan 25 09:21:40 2016 -0800
@@ -2152,6 +2152,8 @@
     DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, compiler_name(task_level));
   }
 
+  // Allocate a new set of JNI handles.
+  push_jni_handle_block();
   Method* target_handle = task->method();
   int compilable = ciEnv::MethodCompilable;
   const char* failure_reason = NULL;
@@ -2185,9 +2187,6 @@
   } else
 #endif // COMPILERJVMCI
   {
-    // Allocate a new set of JNI handles.
-    push_jni_handle_block();
-    
     NoHandleMark  nhm;
     ThreadToNativeFromVM ttn(thread);
 
@@ -2234,9 +2233,10 @@
     }
 
     post_compile(thread, task, event, !ci_env.failing(), &ci_env);
-    
-    pop_jni_handle_block();
   }
+  // Remove the JNI handle block after the ciEnv destructor has run in
+  // the previous block.
+  pop_jni_handle_block();
 
   if (failure_reason != NULL) {
     if (_compilation_log != NULL) {