[Webkit-unassigned] [Bug 44329] SH4 JIT SUPPORT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 20 01:25:24 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44329


thouraya.andolsi at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thouraya.andolsi at gmail.com




--- Comment #11 from thouraya.andolsi at gmail.com  2010-09-20 01:25:24 PST ---
(In reply to comment #10)
> > in arm you are encoding the offset of the constant in the constant pool in the LDR instruction (offset << 1 + 1).
> > 
> > to know if the constant was dumped or no, you have just to see the last bit, if it's 1 the constant is not yet dumped otherwise it's dumped.
> 
> No. The AssemblerBufferWithConstantPool::flushConstantPool function will dump the pool into the instruction stream. In point of fact there is no need any kind of decorator. In case of ARM the last bit decorator is just a legacy helper (from there were no MASM and CP interfaces).
> 
> > But in sh4 we are using the mov at PC-relative and the offset can be pair or impair.
> 
> It can be done simply with the current AssemblerBufferWithConstantPool. There are two kind of patchConstantPoolLoad functions. One is to store the index of constants/literals, while the real constants are in a vector. The second one is to patch those instructions which hold the indexes with real constants to create the final instructions.
> 
> For example:
> 1) After a putIntWithConstantInt(insn, constant) is called.
>  - the constant is saved in a vector
>  - a TYPE patchConstantPoolLoad(TYPE load, int value) is called where
>   the value is the position of the constant in the pool.
> ...
> 2) After the flushConstantPool is called
>  - the void patchConstantPoolLoad(void* loadAddr, void* constPoolAddr) is called for each constants/literals in the pool to build the final instruction
> 
> You can see there is no pressure to decorate the addresses. If you are brave just store the index with the first patchConstantPoolLoad function and repatch this index with the final instruction. There is only one restriction: the final and the index-holder instructions should have the same length.
> 
> (Hmm, we should rename them. It looks like the naming-convention of the patchConstantPoolLoad functions are quite confusing.)


Hello,

My problem comes when I call the function linkJump(JmpSrc from, JmpDst to) to patch the Jump instruction.

the offset for the jump is loaded into a register because we don't know if it can be reached by the jump instruction or not.

if the constant pool  is dumped we have to store the real offset, otherwise we have to  put the correct offset in the vector.

but I don't have a way to know if the constant is dumped or no.
In your case if the offset of the LDR instruction is pair it's dumped otherwise it is not yet dumped.


Regards.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list