# HG changeset patch # User Roland Schatz # Date 1447074127 -3600 # Mon Nov 09 14:02:07 2015 +0100 # Node ID 76634899c88a9b687597442069a777a426e8c525 # Parent da94f60010409c214ea9f69fa630bbddc0c52ff3 8142329: [JVMCI] pass Handle by value diff --git a/src/share/vm/jvmci/jvmciCodeInstaller.cpp b/src/share/vm/jvmci/jvmciCodeInstaller.cpp --- a/src/share/vm/jvmci/jvmciCodeInstaller.cpp +++ b/src/share/vm/jvmci/jvmciCodeInstaller.cpp @@ -475,7 +475,7 @@ _size = bytes; } -JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle& compiled_code, CodeMetadata& metadata, TRAPS) { +JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS) { CodeBuffer buffer("JVMCI Compiler CodeBuffer for Metadata"); jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); initialize_dependencies(JNIHandles::resolve(compiled_code_obj), NULL, CHECK_OK); @@ -508,7 +508,7 @@ } // constructor used to create a method -JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) { +JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) { CodeBuffer buffer("JVMCI Compiler CodeBuffer"); jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); OopRecorder* recorder = new OopRecorder(&_arena, true); diff --git a/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/src/share/vm/jvmci/jvmciCodeInstaller.hpp --- a/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -177,8 +177,8 @@ CodeInstaller() : _arena(mtCompiler) {} - JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle& compiled_code, CodeMetadata& metadata, TRAPS); - JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS); + JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS); + JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS); static address runtime_call_target_address(oop runtime_call); static VMReg get_hotspot_reg(jint jvmciRegisterNumber, TRAPS); diff --git a/src/share/vm/jvmci/jvmciEnv.cpp b/src/share/vm/jvmci/jvmciEnv.cpp --- a/src/share/vm/jvmci/jvmciEnv.cpp +++ b/src/share/vm/jvmci/jvmciEnv.cpp @@ -82,8 +82,8 @@ } // ------------------------------------------------------------------ -KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle& accessing_klass, - constantPoolHandle& cpool, +KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle accessing_klass, + constantPoolHandle cpool, Symbol* sym, bool require_local) { JVMCI_EXCEPTION_CONTEXT; @@ -161,7 +161,7 @@ } // ------------------------------------------------------------------ -KlassHandle JVMCIEnv::get_klass_by_name(KlassHandle& accessing_klass, +KlassHandle JVMCIEnv::get_klass_by_name(KlassHandle accessing_klass, Symbol* klass_name, bool require_local) { ResourceMark rm; @@ -174,10 +174,10 @@ // ------------------------------------------------------------------ // Implementation of get_klass_by_index. -KlassHandle JVMCIEnv::get_klass_by_index_impl(constantPoolHandle& cpool, +KlassHandle JVMCIEnv::get_klass_by_index_impl(constantPoolHandle cpool, int index, bool& is_accessible, - KlassHandle& accessor) { + KlassHandle accessor) { JVMCI_EXCEPTION_CONTEXT; KlassHandle klass (THREAD, ConstantPool::klass_at_if_loaded(cpool, index)); Symbol* klass_name = NULL; @@ -215,10 +215,10 @@ // ------------------------------------------------------------------ // Get a klass from the constant pool. -KlassHandle JVMCIEnv::get_klass_by_index(constantPoolHandle& cpool, +KlassHandle JVMCIEnv::get_klass_by_index(constantPoolHandle cpool, int index, bool& is_accessible, - KlassHandle& accessor) { + KlassHandle accessor) { ResourceMark rm; KlassHandle result = get_klass_by_index_impl(cpool, index, is_accessible, accessor); return result; @@ -229,7 +229,7 @@ // // Implementation note: the results of field lookups are cached // in the accessor klass. -void JVMCIEnv::get_field_by_index_impl(instanceKlassHandle& klass, fieldDescriptor& field_desc, +void JVMCIEnv::get_field_by_index_impl(instanceKlassHandle klass, fieldDescriptor& field_desc, int index) { JVMCI_EXCEPTION_CONTEXT; @@ -270,7 +270,7 @@ // ------------------------------------------------------------------ // Get a field by index from a klass's constant pool. -void JVMCIEnv::get_field_by_index(instanceKlassHandle& accessor, fieldDescriptor& fd, int index) { +void JVMCIEnv::get_field_by_index(instanceKlassHandle accessor, fieldDescriptor& fd, int index) { ResourceMark rm; return get_field_by_index_impl(accessor, fd, index); } @@ -278,8 +278,8 @@ // ------------------------------------------------------------------ // Perform an appropriate method lookup based on accessor, holder, // name, signature, and bytecode. -methodHandle JVMCIEnv::lookup_method(instanceKlassHandle& h_accessor, - instanceKlassHandle& h_holder, +methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor, + instanceKlassHandle h_holder, Symbol* name, Symbol* sig, Bytecodes::Code bc) { @@ -312,9 +312,9 @@ // ------------------------------------------------------------------ -methodHandle JVMCIEnv::get_method_by_index_impl(constantPoolHandle& cpool, +methodHandle JVMCIEnv::get_method_by_index_impl(constantPoolHandle cpool, int index, Bytecodes::Code bc, - instanceKlassHandle& accessor) { + instanceKlassHandle accessor) { if (bc == Bytecodes::_invokedynamic) { ConstantPoolCacheEntry* cpce = cpool->invokedynamic_cp_cache_entry_at(index); bool is_resolved = !cpce->is_f1_null(); @@ -379,7 +379,7 @@ } // ------------------------------------------------------------------ -instanceKlassHandle JVMCIEnv::get_instance_klass_for_declared_method_holder(KlassHandle& method_holder) { +instanceKlassHandle JVMCIEnv::get_instance_klass_for_declared_method_holder(KlassHandle method_holder) { // For the case of .clone(), the method holder can be an ArrayKlass* // instead of an InstanceKlass*. For that case simply pretend that the // declared holder is Object.clone since that's where the call will bottom out. @@ -395,9 +395,9 @@ // ------------------------------------------------------------------ -methodHandle JVMCIEnv::get_method_by_index(constantPoolHandle& cpool, +methodHandle JVMCIEnv::get_method_by_index(constantPoolHandle cpool, int index, Bytecodes::Code bc, - instanceKlassHandle& accessor) { + instanceKlassHandle accessor) { ResourceMark rm; return get_method_by_index_impl(cpool, index, bc, accessor); } @@ -452,7 +452,7 @@ // ------------------------------------------------------------------ JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( - methodHandle& method, + methodHandle method, nmethod*& nm, int entry_bci, CodeOffsets* offsets, diff --git a/src/share/vm/jvmci/jvmciEnv.hpp b/src/share/vm/jvmci/jvmciEnv.hpp --- a/src/share/vm/jvmci/jvmciEnv.hpp +++ b/src/share/vm/jvmci/jvmciEnv.hpp @@ -78,20 +78,20 @@ // The CI treats a klass as loaded if it is consistently defined in // another loader, even if it hasn't yet been loaded in all loaders // that could potentially see it via delegation. - static KlassHandle get_klass_by_name(KlassHandle& accessing_klass, + static KlassHandle get_klass_by_name(KlassHandle accessing_klass, Symbol* klass_name, bool require_local); // Constant pool access. - static KlassHandle get_klass_by_index(constantPoolHandle& cpool, + static KlassHandle get_klass_by_index(constantPoolHandle cpool, int klass_index, bool& is_accessible, - KlassHandle& loading_klass); - static void get_field_by_index(instanceKlassHandle& loading_klass, fieldDescriptor& fd, + 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(constantPoolHandle cpool, int method_index, Bytecodes::Code bc, - instanceKlassHandle& loading_klass); + instanceKlassHandle loading_klass); JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter); @@ -105,24 +105,24 @@ bool _jvmti_can_post_on_exceptions; // Implementation methods for loading and constant pool access. - static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass, - constantPoolHandle& cpool, + static KlassHandle get_klass_by_name_impl(KlassHandle accessing_klass, + constantPoolHandle cpool, Symbol* klass_name, bool require_local); - static KlassHandle get_klass_by_index_impl(constantPoolHandle& cpool, + static KlassHandle get_klass_by_index_impl(constantPoolHandle cpool, int klass_index, bool& is_accessible, - KlassHandle& loading_klass); - static void get_field_by_index_impl(instanceKlassHandle& loading_klass, fieldDescriptor& fd, + 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(constantPoolHandle cpool, int method_index, Bytecodes::Code bc, - instanceKlassHandle& loading_klass); + instanceKlassHandle loading_klass); // Helper methods static bool check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass); - static methodHandle lookup_method(instanceKlassHandle& accessor, - instanceKlassHandle& holder, + static methodHandle lookup_method(instanceKlassHandle accessor, + instanceKlassHandle holder, Symbol* name, Symbol* sig, Bytecodes::Code bc); @@ -142,7 +142,7 @@ // Register the result of a compilation. static JVMCIEnv::CodeInstallResult register_method( - methodHandle& target, + methodHandle target, nmethod*& nm, int entry_bci, CodeOffsets* offsets, @@ -166,7 +166,7 @@ // InstanceKlass*. This is needed since the holder of a method in // the bytecodes could be an array type. Basically this converts // array types into java/lang/Object and other types stay as they are. - static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle& klass); + static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle klass); }; #endif // SHARE_VM_JVMCI_JVMCIENV_HPP diff --git a/src/share/vm/jvmci/jvmciJavaClasses.hpp b/src/share/vm/jvmci/jvmciJavaClasses.hpp --- a/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -315,10 +315,10 @@ #define FIELD(name, type, accessor, cast) \ static int _##name##_offset; \ static type name(oop obj) { check(obj, #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ - static type name(Handle& obj) { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ + static type name(Handle obj) { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ static type name(jobject obj) { check(JNIHandles::resolve(obj), #name, _##name##_offset); return cast JNIHandles::resolve(obj)->accessor(_##name##_offset); } \ static void set_##name(oop obj, type x) { check(obj, #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ - static void set_##name(Handle& obj, type x) { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ + static void set_##name(Handle obj, type x) { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj), #name, _##name##_offset); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); } #define EMPTY_CAST # HG changeset patch # User Roland Schatz # Date 1447091831 -3600 # Mon Nov 09 18:57:11 2015 +0100 # Node ID 187801676c74025c36991603353e8f3a2bef746f # Parent da94f60010409c214ea9f69fa630bbddc0c52ff3 8142329: [JVMCI] pass Handle by value diff --git a/src/share/vm/jvmci/jvmciCodeInstaller.cpp b/src/share/vm/jvmci/jvmciCodeInstaller.cpp --- a/src/share/vm/jvmci/jvmciCodeInstaller.cpp +++ b/src/share/vm/jvmci/jvmciCodeInstaller.cpp @@ -475,7 +475,7 @@ _size = bytes; } -JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle& compiled_code, CodeMetadata& metadata, TRAPS) { +JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS) { CodeBuffer buffer("JVMCI Compiler CodeBuffer for Metadata"); jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); initialize_dependencies(JNIHandles::resolve(compiled_code_obj), NULL, CHECK_OK); @@ -508,7 +508,7 @@ } // constructor used to create a method -JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) { +JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS) { CodeBuffer buffer("JVMCI Compiler CodeBuffer"); jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); OopRecorder* recorder = new OopRecorder(&_arena, true); diff --git a/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/src/share/vm/jvmci/jvmciCodeInstaller.hpp --- a/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -177,8 +177,8 @@ CodeInstaller() : _arena(mtCompiler) {} - JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle& compiled_code, CodeMetadata& metadata, TRAPS); - JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS); + JVMCIEnv::CodeInstallResult gather_metadata(Handle target, Handle compiled_code, CodeMetadata& metadata, TRAPS); + JVMCIEnv::CodeInstallResult install(JVMCICompiler* compiler, Handle target, Handle compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log, TRAPS); static address runtime_call_target_address(oop runtime_call); static VMReg get_hotspot_reg(jint jvmciRegisterNumber, TRAPS); diff --git a/src/share/vm/jvmci/jvmciEnv.cpp b/src/share/vm/jvmci/jvmciEnv.cpp --- a/src/share/vm/jvmci/jvmciEnv.cpp +++ b/src/share/vm/jvmci/jvmciEnv.cpp @@ -82,8 +82,8 @@ } // ------------------------------------------------------------------ -KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle& accessing_klass, - constantPoolHandle& cpool, +KlassHandle JVMCIEnv::get_klass_by_name_impl(KlassHandle accessing_klass, + const constantPoolHandle& cpool, Symbol* sym, bool require_local) { JVMCI_EXCEPTION_CONTEXT; @@ -161,7 +161,7 @@ } // ------------------------------------------------------------------ -KlassHandle JVMCIEnv::get_klass_by_name(KlassHandle& accessing_klass, +KlassHandle JVMCIEnv::get_klass_by_name(KlassHandle accessing_klass, Symbol* klass_name, bool require_local) { ResourceMark rm; @@ -174,10 +174,10 @@ // ------------------------------------------------------------------ // 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) { + KlassHandle accessor) { JVMCI_EXCEPTION_CONTEXT; KlassHandle klass (THREAD, ConstantPool::klass_at_if_loaded(cpool, index)); Symbol* klass_name = NULL; @@ -215,10 +215,10 @@ // ------------------------------------------------------------------ // 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) { + KlassHandle accessor) { ResourceMark rm; KlassHandle result = get_klass_by_index_impl(cpool, index, is_accessible, accessor); return result; @@ -229,7 +229,7 @@ // // Implementation note: the results of field lookups are cached // in the accessor klass. -void JVMCIEnv::get_field_by_index_impl(instanceKlassHandle& klass, fieldDescriptor& field_desc, +void JVMCIEnv::get_field_by_index_impl(instanceKlassHandle klass, fieldDescriptor& field_desc, int index) { JVMCI_EXCEPTION_CONTEXT; @@ -270,7 +270,7 @@ // ------------------------------------------------------------------ // Get a field by index from a klass's constant pool. -void JVMCIEnv::get_field_by_index(instanceKlassHandle& accessor, fieldDescriptor& fd, int index) { +void JVMCIEnv::get_field_by_index(instanceKlassHandle accessor, fieldDescriptor& fd, int index) { ResourceMark rm; return get_field_by_index_impl(accessor, fd, index); } @@ -278,8 +278,8 @@ // ------------------------------------------------------------------ // Perform an appropriate method lookup based on accessor, holder, // name, signature, and bytecode. -methodHandle JVMCIEnv::lookup_method(instanceKlassHandle& h_accessor, - instanceKlassHandle& h_holder, +methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor, + instanceKlassHandle h_holder, Symbol* name, Symbol* sig, Bytecodes::Code bc) { @@ -312,9 +312,9 @@ // ------------------------------------------------------------------ -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) { + instanceKlassHandle accessor) { if (bc == Bytecodes::_invokedynamic) { ConstantPoolCacheEntry* cpce = cpool->invokedynamic_cp_cache_entry_at(index); bool is_resolved = !cpce->is_f1_null(); @@ -379,7 +379,7 @@ } // ------------------------------------------------------------------ -instanceKlassHandle JVMCIEnv::get_instance_klass_for_declared_method_holder(KlassHandle& method_holder) { +instanceKlassHandle JVMCIEnv::get_instance_klass_for_declared_method_holder(KlassHandle method_holder) { // For the case of .clone(), the method holder can be an ArrayKlass* // instead of an InstanceKlass*. For that case simply pretend that the // declared holder is Object.clone since that's where the call will bottom out. @@ -395,9 +395,9 @@ // ------------------------------------------------------------------ -methodHandle JVMCIEnv::get_method_by_index(constantPoolHandle& cpool, +methodHandle JVMCIEnv::get_method_by_index(const constantPoolHandle& cpool, int index, Bytecodes::Code bc, - instanceKlassHandle& accessor) { + instanceKlassHandle accessor) { ResourceMark rm; return get_method_by_index_impl(cpool, index, bc, accessor); } @@ -452,7 +452,7 @@ // ------------------------------------------------------------------ JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( - methodHandle& method, + const methodHandle& method, nmethod*& nm, int entry_bci, CodeOffsets* offsets, diff --git a/src/share/vm/jvmci/jvmciEnv.hpp b/src/share/vm/jvmci/jvmciEnv.hpp --- a/src/share/vm/jvmci/jvmciEnv.hpp +++ b/src/share/vm/jvmci/jvmciEnv.hpp @@ -78,20 +78,20 @@ // The CI treats a klass as loaded if it is consistently defined in // another loader, even if it hasn't yet been loaded in all loaders // that could potentially see it via delegation. - static KlassHandle get_klass_by_name(KlassHandle& accessing_klass, + static KlassHandle get_klass_by_name(KlassHandle accessing_klass, Symbol* klass_name, 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, + 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); + instanceKlassHandle loading_klass); JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter); @@ -105,24 +105,24 @@ bool _jvmti_can_post_on_exceptions; // Implementation methods for loading and constant pool access. - static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass, - constantPoolHandle& cpool, + static KlassHandle get_klass_by_name_impl(KlassHandle accessing_klass, + 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, + 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); + instanceKlassHandle loading_klass); // Helper methods static bool check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass); - static methodHandle lookup_method(instanceKlassHandle& accessor, - instanceKlassHandle& holder, + static methodHandle lookup_method(instanceKlassHandle accessor, + instanceKlassHandle holder, Symbol* name, Symbol* sig, Bytecodes::Code bc); @@ -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, @@ -166,7 +166,7 @@ // InstanceKlass*. This is needed since the holder of a method in // the bytecodes could be an array type. Basically this converts // array types into java/lang/Object and other types stay as they are. - static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle& klass); + static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle klass); }; #endif // SHARE_VM_JVMCI_JVMCIENV_HPP diff --git a/src/share/vm/jvmci/jvmciJavaClasses.hpp b/src/share/vm/jvmci/jvmciJavaClasses.hpp --- a/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -315,10 +315,10 @@ #define FIELD(name, type, accessor, cast) \ static int _##name##_offset; \ static type name(oop obj) { check(obj, #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ - static type name(Handle& obj) { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ + static type name(Handle obj) { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ static type name(jobject obj) { check(JNIHandles::resolve(obj), #name, _##name##_offset); return cast JNIHandles::resolve(obj)->accessor(_##name##_offset); } \ static void set_##name(oop obj, type x) { check(obj, #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ - static void set_##name(Handle& obj, type x) { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ + static void set_##name(Handle obj, type x) { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj), #name, _##name##_offset); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); } #define EMPTY_CAST