From 850e611770b41c683e256461a2839ddaad26326a Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 16 Oct 1998 13:37:45 +0000 Subject: [PATCH] * added code for vmt_offset in destructors --- rtl/i386/i386.inc | 20 +++++++++++++++----- rtl/m68k/m68k.inc | 15 ++++++++++++--- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/rtl/i386/i386.inc b/rtl/i386/i386.inc index b4cfafc232..034ae5763d 100644 --- a/rtl/i386/i386.inc +++ b/rtl/i386/i386.inc @@ -306,10 +306,8 @@ asm 8 VMT-Address 4 Main program-Addr 0 %ebp + edi contains the vmt position } - { temporary Variable } - subl $4,%esp - movl %esp,%edi pushal { Should the object be resolved ? } movl 8(%ebp),%eax @@ -318,7 +316,16 @@ asm { Yes, get size from SELF! } movl 12(%ebp),%eax { get VMT-pointer (from Self) to %ebx } +{$ifdef OBJECTVMTOFFSET} + { the offset is in %edi since the calling and has not been changed !! } + movl (%eax,%edi,1),%ebx +{$else OBJECTVMTOFFSET} movl (%eax),%ebx +{$endif OBJECTVMTOFFSET} + movl (%eax),%ebx + { temporary Variable } + subl $4,%esp + movl %esp,%edi { And put size on the Stack } pushl (%ebx) { SELF } @@ -332,9 +339,9 @@ asm {$else} call FREEMEM {$endif} + addl $4,%esp .LHD_3: popal - addl $4,%esp end; {$ASMMODE ATT} @@ -706,7 +713,10 @@ end; { $Log$ - Revision 1.27 1998-10-16 08:53:50 peter + Revision 1.28 1998-10-16 13:37:46 pierre + * added code for vmt_offset in destructors + + Revision 1.27 1998/10/16 08:53:50 peter * fill_object in constructor changed to 'inline' code to overcome pushw/pushl problem diff --git a/rtl/m68k/m68k.inc b/rtl/m68k/m68k.inc index 86ec272600..ee3e4d3c25 100644 --- a/rtl/m68k/m68k.inc +++ b/rtl/m68k/m68k.inc @@ -192,6 +192,7 @@ 8 VMT-Address 4 Main program-Addr 0 %ebp + d0 contains vmt_offset } { temporary Variable } subq.l #4,sp @@ -199,13 +200,18 @@ { Save Registers } movem.l d0-a7,-(sp) - move.l 8(a6),d0 { Get the address of the vmt } - or.l d0,d0 { Check if there is a vmt } + move.l 8(a6),d1 { Get the address of the vmt } + or.l d1,d1 { Check if there is a vmt } beq @LHD_3 { Yes, get size from SELF! } move.l 12(a6),a0 { get VMT-pointer (from Self) to %ebx } +{$ifdef OBJECTVMTOFFSET} + { the offset is in d0 since the calling and has not been changed !! } + move.l (a0,d0.l),a1 +{$else OBJECTVMTOFFSET} move.l (a0),a1 +{$endif OBJECTVMTOFFSET} { And put size on the Stack } move.l (a1),-(sp) { SELF } @@ -682,7 +688,10 @@ end; { $Log$ - Revision 1.13 1998-10-15 11:35:03 pierre + Revision 1.14 1998-10-16 13:37:45 pierre + * added code for vmt_offset in destructors + + Revision 1.13 1998/10/15 11:35:03 pierre + first step of variable vmt offset offset is stored in R_EDI (R_D0) if objectvmtoffset is defined