harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [drlvm][magic] New Magic features proposal.
Date Wed, 24 Jan 2007 03:16:33 GMT
On 1/23/07, Mikhail Fursov <mike.fursov@gmail.com> wrote:
> On 1/23/07, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
> >
> >
> > Based on my prior experience with M2N frame work, I have the same
> > feeling that compiler instrinsic might be able to deal with fast
> > native call (except some corner cases where very special calling
> > convention ect. is used, e.g., the native method itself is a
> > hand-written asm code sequence.)
> >
> > Probably the compiler instrinsic semantics can be expressed with Java
> > Magics, then they are just the same thing from different viewpoints.
> >
> >
> The problem is with usual JNI calls. JIT knows nothing about M2N frames
> today. Pavel wants to encode JNI stub's body with magics and do not add any
> knowledge about M2N into JIT.

Yes, I see his point. I wonder what is the main benefit. Is it to save
the two "call" instructions?

> So we have 2 new magics: allocateMemChunkOnStack(size) and
> saveRegisters(Address, howToSave)
> The problem left is EIP handling. Before making direct call JIT pushes
> call's args, saves caller-save regs, so EIP changes.
> When unwinding native call VM uses EIP saved in M2N frame. JIT can't find
> call by this EIP and this is the problem.
> I'll take a break here for a day to think more about it and read others
> ideas how to deal with EIP...
>

Go with the compiler intrinsic approach, JIT doesn't have to compile
the stub code blindly as common magics. It knows the stub is for fast
native call, then it can intelligently emit code to handle EIP.
Annotation or pre-generated asm sequence may help.

Well, we need judge if it's worth doing with the complications.

Thanks,
xiaofeng

> --
> Mikhail Fursov
>
>

Mime
View raw message