浏览代码

* implemented r30870 for all platforms: pass dyn. array parameters like pointer parameters so typically in a register

git-svn-id: trunk@30878 -
florian 10 年之前
父节点
当前提交
b4fc11fe06
共有 5 个文件被更改,包括 18 次插入5 次删除
  1. 4 1
      compiler/arm/cpupara.pas
  2. 4 1
      compiler/avr/cpupara.pas
  3. 2 1
      compiler/i8086/cpupara.pas
  4. 4 1
      compiler/powerpc/cpupara.pas
  5. 4 1
      compiler/powerpc64/cpupara.pas

+ 4 - 1
compiler/arm/cpupara.pas

@@ -163,7 +163,10 @@ unit cpupara;
             filedef:
               getparaloc:=LOC_REGISTER;
             arraydef:
-              getparaloc:=LOC_REFERENCE;
+              if is_dynamic_array(p) then
+                getparaloc:=LOC_REGISTER
+              else
+                getparaloc:=LOC_REFERENCE;
             setdef:
               if is_smallset(p) then
                 getparaloc:=LOC_REGISTER

+ 4 - 1
compiler/avr/cpupara.pas

@@ -99,7 +99,10 @@ unit cpupara;
             filedef:
               getparaloc:=LOC_REGISTER;
             arraydef:
-              getparaloc:=LOC_REFERENCE;
+              if is_dynamic_array(p) then
+                getparaloc:=LOC_REGISTER
+              else
+                getparaloc:=LOC_REFERENCE;
             setdef:
               if is_smallset(p) then
                 getparaloc:=LOC_REGISTER

+ 2 - 1
compiler/i8086/cpupara.pas

@@ -629,7 +629,8 @@ unit cpupara;
                     if (parareg<=high(parasupregs)) and
                        (paralen<=sizeof(aint)) and
                        (not(hp.vardef.typ in [floatdef,recorddef,arraydef]) or
-                        pushaddr) and
+                        pushaddr or
+                        is_dynamic_array(hp.vardef)) and
                        (not(vo_is_parentfp in hp.varoptions) or
                         not(po_delphi_nested_cc in p.procoptions)) then
                       begin

+ 4 - 1
compiler/powerpc/cpupara.pas

@@ -165,7 +165,10 @@ unit cpupara;
             filedef:
               result:=LOC_REGISTER;
             arraydef:
-              result:=LOC_REFERENCE;
+              if is_dynamic_array(p) then
+                getparaloc:=LOC_REGISTER
+              else
+                result:=LOC_REFERENCE;
             setdef:
               if is_smallset(p) then
                 result:=LOC_REGISTER

+ 4 - 1
compiler/powerpc64/cpupara.pas

@@ -146,7 +146,10 @@ begin
     filedef:
       result := LOC_REGISTER;
     arraydef:
-      result := LOC_REFERENCE;
+      if is_dynamic_array(p) then
+        getparaloc:=LOC_REGISTER
+      else
+        result := LOC_REFERENCE;
     setdef:
       if is_smallset(p) then
         result := LOC_REGISTER