[fpc-devel] register / ABI for constructor and destroy

Florian Klämpfl florian at freepascal.org
Sat Oct 14 22:56:04 CEST 2017


Am 14.10.2017 um 14:36 schrieb Martin:
> I am trying to update pascal script.
> 
> It seems that at some time there where changes in the register usage for calling constructors.

As far as I am aware, those did not change for years? I think the only way to find out what happens
is to test what code different version generate.

> 
> At least I found the following code:
>>               {$IF DEFINED (fpc) and (fpc_version < 3)}
>>                 if IsConstructor or IsVirtualCons then
>>                   tbtu32(res.dta^) := RealCall_Register(Address, EDX, EAX, ECX,
>>                   @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil)
>>                 else
>>              {$IFEND}
>>                   tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX,
>>                   @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil);
> 
> Also which versions are affected?
> 
> My testing indicates that this may apply for 3.1 (trunk).
> But 3.0.x  seems to use the same as 2.x ?
> 
> 
> And are other calls (maybe destructor) affected?
> 
> Or does destructor (or maybe virtual methods?) generally take a different order than other methods.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list