瀏覽代碼

+ commented why wrappers for cdecl'd methods use subl/call/subl/ret instead of subl/jmp

git-svn-id: trunk@12829 -
florian 16 年之前
父節點
當前提交
f49f148e01
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      compiler/i386/cgcpu.pas

+ 5 - 0
compiler/i386/cgcpu.pas

@@ -534,6 +534,11 @@ unit cgcpu;
            set self parameter to correct value
            call mangledname
            set self parameter to interface value
+           ret
+
+           This is different to case (0) because in theory, the caller
+           could reuse the data pushed on the stack so we've to return
+           it unmodified because self is const.
 
       (2): The wrapper code use %eax to reach the virtual method address
            set self to correct value