# HG changeset patch # User Roland Schatz # Date 1447234388 -3600 # Node ID 24fd08e99b358aec6ded2e290a46b93c4b534ddb # Parent e00426c54952e5717258f255e6d7198386e481c6 Backport Handle fixes from jvmci-9. diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/compiler/compileBroker.cpp Wed Nov 11 10:33:08 2015 +0100 @@ -2139,7 +2139,8 @@ EventCompilation event; JVMCIEnv env(task, system_dictionary_modification_counter); - jvmci->compile_method(target_handle, osr_bci, &env); + methodHandle method(thread, target_handle); + jvmci->compile_method(method, osr_bci, &env); post_compile(thread, task, event, task->code() != NULL, NULL); } else diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciCompiler.cpp --- a/src/share/vm/jvmci/jvmciCompiler.cpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciCompiler.cpp Wed Nov 11 10:33:08 2015 +0100 @@ -116,7 +116,7 @@ _bootstrapping = false; } -void JVMCICompiler::compile_method(methodHandle method, int entry_bci, JVMCIEnv* env) { +void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { JVMCI_EXCEPTION_CONTEXT bool is_osr = entry_bci != InvocationEntryBci; diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciCompiler.hpp --- a/src/share/vm/jvmci/jvmciCompiler.hpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciCompiler.hpp Wed Nov 11 10:33:08 2015 +0100 @@ -73,7 +73,7 @@ // Compilation entry point for methods virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci); - void compile_method(methodHandle target, int entry_bci, JVMCIEnv* env); + void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env); virtual bool is_trivial(Method* method); diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciCompilerToVM.cpp --- a/src/share/vm/jvmci/jvmciCompilerToVM.cpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciCompilerToVM.cpp Wed Nov 11 10:33:08 2015 +0100 @@ -58,7 +58,7 @@ #define C2V_END } -oop CompilerToVM::get_jvmci_method(methodHandle method, TRAPS) { +oop CompilerToVM::get_jvmci_method(const methodHandle& method, TRAPS) { if (method() != NULL) { JavaValue result(T_OBJECT); JavaCallArguments args; diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciCompilerToVM.hpp --- a/src/share/vm/jvmci/jvmciCompilerToVM.hpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciCompilerToVM.hpp Wed Nov 11 10:33:08 2015 +0100 @@ -89,7 +89,7 @@ return (MethodData*) (address) metaspaceMethodData; } - static oop get_jvmci_method(methodHandle method, TRAPS); + static oop get_jvmci_method(const methodHandle& method, TRAPS); static oop get_jvmci_type(KlassHandle klass, TRAPS); diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciEnv.cpp --- a/src/share/vm/jvmci/jvmciEnv.cpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciEnv.cpp Wed Nov 11 10:33:08 2015 +0100 @@ -83,7 +83,7 @@ // ------------------------------------------------------------------ KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle accessing_klass, - constantPoolHandle cpool, + const constantPoolHandle& cpool, Symbol* sym, bool require_local) { JVMCI_EXCEPTION_CONTEXT; @@ -174,7 +174,7 @@ // ------------------------------------------------------------------ // Implementation of get_klass_by_index. -KlassHandle JVMCIEnv::get_klass_by_index_impl(constantPoolHandle cpool, +KlassHandle JVMCIEnv::get_klass_by_index_impl(const constantPoolHandle& cpool, int index, bool& is_accessible, KlassHandle accessor) { @@ -215,7 +215,7 @@ // ------------------------------------------------------------------ // Get a klass from the constant pool. -KlassHandle JVMCIEnv::get_klass_by_index(constantPoolHandle cpool, +KlassHandle JVMCIEnv::get_klass_by_index(const constantPoolHandle& cpool, int index, bool& is_accessible, KlassHandle accessor) { @@ -313,7 +313,7 @@ // ------------------------------------------------------------------ -methodHandle JVMCIEnv::get_method_by_index_impl(constantPoolHandle cpool, +methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool, int index, Bytecodes::Code bc, instanceKlassHandle accessor) { if (bc == Bytecodes::_invokedynamic) { @@ -396,7 +396,7 @@ // ------------------------------------------------------------------ -methodHandle JVMCIEnv::get_method_by_index(constantPoolHandle cpool, +methodHandle JVMCIEnv::get_method_by_index(const constantPoolHandle& cpool, int index, Bytecodes::Code bc, instanceKlassHandle accessor) { ResourceMark rm; @@ -453,7 +453,7 @@ // ------------------------------------------------------------------ JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( - methodHandle method, + const methodHandle& method, nmethod*& nm, int entry_bci, CodeOffsets* offsets, diff -r e00426c54952 -r 24fd08e99b35 src/share/vm/jvmci/jvmciEnv.hpp --- a/src/share/vm/jvmci/jvmciEnv.hpp Tue Nov 10 23:16:06 2015 +0100 +++ b/src/share/vm/jvmci/jvmciEnv.hpp Wed Nov 11 10:33:08 2015 +0100 @@ -83,13 +83,13 @@ bool require_local); // Constant pool access. - static KlassHandle get_klass_by_index(constantPoolHandle cpool, + static KlassHandle get_klass_by_index(const constantPoolHandle& cpool, int klass_index, bool& is_accessible, KlassHandle loading_klass); static void get_field_by_index(instanceKlassHandle loading_klass, fieldDescriptor& fd, int field_index); - static methodHandle get_method_by_index(constantPoolHandle cpool, + static methodHandle get_method_by_index(const constantPoolHandle& cpool, int method_index, Bytecodes::Code bc, instanceKlassHandle loading_klass); @@ -106,16 +106,16 @@ // Implementation methods for loading and constant pool access. static KlassHandle get_klass_by_name_impl(KlassHandle accessing_klass, - constantPoolHandle cpool, + const constantPoolHandle& cpool, Symbol* klass_name, bool require_local); - static KlassHandle get_klass_by_index_impl(constantPoolHandle cpool, + static KlassHandle get_klass_by_index_impl(const constantPoolHandle& cpool, int klass_index, bool& is_accessible, KlassHandle loading_klass); static void get_field_by_index_impl(instanceKlassHandle loading_klass, fieldDescriptor& fd, int field_index); - static methodHandle get_method_by_index_impl(constantPoolHandle cpool, + static methodHandle get_method_by_index_impl(const constantPoolHandle& cpool, int method_index, Bytecodes::Code bc, instanceKlassHandle loading_klass); @@ -142,7 +142,7 @@ // Register the result of a compilation. static JVMCIEnv::CodeInstallResult register_method( - methodHandle target, + const methodHandle& target, nmethod*& nm, int entry_bci, CodeOffsets* offsets,