Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/templateInterpreter_sparc.cpp @ 1503:c640000b7cc1
6829193: JSR 292 needs to support SPARC
Summary: There are unimplemented portions of the hotspot code for method handles and invokedynamic specific to SPARC.
Reviewed-by: kvn, never, jrose
author | twisti |
---|---|
date | Thu, 29 Apr 2010 06:30:25 -0700 |
parents | 3cf667df43ef |
children | 2338d41fbd81 |
comparison
equal
deleted
inserted
replaced
1399:90acda19b80f | 1503:c640000b7cc1 |
---|---|
149 return entry; | 149 return entry; |
150 } | 150 } |
151 | 151 |
152 | 152 |
153 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { | 153 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { |
154 TosState incoming_state = state; | |
155 | |
156 Label cont; | |
154 address compiled_entry = __ pc(); | 157 address compiled_entry = __ pc(); |
155 Label cont; | |
156 | 158 |
157 address entry = __ pc(); | 159 address entry = __ pc(); |
158 #if !defined(_LP64) && defined(COMPILER2) | 160 #if !defined(_LP64) && defined(COMPILER2) |
159 // All return values are where we want them, except for Longs. C2 returns | 161 // All return values are where we want them, except for Longs. C2 returns |
160 // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. | 162 // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. |
163 // stupid shuffing. | 165 // stupid shuffing. |
164 // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to | 166 // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to |
165 // do this here. Unfortunately if we did a rethrow we'd see an machepilog node | 167 // do this here. Unfortunately if we did a rethrow we'd see an machepilog node |
166 // first which would move g1 -> O0/O1 and destroy the exception we were throwing. | 168 // first which would move g1 -> O0/O1 and destroy the exception we were throwing. |
167 | 169 |
168 if( state == ltos ) { | 170 if (incoming_state == ltos) { |
169 __ srl (G1, 0,O1); | 171 __ srl (G1, 0, O1); |
170 __ srlx(G1,32,O0); | 172 __ srlx(G1, 32, O0); |
171 } | 173 } |
172 #endif /* !_LP64 && COMPILER2 */ | 174 #endif // !_LP64 && COMPILER2 |
173 | |
174 | 175 |
175 __ bind(cont); | 176 __ bind(cont); |
176 | 177 |
177 // The callee returns with the stack possibly adjusted by adapter transition | 178 // The callee returns with the stack possibly adjusted by adapter transition |
178 // We remove that possible adjustment here. | 179 // We remove that possible adjustment here. |
180 // in the O0/O1 or float registers. Before continuing, the arguments must be | 181 // in the O0/O1 or float registers. Before continuing, the arguments must be |
181 // popped from the java expression stack; i.e., Lesp must be adjusted. | 182 // popped from the java expression stack; i.e., Lesp must be adjusted. |
182 | 183 |
183 __ mov(Llast_SP, SP); // Remove any adapter added stack space. | 184 __ mov(Llast_SP, SP); // Remove any adapter added stack space. |
184 | 185 |
185 | 186 Label L_got_cache, L_giant_index; |
186 const Register cache = G3_scratch; | 187 const Register cache = G3_scratch; |
187 const Register size = G1_scratch; | 188 const Register size = G1_scratch; |
189 if (EnableInvokeDynamic) { | |
190 __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. | |
191 __ cmp(G1_scratch, Bytecodes::_invokedynamic); | |
192 __ br(Assembler::equal, false, Assembler::pn, L_giant_index); | |
193 __ delayed()->nop(); | |
194 } | |
188 __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); | 195 __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); |
196 __ bind(L_got_cache); | |
189 __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() + | 197 __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() + |
190 ConstantPoolCacheEntry::flags_offset(), size); | 198 ConstantPoolCacheEntry::flags_offset(), size); |
191 __ and3(size, 0xFF, size); // argument size in words | 199 __ and3(size, 0xFF, size); // argument size in words |
192 __ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes | 200 __ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes |
193 __ add(Lesp, size, Lesp); // pop arguments | 201 __ add(Lesp, size, Lesp); // pop arguments |
194 __ dispatch_next(state, step); | 202 __ dispatch_next(state, step); |
203 | |
204 // out of the main line of code... | |
205 if (EnableInvokeDynamic) { | |
206 __ bind(L_giant_index); | |
207 __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, true); | |
208 __ ba(false, L_got_cache); | |
209 __ delayed()->nop(); | |
210 } | |
195 | 211 |
196 return entry; | 212 return entry; |
197 } | 213 } |
198 | 214 |
199 | 215 |