6829193: JSR 292 needs to support SPARC

There are unimplemented portions of the hotspot code for method handles and invokedynamic specific to SPARC.

Reviewed-by: kvn, never, jrose
This commit is contained in:
Christian Thalinger 2010-04-29 06:30:25 -07:00
parent 78e6939c37
commit 6d2a896bcd
14 changed files with 1210 additions and 126 deletions

View file

@ -151,8 +151,10 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
address compiled_entry = __ pc();
TosState incoming_state = state;
Label cont;
address compiled_entry = __ pc();
address entry = __ pc();
#if !defined(_LP64) && defined(COMPILER2)
@ -165,12 +167,11 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
// 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 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ 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 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ 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;
}