1.1 --- a/src/cpu/sparc/vm/methodHandles_sparc.cpp Mon Sep 30 15:42:39 2013 -0700 1.2 +++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp Fri Sep 27 13:36:25 2013 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -121,6 +121,7 @@ 1.11 1.12 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, 1.13 bool for_compiler_entry) { 1.14 + Label L_no_such_method; 1.15 assert(method == G5_method, "interpreter calling convention"); 1.16 assert_different_registers(method, target, temp); 1.17 1.18 @@ -133,6 +134,9 @@ 1.19 const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset()); 1.20 __ ld(interp_only, temp); 1.21 __ cmp_and_br_short(temp, 0, Assembler::zero, Assembler::pt, run_compiled_code); 1.22 + // Null method test is replicated below in compiled case, 1.23 + // it might be able to address across the verify_thread() 1.24 + __ br_null_short(G5_method, Assembler::pn, L_no_such_method); 1.25 __ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), target); 1.26 __ jmp(target, 0); 1.27 __ delayed()->nop(); 1.28 @@ -141,11 +145,19 @@ 1.29 // it doesn't matter, since this is interpreter code. 1.30 } 1.31 1.32 + // Compiled case, either static or fall-through from runtime conditional 1.33 + __ br_null_short(G5_method, Assembler::pn, L_no_such_method); 1.34 + 1.35 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : 1.36 Method::from_interpreted_offset(); 1.37 __ ld_ptr(G5_method, in_bytes(entry_offset), target); 1.38 __ jmp(target, 0); 1.39 __ delayed()->nop(); 1.40 + 1.41 + __ bind(L_no_such_method); 1.42 + AddressLiteral ame(StubRoutines::throw_AbstractMethodError_entry()); 1.43 + __ jump_to(ame, temp); 1.44 + __ delayed()->nop(); 1.45 } 1.46 1.47 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,