# HG changeset patch # User Tom Rodriguez # Date 1412272743 25200 # Node ID 508e88b5f1d3711ee6590ac202298ff1458e496d # Parent 0563b652c05294ea790b1f99813334701f9d965e Don't hang onto code install references after install finished diff -r 0563b652c052 -r 508e88b5f1d3 src/share/vm/graal/graalCodeInstaller.cpp --- 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; diff -r 0563b652c052 -r 508e88b5f1d3 src/share/vm/graal/graalCodeInstaller.hpp --- a/src/share/vm/graal/graalCodeInstaller.hpp Thu Oct 02 10:57:03 2014 -0700 +++ b/src/share/vm/graal/graalCodeInstaller.hpp Thu Oct 02 10:59:03 2014 -0700 @@ -29,7 +29,7 @@ /* * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod. */ -class CodeInstaller { +class CodeInstaller : public StackObj { friend class VMStructs; private: enum MarkId { @@ -96,7 +96,7 @@ public: - CodeInstaller() {}; + CodeInstaller() {} GraalEnv::CodeInstallResult install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log); static address runtime_call_target_address(oop runtime_call);