Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/methodHandles_sparc.cpp @ 12355:cefad50507d8
Merge with hs25-b53
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 10:38:03 +0200 |
parents | 989155e2d07a dc261f466b6d |
children |
comparison
equal
deleted
inserted
replaced
12058:ccb4f2af2319 | 12355:cefad50507d8 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
119 | 119 |
120 #endif // ASSERT | 120 #endif // ASSERT |
121 | 121 |
122 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, | 122 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, |
123 bool for_compiler_entry) { | 123 bool for_compiler_entry) { |
124 Label L_no_such_method; | |
124 assert(method == G5_method, "interpreter calling convention"); | 125 assert(method == G5_method, "interpreter calling convention"); |
125 assert_different_registers(method, target, temp); | 126 assert_different_registers(method, target, temp); |
126 | 127 |
127 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { | 128 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { |
128 Label run_compiled_code; | 129 Label run_compiled_code; |
131 // interp_only_mode if these events CAN be enabled. | 132 // interp_only_mode if these events CAN be enabled. |
132 __ verify_thread(); | 133 __ verify_thread(); |
133 const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset()); | 134 const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset()); |
134 __ ld(interp_only, temp); | 135 __ ld(interp_only, temp); |
135 __ cmp_and_br_short(temp, 0, Assembler::zero, Assembler::pt, run_compiled_code); | 136 __ cmp_and_br_short(temp, 0, Assembler::zero, Assembler::pt, run_compiled_code); |
137 // Null method test is replicated below in compiled case, | |
138 // it might be able to address across the verify_thread() | |
139 __ br_null_short(G5_method, Assembler::pn, L_no_such_method); | |
136 __ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), target); | 140 __ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), target); |
137 __ jmp(target, 0); | 141 __ jmp(target, 0); |
138 __ delayed()->nop(); | 142 __ delayed()->nop(); |
139 __ BIND(run_compiled_code); | 143 __ BIND(run_compiled_code); |
140 // Note: we could fill some delay slots here, but | 144 // Note: we could fill some delay slots here, but |
141 // it doesn't matter, since this is interpreter code. | 145 // it doesn't matter, since this is interpreter code. |
142 } | 146 } |
143 | 147 |
148 // Compiled case, either static or fall-through from runtime conditional | |
149 __ br_null_short(G5_method, Assembler::pn, L_no_such_method); | |
150 | |
144 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : | 151 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : |
145 Method::from_interpreted_offset(); | 152 Method::from_interpreted_offset(); |
146 __ ld_ptr(G5_method, in_bytes(entry_offset), target); | 153 __ ld_ptr(G5_method, in_bytes(entry_offset), target); |
147 __ jmp(target, 0); | 154 __ jmp(target, 0); |
155 __ delayed()->nop(); | |
156 | |
157 __ bind(L_no_such_method); | |
158 AddressLiteral ame(StubRoutines::throw_AbstractMethodError_entry()); | |
159 __ jump_to(ame, temp); | |
148 __ delayed()->nop(); | 160 __ delayed()->nop(); |
149 } | 161 } |
150 | 162 |
151 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, | 163 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, |
152 Register recv, Register method_temp, | 164 Register recv, Register method_temp, |