src/hotspot/cpu/sparc/templateTable_sparc.cpp
changeset 47881 0ce0ac68ace7
parent 47580 96392e113a0a
child 48483 afb2284bb487
child 48557 2e867226b914
child 55934 912c55e702d6
equal deleted inserted replaced
47824:cf127be65014 47881:0ce0ac68ace7
  1497     // Bump Lbcp to target of JSR
  1497     // Bump Lbcp to target of JSR
  1498     __ add(Lbcp, O1_disp, Lbcp);
  1498     __ add(Lbcp, O1_disp, Lbcp);
  1499     // Push returnAddress for "ret" on stack
  1499     // Push returnAddress for "ret" on stack
  1500     __ push_ptr(Otos_i);
  1500     __ push_ptr(Otos_i);
  1501     // And away we go!
  1501     // And away we go!
  1502     __ dispatch_next(vtos);
  1502     __ dispatch_next(vtos, 0, true);
  1503     return;
  1503     return;
  1504   }
  1504   }
  1505 
  1505 
  1506   // Normal (non-jsr) branch handling
  1506   // Normal (non-jsr) branch handling
  1507 
  1507 
  1605     __ add( O1_disp, Lbcp, Lbcp );// add to bc addr
  1605     __ add( O1_disp, Lbcp, Lbcp );// add to bc addr
  1606 
  1606 
  1607   // continue with bytecode @ target
  1607   // continue with bytecode @ target
  1608   // %%%%% Like Intel, could speed things up by moving bytecode fetch to code above,
  1608   // %%%%% Like Intel, could speed things up by moving bytecode fetch to code above,
  1609   // %%%%% and changing dispatch_next to dispatch_only
  1609   // %%%%% and changing dispatch_next to dispatch_only
  1610   __ dispatch_next(vtos);
  1610   __ dispatch_next(vtos, 0, true);
  1611 }
  1611 }
  1612 
  1612 
  1613 
  1613 
  1614 // Note Condition in argument is TemplateTable::Condition
  1614 // Note Condition in argument is TemplateTable::Condition
  1615 // arg scope is within class scope
  1615 // arg scope is within class scope
  1674   __ profile_ret(vtos, Otos_i, G4_scratch);
  1674   __ profile_ret(vtos, Otos_i, G4_scratch);
  1675 
  1675 
  1676   __ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
  1676   __ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
  1677   __ add(G3_scratch, Otos_i, G3_scratch);
  1677   __ add(G3_scratch, Otos_i, G3_scratch);
  1678   __ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
  1678   __ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
  1679   __ dispatch_next(vtos);
  1679   __ dispatch_next(vtos, 0, true);
  1680 }
  1680 }
  1681 
  1681 
  1682 
  1682 
  1683 void TemplateTable::wide_ret() {
  1683 void TemplateTable::wide_ret() {
  1684   transition(vtos, vtos);
  1684   transition(vtos, vtos);
  1689   __ profile_ret(vtos, Otos_i, G4_scratch);
  1689   __ profile_ret(vtos, Otos_i, G4_scratch);
  1690 
  1690 
  1691   __ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
  1691   __ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
  1692   __ add(G3_scratch, Otos_i, G3_scratch);
  1692   __ add(G3_scratch, Otos_i, G3_scratch);
  1693   __ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
  1693   __ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
  1694   __ dispatch_next(vtos);
  1694   __ dispatch_next(vtos, 0, true);
  1695 }
  1695 }
  1696 
  1696 
  1697 
  1697 
  1698 void TemplateTable::tableswitch() {
  1698 void TemplateTable::tableswitch() {
  1699   transition(itos, vtos);
  1699   transition(itos, vtos);
  1725   __ profile_switch_default(O3);
  1725   __ profile_switch_default(O3);
  1726   __ ld(O1, 0, O2); // get default offset
  1726   __ ld(O1, 0, O2); // get default offset
  1727   // continue execution
  1727   // continue execution
  1728   __ bind(continue_execution);
  1728   __ bind(continue_execution);
  1729   __ add(Lbcp, O2, Lbcp);
  1729   __ add(Lbcp, O2, Lbcp);
  1730   __ dispatch_next(vtos);
  1730   __ dispatch_next(vtos, 0, true);
  1731 }
  1731 }
  1732 
  1732 
  1733 
  1733 
  1734 void TemplateTable::lookupswitch() {
  1734 void TemplateTable::lookupswitch() {
  1735   transition(itos, itos);
  1735   transition(itos, itos);
  1777     __ profile_switch_case(O3, O1, O2, G3_scratch);
  1777     __ profile_switch_case(O3, O1, O2, G3_scratch);
  1778 
  1778 
  1779     __ bind(continue_execution);
  1779     __ bind(continue_execution);
  1780   }
  1780   }
  1781   __ add(Lbcp, O4, Lbcp);
  1781   __ add(Lbcp, O4, Lbcp);
  1782   __ dispatch_next(vtos);
  1782   __ dispatch_next(vtos, 0, true);
  1783 }
  1783 }
  1784 
  1784 
  1785 
  1785 
  1786 void TemplateTable::fast_binaryswitch() {
  1786 void TemplateTable::fast_binaryswitch() {
  1787   transition(itos, vtos);
  1787   transition(itos, vtos);
  1886   __ bind(default_case); // fall through (if not profiling)
  1886   __ bind(default_case); // fall through (if not profiling)
  1887   __ profile_switch_default(Ri);
  1887   __ profile_switch_default(Ri);
  1888 
  1888 
  1889   __ bind(continue_execution);
  1889   __ bind(continue_execution);
  1890   __ add( Lbcp, Rj, Lbcp );
  1890   __ add( Lbcp, Rj, Lbcp );
  1891   __ dispatch_next( vtos );
  1891   __ dispatch_next(vtos, 0, true);
  1892 }
  1892 }
  1893 
  1893 
  1894 
  1894 
  1895 void TemplateTable::_return(TosState state) {
  1895 void TemplateTable::_return(TosState state) {
  1896   transition(state, state);
  1896   transition(state, state);
  1910 
  1910 
  1911     // Call out to do finalizer registration
  1911     // Call out to do finalizer registration
  1912     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), Otos_i);
  1912     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), Otos_i);
  1913 
  1913 
  1914     __ bind(skip_register_finalizer);
  1914     __ bind(skip_register_finalizer);
       
  1915   }
       
  1916 
       
  1917   if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
       
  1918     Label no_safepoint;
       
  1919     __ ldx(Address(G2_thread, Thread::polling_page_offset()), G3_scratch, 0);
       
  1920     __ btst(SafepointMechanism::poll_bit(), G3_scratch);
       
  1921     __ br(Assembler::zero, false, Assembler::pt, no_safepoint);
       
  1922     __ delayed()->nop();
       
  1923     __ push(state);
       
  1924     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint));
       
  1925     __ pop(state);
       
  1926     __ bind(no_safepoint);
  1915   }
  1927   }
  1916 
  1928 
  1917   // Narrow result if state is itos but result type is smaller.
  1929   // Narrow result if state is itos but result type is smaller.
  1918   // Need to narrow in the return bytecode rather than in generate_return_entry
  1930   // Need to narrow in the return bytecode rather than in generate_return_entry
  1919   // since compiled code callers expect the result to already be narrowed.
  1931   // since compiled code callers expect the result to already be narrowed.