Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2017-10

register / ABI for constructor and destroy

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

I am trying to update pascal script.

It seems that at some time there where changes in the register usage for calling constructors.

At least I found the following code:

Show quoted text 10 lines
              {$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.

Reply by email

Florian Klämpfl
to Martin
Martin wrote
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.

Show quoted text 23 lines
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  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email