diff src/share/vm/graal/graalCodeInstaller.cpp @ 17335:508e88b5f1d3

Don't hang onto code install references after install finished
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 02 Oct 2014 10:59:03 -0700
parents 6fcb6691fe5f
children 44b83285b645
line wrap: on
line diff
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu Oct 02 10:57:03 2014 -0700
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Thu Oct 02 10:59:03 2014 -0700
@@ -468,16 +468,16 @@
     // TODO (ds) not sure if this is correct - only used in OopMap constructor for non-product builds
     _parameter_count = 0;
   }
-  _sites_handle = JNIHandles::make_global(HotSpotCompiledCode::sites(compiled_code));
-  _exception_handlers_handle = JNIHandles::make_global(HotSpotCompiledCode::exceptionHandlers(compiled_code));
+  _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code));
+  _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code));
 
-  _code_handle = JNIHandles::make_global(CompilationResult::targetCode(comp_result));
+  _code_handle = JNIHandles::make_local(CompilationResult::targetCode(comp_result));
   _code_size = CompilationResult::targetCodeSize(comp_result);
   _total_frame_size = CompilationResult::totalFrameSize(comp_result);
   _custom_stack_area_offset = CompilationResult::customStackAreaOffset(comp_result);
 
   // Pre-calculate the constants section size.  This is required for PC-relative addressing.
-  _data_section_handle = JNIHandles::make_global(HotSpotCompiledCode::dataSection(compiled_code));
+  _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code));
   guarantee(DataSection::sectionAlignment(data_section()) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin");
   arrayHandle data = (arrayOop) DataSection::data(data_section());
   _constants_size = data->length();
@@ -486,7 +486,7 @@
   }
 
 #ifndef PRODUCT
-  _comments_handle = JNIHandles::make_global((arrayOop) HotSpotCompiledCode::comments(compiled_code));
+  _comments_handle = JNIHandles::make_local((arrayOop) HotSpotCompiledCode::comments(compiled_code));
 #endif
 
   _next_call_type = INVOKE_INVALID;