As suggested i have made the changes in CallingConvention to flip the MIR_CALL instruction to a IA32_JMP only if its a TAIL CALL
But the BranchOperand Target value of the IA_32 JMP should be the address to the compiled method ID which is not correct please help
Actually We have the JTOC offset containing the address to the Method being called On setting that value to the BranchOperand it fails

On Thu, Jan 22, 2009 at 10:05 AM, David P Grove <> wrote:

Ian Rogers <> wrote on 01/21/2009 07:50:43 PM:

> Nivedita Puranik wrote:
> > Hello,
> >  I need to jump to a function _foo i.e JMP _foo  instead of Call _foo
> > I see JMP is always to a label within the same block
> > But i need to jump to a different function. Please Help I am struck

> Nivedita -- I told you that I believe you will have to create a new kind
> of instruction at the HIR level: a "jump to method" rather than a
> "call method". But perhaps Dave Grove or someone can offer more detailed
> guidance.
> (She's trying to do a more general form of tail call elimination.)
> Best wishes -- Eliot Moss

> Hi Nivedita & Eliot,
> I'd suggest that you probably need to create a new form of MIR_Call
> operation that during calling convention expansion [1] can be turned
> into a jmp (just as a syscall will get flipped into a call on the
> way to the assembler driver you can flip your pseudo instruction
> into a jmp). I think you want to reconsider using jmp as apposed to
> call, Intel processors have a return stack buffer (RSB) [2] that is
> used to predict the return address of return instructions. By using
> a jmp instruction you will cause the RSB to miss. Such a miss may
> cause around a 10% slowdown - our switch instructions in old Jikes
> RVM's caused the RSB to miss and fixing this caused a 10% speedup on
> some DaCapo benchmarks (those that had switches of >8 elements in
> their critical path).

This seems about right to me.  You'll want to somehow mark the HIR/LIR instruction as a tail call (most likely by adding a tail call boolean to the MethodOperand object).  When you get to calling convention expansion, this is where you'll want to do something different (use jmp instead of a call).  You may need to do some work in the assemblers to teach it about this instruction.

I think JMP is the right thing here (not call) because with a tail call you aren't going to be returning to the instruction after the JMP (that's the point).  So you want to leave the RSB unchanged because when you eventually do a RET, it will be to the last place you did a CALL from not from the place you did the JMP from.


This email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
Jikesrvm-researchers mailing list