Mercurial > hg > truffle
comparison src/cpu/sparc/vm/sparc.ad @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | e10e43e58e92 |
children | 46c544b8fbfc |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
1654 assert(ra_ == ra_->C->regalloc(), "sanity"); | 1654 assert(ra_ == ra_->C->regalloc(), "sanity"); |
1655 return ra_->C->scratch_emit_size(this); | 1655 return ra_->C->scratch_emit_size(this); |
1656 } | 1656 } |
1657 | 1657 |
1658 //============================================================================= | 1658 //============================================================================= |
1659 | |
1660 // emit call stub, compiled java to interpretor | |
1661 void emit_java_to_interp(CodeBuffer &cbuf ) { | |
1662 | |
1663 // Stub is fixed up when the corresponding call is converted from calling | |
1664 // compiled code to calling interpreted code. | |
1665 // set (empty), G5 | |
1666 // jmp -1 | |
1667 | |
1668 address mark = cbuf.insts_mark(); // get mark within main instrs section | |
1669 | |
1670 MacroAssembler _masm(&cbuf); | |
1671 | |
1672 address base = | |
1673 __ start_a_stub(Compile::MAX_stubs_size); | |
1674 if (base == NULL) return; // CodeBuffer::expand failed | |
1675 | |
1676 // static stub relocation stores the instruction address of the call | |
1677 __ relocate(static_stub_Relocation::spec(mark)); | |
1678 | |
1679 __ set_metadata(NULL, reg_to_register_object(Matcher::inline_cache_reg_encode())); | |
1680 | |
1681 __ set_inst_mark(); | |
1682 AddressLiteral addrlit(-1); | |
1683 __ JUMP(addrlit, G3, 0); | |
1684 | |
1685 __ delayed()->nop(); | |
1686 | |
1687 // Update current stubs pointer and restore code_end. | |
1688 __ end_a_stub(); | |
1689 } | |
1690 | |
1691 // size of call stub, compiled java to interpretor | |
1692 uint size_java_to_interp() { | |
1693 // This doesn't need to be accurate but it must be larger or equal to | |
1694 // the real size of the stub. | |
1695 return (NativeMovConstReg::instruction_size + // sethi/setlo; | |
1696 NativeJump::instruction_size + // sethi; jmp; nop | |
1697 (TraceJumps ? 20 * BytesPerInstWord : 0) ); | |
1698 } | |
1699 // relocation entries for call stub, compiled java to interpretor | |
1700 uint reloc_java_to_interp() { | |
1701 return 10; // 4 in emit_java_to_interp + 1 in Java_Static_Call | |
1702 } | |
1703 | |
1704 | |
1705 //============================================================================= | |
1706 #ifndef PRODUCT | 1659 #ifndef PRODUCT |
1707 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { | 1660 void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { |
1708 st->print_cr("\nUEP:"); | 1661 st->print_cr("\nUEP:"); |
1709 #ifdef _LP64 | 1662 #ifdef _LP64 |
1710 if (UseCompressedKlassPointers) { | 1663 if (UseCompressedKlassPointers) { |
2574 %} | 2527 %} |
2575 | 2528 |
2576 enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL | 2529 enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL |
2577 // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine | 2530 // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine |
2578 // who we intended to call. | 2531 // who we intended to call. |
2579 if ( !_method ) { | 2532 if (!_method) { |
2580 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type); | 2533 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type); |
2581 } else if (_optimized_virtual) { | 2534 } else if (_optimized_virtual) { |
2582 emit_call_reloc(cbuf, $meth$$method, relocInfo::opt_virtual_call_type); | 2535 emit_call_reloc(cbuf, $meth$$method, relocInfo::opt_virtual_call_type); |
2583 } else { | 2536 } else { |
2584 emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type); | 2537 emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type); |
2585 } | 2538 } |
2586 if( _method ) { // Emit stub for static call | 2539 if (_method) { // Emit stub for static call. |
2587 emit_java_to_interp(cbuf); | 2540 CompiledStaticCall::emit_to_interp_stub(cbuf); |
2588 } | 2541 } |
2589 %} | 2542 %} |
2590 | 2543 |
2591 enc_class Java_Dynamic_Call (method meth) %{ // JAVA DYNAMIC CALL | 2544 enc_class Java_Dynamic_Call (method meth) %{ // JAVA DYNAMIC CALL |
2592 MacroAssembler _masm(&cbuf); | 2545 MacroAssembler _masm(&cbuf); |