1.1 --- a/src/cpu/ppc/vm/methodHandles_ppc.cpp Thu Feb 20 14:44:33 2014 +0100 1.2 +++ b/src/cpu/ppc/vm/methodHandles_ppc.cpp Thu Mar 20 11:03:06 2014 +0100 1.3 @@ -1,6 +1,6 @@ 1.4 /* 1.5 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 - * Copyright 2012, 2013 SAP AG. All rights reserved. 1.7 + * Copyright 2012, 2014 SAP AG. All rights reserved. 1.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 * 1.10 * This code is free software; you can redistribute it and/or modify it 1.11 @@ -119,6 +119,7 @@ 1.12 1.13 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, 1.14 bool for_compiler_entry) { 1.15 + Label L_no_such_method; 1.16 assert(method == R19_method, "interpreter calling convention"); 1.17 assert_different_registers(method, target, temp); 1.18 1.19 @@ -131,17 +132,31 @@ 1.20 __ lwz(temp, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread); 1.21 __ cmplwi(CCR0, temp, 0); 1.22 __ beq(CCR0, run_compiled_code); 1.23 + // Null method test is replicated below in compiled case, 1.24 + // it might be able to address across the verify_thread() 1.25 + __ cmplwi(CCR0, R19_method, 0); 1.26 + __ beq(CCR0, L_no_such_method); 1.27 __ ld(target, in_bytes(Method::interpreter_entry_offset()), R19_method); 1.28 __ mtctr(target); 1.29 __ bctr(); 1.30 __ BIND(run_compiled_code); 1.31 } 1.32 1.33 + // Compiled case, either static or fall-through from runtime conditional 1.34 + __ cmplwi(CCR0, R19_method, 0); 1.35 + __ beq(CCR0, L_no_such_method); 1.36 + 1.37 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : 1.38 Method::from_interpreted_offset(); 1.39 __ ld(target, in_bytes(entry_offset), R19_method); 1.40 __ mtctr(target); 1.41 __ bctr(); 1.42 + 1.43 + __ bind(L_no_such_method); 1.44 + assert(StubRoutines::throw_AbstractMethodError_entry() != NULL, "not yet generated!"); 1.45 + __ load_const_optimized(target, StubRoutines::throw_AbstractMethodError_entry()); 1.46 + __ mtctr(target); 1.47 + __ bctr(); 1.48 } 1.49 1.50