Browse Source

[PATCH 66/83] loading address of NR_FRAME_POINTER_REG variable

From f33044b97c8db5e7bf634d93834da12634957876 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Tue, 15 Oct 2019 12:05:18 -0400

git-svn-id: branches/wasm@45943 -
nickysn 5 years ago
parent
commit
db67e7b706
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/wasm/hlcgcpu.pas

+ 6 - 0
compiler/wasm/hlcgcpu.pas

@@ -1136,6 +1136,12 @@ implementation
         incstack(list, 1);
         incstack(list, 1);
         // reading back to the register
         // reading back to the register
         a_load_stack_reg(list, tosize, r);
         a_load_stack_reg(list, tosize, r);
+      end else if (ref.base = NR_FRAME_POINTER_REG) then begin
+        list.Concat(taicpu.op_sym(a_get_local, current_asmdata.RefAsmSymbol('fp',AT_ADDR) ));
+        list.Concat(taicpu.op_const(a_i32_const, ref.offset));
+        // todo: index?
+        list.Concat(taicpu.op_none(a_i32_add));
+        incstack(list, 1);
       end else
       end else
         a_load_ref_reg(list,ptruinttype,ptruinttype,ref,r);
         a_load_ref_reg(list,ptruinttype,ptruinttype,ref,r);
     end;
     end;