فهرست منبع

* override is_pushleftright for WebAssembly and make it return true

git-svn-id: branches/wasm@48312 -
nickysn 4 سال پیش
والد
کامیت
910bbc6b37
2فایلهای تغییر یافته به همراه24 افزوده شده و 12 حذف شده
  1. 12 12
      compiler/wasm32/hlcgcpu.pas
  2. 12 0
      compiler/wasm32/symcpu.pas

+ 12 - 12
compiler/wasm32/hlcgcpu.pas

@@ -1461,24 +1461,24 @@ implementation
           paramanager.getcgtempparaloc(list,pd,1,cgpara1);
           paramanager.getcgtempparaloc(list,pd,2,cgpara2);
           paramanager.getcgtempparaloc(list,pd,3,cgpara3);
-          //if pd.is_pushleftright then
-          //  begin
+          if pd.is_pushleftright then
+            begin
               { load source }
               a_loadaddr_ref_cgpara(list,voidtype,source,cgpara1);
               { load destination }
               a_loadaddr_ref_cgpara(list,voidtype,dest,cgpara2);
               { load size }
               a_load_const_cgpara(list,sizesinttype,size.size,cgpara3);
-          //  end
-          //else
-          //  begin
-          //    { load size }
-          //    a_load_const_cgpara(list,sizesinttype,size.size,cgpara3);
-          //    { load destination }
-          //    a_loadaddr_ref_cgpara(list,voidtype,dest,cgpara2);
-          //    { load source }
-          //    a_loadaddr_ref_cgpara(list,voidtype,source,cgpara1);
-          //  end;
+            end
+          else
+            begin
+              { load size }
+              a_load_const_cgpara(list,sizesinttype,size.size,cgpara3);
+              { load destination }
+              a_loadaddr_ref_cgpara(list,voidtype,dest,cgpara2);
+              { load source }
+              a_loadaddr_ref_cgpara(list,voidtype,source,cgpara1);
+            end;
           paramanager.freecgpara(list,cgpara3);
           paramanager.freecgpara(list,cgpara2);
           paramanager.freecgpara(list,cgpara1);

+ 12 - 0
compiler/wasm32/symcpu.pas

@@ -94,6 +94,7 @@ type
   { tcpuprocvardef }
 
   tcpuprocvardef = class(tprocvardef)
+    function is_pushleftright: boolean; override;
   end;
   tcpuprocvardefclass = class of tcpuprocvardef;
 
@@ -107,6 +108,7 @@ type
     exprasmlist  : TAsmList;
     destructor destroy; override;
     function create_functype: TWasmFuncType;
+    function is_pushleftright: boolean; override;
   end;
   tcpuprocdefclass = class of tcpuprocdef;
 
@@ -276,10 +278,20 @@ implementation
     end;
 
 
+  function tcpuprocdef.is_pushleftright: boolean;
+    begin
+      Result:=true;
+    end;
+
+
 {****************************************************************************
                              tcpuprocvardef
 ****************************************************************************}
 
+    function tcpuprocvardef.is_pushleftright: boolean;
+      begin
+        Result:=true;
+      end;
 
 
 {****************************************************************************