瀏覽代碼

* fixed passing of record parameters on win64

git-svn-id: trunk@4583 -
florian 19 年之前
父節點
當前提交
24ae32c855
共有 1 個文件被更改,包括 17 次插入4 次删除
  1. 17 4
      compiler/x86_64/cpupara.pas

+ 17 - 4
compiler/x86_64/cpupara.pas

@@ -98,8 +98,11 @@ unit cpupara;
              begin
              begin
                if p.size<=16 then
                if p.size<=16 then
                  begin
                  begin
-                   {$warning TODO location depends on the fields}
-                   loc1:=LOC_REFERENCE;
+                   if (target_info.system=system_x86_64_win64) and
+                      (p.size<=8)  then
+                     loc1:=LOC_REGISTER
+                   else
+                     loc1:=LOC_REFERENCE;
                  end
                  end
                else
                else
                  loc1:=LOC_REFERENCE;
                  loc1:=LOC_REFERENCE;
@@ -107,13 +110,23 @@ unit cpupara;
            objectdef:
            objectdef:
              begin
              begin
                if is_object(p) then
                if is_object(p) then
-                 loc1:=LOC_REFERENCE
+                 begin
+                   if (target_info.system=system_x86_64_win64) and
+                      (p.size<=8)  then
+                     loc1:=LOC_REGISTER
+                   else
+                     loc1:=LOC_REFERENCE;
+                 end
                else
                else
                  loc1:=LOC_REGISTER;
                  loc1:=LOC_REGISTER;
              end;
              end;
            arraydef:
            arraydef:
              begin
              begin
-               loc1:=LOC_REFERENCE;
+               if (target_info.system=system_x86_64_win64) and
+                  (p.size<=8)  then
+                 loc1:=LOC_REGISTER
+               else
+                 loc1:=LOC_REFERENCE;
              end;
              end;
            variantdef:
            variantdef:
              loc1:=LOC_REFERENCE;
              loc1:=LOC_REFERENCE;