--- old/src/cpu/sparc/vm/sparc.ad 2014-03-24 11:06:15.630553000 +0100 +++ new/src/cpu/sparc/vm/sparc.ad 2014-03-24 11:06:15.490527000 +0100 @@ -457,6 +457,13 @@ // This is a block of C++ code which provides values, functions, and // definitions necessary in the rest of the architecture description source_hpp %{ +// Header information of the source block. +// Method declarations/definitions which are used outside +// the ad-scope can conveniently be defined here. +// +// To keep related declarations/definitions/uses close together, +// we switch between source %{ }% and source_hpp %{ }% freely as needed. + // Must be visible to the DFA in dfa_sparc.cpp extern bool can_branch_register( Node *bol, Node *cmp ); @@ -1659,6 +1666,33 @@ } //============================================================================= +%} // interrupt source + +source_hpp %{ // Header information of the source block. + +//-------------------------------------------------------------- +//---< Used for optimization in Compile::Shorten_branches >--- +//-------------------------------------------------------------- + +class CallStubImpl { + + public: + // Size of call trampoline stub. + static uint size_call_trampoline() { + return 0; // no call trampolines on this platform + } + + // number of relocations needed by a call trampoline stub + static uint reloc_call_trampoline() { + return 0; // no call trampolines on this platform + } +}; + +%} // end source_hpp + +source %{ + +//============================================================================= #ifndef PRODUCT void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { st->print_cr("\nUEP:"); @@ -1709,23 +1743,39 @@ //============================================================================= +%} // interrupt source + +source_hpp %{ // Header information of the source block. -uint size_exception_handler() { - if (TraceJumps) { - return (400); // just a guess +class HandlerImpl { + + public: + + static int emit_exception_handler(CodeBuffer &cbuf); + static int emit_deopt_handler(CodeBuffer& cbuf); + + static uint size_exception_handler() { + if (TraceJumps) { + return (400); // just a guess + } + return ( NativeJump::instruction_size ); // sethi;jmp;nop } - return ( NativeJump::instruction_size ); // sethi;jmp;nop -} -uint size_deopt_handler() { - if (TraceJumps) { - return (400); // just a guess + static uint size_deopt_handler() { + if (TraceJumps) { + return (400); // just a guess + } + return ( 4+ NativeJump::instruction_size ); // save;sethi;jmp;restore } - return ( 4+ NativeJump::instruction_size ); // save;sethi;jmp;restore -} + +}; + +%} // end source_hpp + +source %{ // Emit exception handler code. -int emit_exception_handler(CodeBuffer& cbuf) { +int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf) { Register temp_reg = G3; AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point()); MacroAssembler _masm(&cbuf); @@ -1746,7 +1796,7 @@ return offset; } -int emit_deopt_handler(CodeBuffer& cbuf) { +int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) { // Can't use any of the current frame's registers as we may have deopted // at a poll and everything (including G3) can be live. Register temp_reg = L0; @@ -1769,6 +1819,9 @@ } + +//============================================================================= + // Given a register encoding, produce a Integer Register object static Register reg_to_register_object(int register_encoding) { assert(L5->encoding() == R_L5_enc && G1->encoding() == R_G1_enc, "right coding");