浏览代码

* added code for vmt_offset in destructors

pierre 27 年之前
父节点
当前提交
850e611770
共有 2 个文件被更改,包括 27 次插入8 次删除
  1. 15 5
      rtl/i386/i386.inc
  2. 12 3
      rtl/m68k/m68k.inc

+ 15 - 5
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
 

+ 12 - 3
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