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
Dear Nivedita --
Someone else will have to answer about the exact place
to make the changes you're talking about. However, I think
that it has to do with either LIR->MIR, which is mediated
by BURS rules, or (maybe) LIR->assembler. This
does not apply to the Baseline compile actually, since
it does not do optimization at all. This happens somewhere
in the Opt compiler back-end.
If you can ask your question clearly enough, Dave G or someone
can answer it. I think you are asking:
"Where in the compiler should I look for the Java module(s) to
modify to add the translation of my new IR instruction to
A related question is:
"Is translating this instruction more properly an LIR-to-MIR
step or an MIR-to-assembly code step?"
Best wishes -- EMOn Thu, Jan 22, 2009 at 10:05 AM, David P Grove <email@example.com> wrote:
Ian Rogers <firstname.lastname@example.org> 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
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.
> 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
> (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  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)  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).
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 SF.net email is sponsored by:
SourceForge wants to tell your story.
Jikesrvm-researchers mailing list