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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 20 00:17:54 PDT 2010


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





--- Comment #10 from Gabor Loki <loki at webkit.org>  2010-09-20 00:17:54 PST ---
> 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.)

-- 
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