[Webkit-unassigned] [Bug 24986] ARM JIT port

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 22 01:26:49 PDT 2009


------- Comment #50 from zherczeg at inf.u-szeged.hu  2009-06-22 01:26 PDT -------
Hi Gavin,

it seems I misunderstood the concept of MacroAssembler. I thougt it is a pseudo
assembly language, which resembles the syntax of x86 machines, and its backends
translate the instructions of this virtual assembler to machine code.

I try to summarize your new arm layout concept:

        (no changes)
        (format and push all possible ARM instructions, or push a 32 bit word)
        (contains "MacroAssemblerARMInternals" = "original ARMAssembler" - 
                                                 "current ARMAssembler"
             Hence, it contains utility functions)
        (MacroAssemblerARM supports constant pool handling)

Our main issue with this approach is that we need to check the state of the
constant pool manually before every instruction: 
   CheckConstPool(sizeOfNextInstruction); ARMAssembler.mov_r();
   CheckConstPool(sizeOfNextInstruction); ARMAssembler.branch();
We cannot avoid this manual check, since ARMAssembler is not able to call
CheckConstPool(), since it is defined in MacroAssemblerARM level. ARMAssembler
cannot include MacroAssemblerARM, since MacroAssemblerARM already includes
ARMAssembler, and adding the first relation would cause a circular reference.
Although we can do this manual check before every instruction, it would not be
a nice coding stlye (and may cause crashes if we forget to put it before every
individual instruction).

We are still thinking about keeping the constant pool in somewhat lower level:

        (no changes)
        (constant pool handling)
        (same as abouve)
        (contains MacroAssemblerARMInternals = same as above)

AssemblerBufferWithConstantPool is a machine independent constant pool
template, which can push both instructions and constants. Of coures, this
template class is optional depending on the architecture. 3 template arguments
are enough to specialze this class:
   - the max size of the constant pool
   - the size of the barrier jump (protect the constant pool from execution)
   - a callback(?) function which inserts the jump and does machine dependent
post processing
In this way we can avoid the mentioned manual checks.

Which one you choose? We can implement either one.

> The constant-pool is not a mechanism implemented within
> the assembler, but instead is a one of a number of techniques available to the
> compiler during instruction selection when generating code for which a single
> assembly operation is not available.  The assembler is not aware of the
> structure or semantics of the constant pool - it only sees a PC relative load
> instruction.

Although the compilers tend to keep the constant pool generation for
themselves, most assemblers support constant pools with help of "ldr reg,
=value" pseudo instruction and ".ltorg" assembler directive.


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

More information about the webkit-unassigned mailing list