comparison src/cpu/ppc/vm/methodHandles_ppc.cpp @ 17807:71a71b0bc844

8037915: PPC64/AIX: Several smaller fixes Reviewed-by: kvn
author goetz
date Thu, 20 Mar 2014 11:03:06 +0100
parents 31e80afe3fed
children 327e7269f90d
comparison
equal deleted inserted replaced
17806:9200402b42d5 17807:71a71b0bc844
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2013 SAP AG. All rights reserved. 3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * 5 *
6 * This code is free software; you can redistribute it and/or modify it 6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as 7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
117 117
118 #endif // ASSERT 118 #endif // ASSERT
119 119
120 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, 120 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp,
121 bool for_compiler_entry) { 121 bool for_compiler_entry) {
122 Label L_no_such_method;
122 assert(method == R19_method, "interpreter calling convention"); 123 assert(method == R19_method, "interpreter calling convention");
123 assert_different_registers(method, target, temp); 124 assert_different_registers(method, target, temp);
124 125
125 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { 126 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
126 Label run_compiled_code; 127 Label run_compiled_code;
129 // interp_only_mode if these events CAN be enabled. 130 // interp_only_mode if these events CAN be enabled.
130 __ verify_thread(); 131 __ verify_thread();
131 __ lwz(temp, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread); 132 __ lwz(temp, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
132 __ cmplwi(CCR0, temp, 0); 133 __ cmplwi(CCR0, temp, 0);
133 __ beq(CCR0, run_compiled_code); 134 __ beq(CCR0, run_compiled_code);
135 // Null method test is replicated below in compiled case,
136 // it might be able to address across the verify_thread()
137 __ cmplwi(CCR0, R19_method, 0);
138 __ beq(CCR0, L_no_such_method);
134 __ ld(target, in_bytes(Method::interpreter_entry_offset()), R19_method); 139 __ ld(target, in_bytes(Method::interpreter_entry_offset()), R19_method);
135 __ mtctr(target); 140 __ mtctr(target);
136 __ bctr(); 141 __ bctr();
137 __ BIND(run_compiled_code); 142 __ BIND(run_compiled_code);
138 } 143 }
139 144
145 // Compiled case, either static or fall-through from runtime conditional
146 __ cmplwi(CCR0, R19_method, 0);
147 __ beq(CCR0, L_no_such_method);
148
140 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : 149 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
141 Method::from_interpreted_offset(); 150 Method::from_interpreted_offset();
142 __ ld(target, in_bytes(entry_offset), R19_method); 151 __ ld(target, in_bytes(entry_offset), R19_method);
152 __ mtctr(target);
153 __ bctr();
154
155 __ bind(L_no_such_method);
156 assert(StubRoutines::throw_AbstractMethodError_entry() != NULL, "not yet generated!");
157 __ load_const_optimized(target, StubRoutines::throw_AbstractMethodError_entry());
143 __ mtctr(target); 158 __ mtctr(target);
144 __ bctr(); 159 __ bctr();
145 } 160 }
146 161
147 162