[webkit-dev] want to port JIT to MIPS - using X86::ecx as base

x yz lastguy at yahoo.com
Fri Feb 6 14:52:18 PST 2009


1.what's the meaning of ALTERNATE_JSIMMEDIATE and slow case?
2.how come the following code can use ECX as base register?
 load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx);
if the X86::ecx just means its value 1 in ModR/M, does it means [BX+DI]? 
3. can anybody help me on my previous questions? does JIT support floating point?
many thanks
joe

--- On Tue, 2/3/09, x yz <lastguy at yahoo.com> wrote:

> From: x yz <lastguy at yahoo.com>
> Subject: Re: [webkit-dev] want to port JIT to MIPS - IEEE ques
> To: "Gavin Barraclough" <barraclough at apple.com>, "WebKit Development" <webkit-dev at lists.webkit.org>
> Date: Tuesday, February 3, 2009, 9:08 AM
> 1. Thanks for more info. Although X86 Linux gcc uses
> regparam(3), I think MIPS ABI always asks $a0~a3/@v0~v1 for
> i/o?
> 2. It seems I can get rid of 64bit OP if
> JIT_OPTIMIZE_ARITHMETIC and 
> ALTERNATE_JSIMMEDIATE are both disabled? 
> 3. is it ALTERNATE_JSIMMEDIATE for ecma-262?
> 4. does JIT support floating point? if yes why it is not
> under jit/asm?
> rgds
> joe
> 
> --- On Wed, 1/28/09, Gavin Barraclough
> <barraclough at apple.com> wrote:
> 
> > From: Gavin Barraclough <barraclough at apple.com>
> > Subject: Re: [webkit-dev] want to port JIT to MIPS,
> any coworker or any hint?
> > To: lastguy at yahoo.com
> > Date: Wednesday, January 28, 2009, 4:55 PM
> > On Jan 27, 2009, at 10:58 PM, x yz wrote:
> > 
> > > Gavin,
> > > last night I saw WREC when I search X86, and
> realized
> > many places  
> > > need to be touched. Your reply give more info and
> > really help.  
> > > Thanks a lot.
> > >
> > > In Generator::generateEnter(), there is comment
> > "On gcc the function  
> > > is regparm(3)...", how to understand that?
> > 
> > WREC JIT generates a function with a C calling
> convention
> > that  
> > implements the regular expression.  The entry and exit
> from
> > the  
> > function are generated by the generateEnter() and
> > generateReturn*()  
> > methods.  On OS X x86, the JIT generated function
> > implements a  
> > regparm(3) calling convention (see WREC.h, the
> generated
> > code is  
> > called through a CompiledRegExp function pointer).
> > 
> > > The function has no argument, why we peek four
> > arguments from  
> > > stack(input,output,length,index)?
> > 
> > These calls are not peeking values from the stack at
> the
> > time they are  
> > called; they are emitting JIT code that will will read
> > values from the  
> > stack, when the JIT function has been generated and is
> run.
> >  The JIT  
> > generated regular expression function is passed these
> four
> > arguments  
> > (again see WREC.h).
> > 
> > As a note, you're best directing these emails at
> the
> > webkit-dev list  
> > in future, that way other people will also be able to
> help
> > you out.
> > 
> > cheers,
> > G.
> > 
> > 
> > >
> > > rgds
> > > joe
> > >
> > >
> > > --- On Tue, 1/27/09, Gavin Barraclough
> > <barraclough at apple.com> wrote:
> > >
> > >> From: Gavin Barraclough
> > <barraclough at apple.com>
> > >> Subject: Re: [webkit-dev] want to port JIT to
> > MIPS, any coworker or  
> > >> any hint?
> > >> To: lastguy at yahoo.com
> > >> Date: Tuesday, January 27, 2009, 5:10 AM
> > >> On Jan 26, 2009, at 11:09 AM, x yz wrote:
> > >>
> > >>> Gavin,
> > >>> Thanks, I really need to learn fast.
> > >>> Where can I find more on WREC or its
> spec?
> > >>
> > >> WREC is WebKit's regular expression JIT. 
> The
> > spec it
> > >> is implementing is the regular expression
> syntax
> > described
> > >> in ECMA-262.
> > >>
> > >>> Which part of webkit is WREC? I just see
> all
> > assembler
> > >> codes are in <assembler> and
> <jit> and
> > wonder
> > >> whether I can just change them rather then
> change
> > WREC.
> > >>
> > >> WebKit contains two separate JITs, one for
> the
> > JavaScript
> > >> language (in the 'jit' directory),
> one for
> > >> JavaScript's regular expression language
> (in
> > the
> > >> 'wrec' directory).  Both JITs make
> use of
> > the same
> > >> assembler to emit code.  WREC is a much
> smaller,
> > simpler
> > >> JIT, which is why I suggest starting by
> looking at
> > this, but
> > >> either JIT can be enabled independently of
> the
> > other.
> > >>
> > >>> Foresee SSE set may be a problem as MIPS
> has
> > no SSE.
> > >>
> > >> WREC does not use SSE, and I believe all JIT
> code
> > generated
> > >> by the main JS JIT is guarded by the a
> > configuration switch,
> > >> JIT_OPTIMIZE_ARITHMETIC – this can be
> disabled
> > in
> > >> Platform.h.
> > >>
> > >>> Sun's link for "The JIT Compiler
> > Interface
> > >> Specification" not valid anymore.
> > >>
> > >> Our JIT is all our own code, and written from
> > scratch, so
> > >> I'm not sure this documentation would
> help
> > you.
> > >>
> > >> Good luck,
> > >> G.
> > >>
> > >>
> > >>> MacroAssembler::breakpoint() is just int3
> > which I know
> > >> used as debug int in X86. I'll see which
> one
> > used in gnu
> > >> mips.
> > >>> joe
> > >>>
> > >>>
> > >>>
> > >>> --- On Sun, 1/25/09, Gavin Barraclough
> > >> <barraclough at apple.com> wrote:
> > >>>
> > >>>> From: Gavin Barraclough
> > >> <barraclough at apple.com>
> > >>>> Subject: Re: [webkit-dev] want to
> port JIT
> > to
> > >> MIPS, any coworker or any hint?
> > >>>> To: "WebKit Development"
> > >> <webkit-dev at lists.webkit.org>
> > >>>> Date: Sunday, January 25, 2009, 5:34
> PM
> > >>>> On Jan 24, 2009, at 8:36 PM, x yz
> wrote:
> > >>>>
> > >>>>> Just build webkit on XP using
> cgywin,
> > not
> > >> tested yet.
> > >>>> I want to port to 32bit MIPS, it
> seems I
> > need to
> > >> touch JIT
> > >>>> and rewrite assembler folder.
> > >>>>
> > >>>> Once you have the bytecode
> interpreter up
> > and
> > >> running on
> > >>>> MIPS, I'd recommend starting by
> just
> > trying to
> > >> port WREC
> > >>>> (the regular expression JIT).  This
> is a
> > good
> > >> starting point
> > >>>> because it utilizes a smaller subset
> of
> > the
> > >> MacroAssembler
> > >>>> interface, and has a much simpler
> > interface to C
> > >> code (JIT
> > >>>> code is called with C calling
> conventions,
> > and no
> > >> callbacks
> > >>>> are made into C from the JIT
> generated
> > code).
> > >>>>
> > >>>>> Any document there on
> > javascripcore/assembler?
> > >> I also
> > >>>> want a smart way to make sure output
> is
> > correct.
> > >>>>
> > >>>> A very simple way to validate you are
> > generating
> > >> the
> > >>>> correct code is to simply force the
> JIT to
> > insert
> > >> a
> > >>>> breakpoint (i.e. use
> > MacroAssembler::breakpoint())
> > >> at the
> > >>>> head of the function you are
> generating,
> > then run
> > >> jsc under
> > >>>> a debugger, and when it hits the
> > breakpoint simply
> > >>>> disassemble the code in memory at the
> > point it has
> > >> stopped.
> > >>>> Now you can visually inspect that it
> it
> > has
> > >> generated the
> > >>>> code you were expecting.
> > >>>>
> > >>>> Good luck!
> > >>>> G.
> > >>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>
> _______________________________________________
> > >>>>> webkit-dev mailing list
> > >>>>> webkit-dev at lists.webkit.org
> > >>>>>
> > >>>>
> > >>
> >
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> > >>>>
> > >>>>
> > _______________________________________________
> > >>>> webkit-dev mailing list
> > >>>> webkit-dev at lists.webkit.org
> > >>>>
> > >>
> >
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> > >>>
> > >>>
> > >>>
> > >
> > >
> > >


      


More information about the webkit-dev mailing list