[fpc-devel] FPC-JVM: Status report on Android

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Aug 30 12:19:35 CEST 2011


Michael Schnell schrieb:
> On 08/29/2011 05:58 PM, Hans-Peter Diettrich wrote:
>>
>>>
>>> That is why I am astonished that converting Java-Bytecode to Dalvik 
>>> code should be an easy task.
>>
>> A stackbased internal or intermediate representation is the most 
>> general one, from which a compiler can decide which registers to use 
>> for expression evaluation etc.  FPC itself uses registers only for the 
>> actual code generation, depending on how many registers are available 
>> on the target machine.
> I don't see what you mean here. While of course FPC does acknowledge the 
> count and kind of registers with targets like ARM or X86 or X86-64, Sven 
> reported that his port for Java targets creates register-ignorant (stack 
> based) code for standard (SUN) virtual Java machines and the 
> "dex-converter" by Google converts this to 16-bit-wide Dalvik code which 
> introduces Register notation.

The FPC internal representation (code tree nodes) has no notion of 
registers. This is (also) due to the fact, that a register allocator can 
work reasonably only after the entire code of a subroutine is known. 
When the target is a registerless VM, the register allocator never is 
invoked.

DoDi




More information about the fpc-devel mailing list