# HG changeset patch # User twisti # Date 1320309806 25200 # Node ID c25dd872c62fdf386ccb5520c169378b2a816cae # Parent c68bfbbbd60bd902cbbfecf6c3d1c1a36f0d6f4b 7106774: JSR 292: nightly test inlineMHTarget fails with wrong result Reviewed-by: kvn diff -r c68bfbbbd60b -r c25dd872c62f hotspot/src/share/vm/interpreter/bytecode.hpp --- a/hotspot/src/share/vm/interpreter/bytecode.hpp Mon Oct 31 15:52:11 2011 -0700 +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp Thu Nov 03 01:43:26 2011 -0700 @@ -234,6 +234,13 @@ is_invokespecial() || is_invokedynamic(); } + bool is_method_handle_invoke() const { + return (is_invokedynamic() || + (is_invokevirtual() && + method()->constants()->klass_ref_at_noresolve(index()) == vmSymbols::java_lang_invoke_MethodHandle() && + methodOopDesc::is_method_handle_invoke_name(name()))); + } + // Helper to skip verification. Used is_valid() to check if the result is really an invoke inline friend Bytecode_invoke Bytecode_invoke_check(methodHandle method, int bci); }; diff -r c68bfbbbd60b -r c25dd872c62f hotspot/src/share/vm/runtime/deoptimization.cpp --- a/hotspot/src/share/vm/runtime/deoptimization.cpp Mon Oct 31 15:52:11 2011 -0700 +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp Thu Nov 03 01:43:26 2011 -0700 @@ -388,12 +388,8 @@ bool caller_was_method_handle = false; if (deopt_sender.is_interpreted_frame()) { methodHandle method = deopt_sender.interpreter_frame_method(); - Bytecode_invoke cur = Bytecode_invoke_check(method, - deopt_sender.interpreter_frame_bci()); - if (cur.code() == Bytecodes::_invokedynamic || - (cur.code() == Bytecodes::_invokevirtual && - method->constants()->klass_ref_at_noresolve(cur.index()) == vmSymbols::java_lang_invoke_MethodHandle() && - methodOopDesc::is_method_handle_invoke_name(cur.name()))) { + Bytecode_invoke cur = Bytecode_invoke_check(method, deopt_sender.interpreter_frame_bci()); + if (cur.is_method_handle_invoke()) { // Method handle invokes may involve fairly arbitrary chains of // calls so it's impossible to know how much actual space the // caller has for locals.