Mercurial > hg > graal-compiler
diff 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 |
line wrap: on
line diff
--- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Apr 29 00:03:40 2010 -0700 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Apr 29 06:30:25 2010 -0700 @@ -151,8 +151,10 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { + TosState incoming_state = state; + + Label cont; address compiled_entry = __ pc(); - Label cont; address entry = __ pc(); #if !defined(_LP64) && defined(COMPILER2) @@ -165,12 +167,11 @@ // do this here. Unfortunately if we did a rethrow we'd see an machepilog node // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - if( state == ltos ) { - __ srl (G1, 0,O1); - __ srlx(G1,32,O0); + if (incoming_state == ltos) { + __ srl (G1, 0, O1); + __ srlx(G1, 32, O0); } -#endif /* !_LP64 && COMPILER2 */ - +#endif // !_LP64 && COMPILER2 __ bind(cont); @@ -182,10 +183,17 @@ __ mov(Llast_SP, SP); // Remove any adapter added stack space. - + Label L_got_cache, L_giant_index; const Register cache = G3_scratch; const Register size = G1_scratch; + if (EnableInvokeDynamic) { + __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. + __ cmp(G1_scratch, Bytecodes::_invokedynamic); + __ br(Assembler::equal, false, Assembler::pn, L_giant_index); + __ delayed()->nop(); + } __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); + __ bind(L_got_cache); __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::flags_offset(), size); __ and3(size, 0xFF, size); // argument size in words @@ -193,6 +201,14 @@ __ add(Lesp, size, Lesp); // pop arguments __ dispatch_next(state, step); + // out of the main line of code... + if (EnableInvokeDynamic) { + __ bind(L_giant_index); + __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, true); + __ ba(false, L_got_cache); + __ delayed()->nop(); + } + return entry; }