[fpc-devel] OO rewrite - technical questions

Michael Schnell mschnell at lumino.de
Mon Jul 26 10:28:22 CEST 2010


  On 07/24/2010 03:16 PM, Florian Klämpfl wrote:
>
> Delphi does not use a segment register for threadvar handling but OS calls.
sorry but this is not true

Turbo Delphi:

code:

var test integer;
threadvar threadtest: integer;

   test := 1;
   threadtest := 2;

compiles to

  mov [$...], $1

  call @GetTls
  mov [eax+$34], $2

with

@GetTLS resulting in (this is not exactly the original code, which in 
fact reads a zero form some location to EAX and uses it)


  mov edx, fs:[4]
  mov eax, [edx]
  ret


-Michael









More information about the fpc-devel mailing list