Browse Source

[PATCH 35/83] writing out offset rather than symbol reference of load/store operations

From 6779bb3f6cc05cb89e5fa577ec9f2243d80f52b4 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Mon, 16 Sep 2019 10:08:03 -0400

git-svn-id: branches/wasm@45912 -
nickysn 5 years ago
parent
commit
2dd0baa693
1 changed files with 7 additions and 6 deletions
  1. 7 6
      compiler/wasm/agwat.pas

+ 7 - 6
compiler/wasm/agwat.pas

@@ -131,11 +131,7 @@ implementation
              // ref.base can be <> NR_NO in case an instance field is loaded.
              // ref.base can be <> NR_NO in case an instance field is loaded.
              // This register is not part of this instruction, it will have
              // This register is not part of this instruction, it will have
              // been placed on the stack by the previous one.
              // been placed on the stack by the previous one.
-
-             if ref.symbol.typ in [AT_DATA] then begin
-               result := 'offset='+tostr(ref.offset)
-             end else
-               result:=GetWasmName(ref.symbol.name);
+             result:=GetWasmName(ref.symbol.name);
            end
            end
          else
          else
            begin
            begin
@@ -223,7 +219,12 @@ implementation
           for i:=0 to cpu.ops-1 do
           for i:=0 to cpu.ops-1 do
             begin
             begin
               writer.AsmWrite(#9);
               writer.AsmWrite(#9);
-              writer.AsmWrite(getopstr(cpu.oper[i]^));
+
+              if (cpu.opcode in AsmOp_LoadStore) and (cpu.oper[i]^.typ = top_ref) then
+                writer.AsmWrite('offset='+tostr( cpu.oper[i]^.ref^.offset))
+              else
+                writer.AsmWrite(getopstr(cpu.oper[i]^));
+
             end;
             end;
         end;
         end;