|
@@ -70,6 +70,7 @@ unit tgcpu;
|
|
|
procedure updateFirstTemp;
|
|
|
|
|
|
procedure allocLocalVarToRef(wbt: TWasmBasicType; out ref: treference);
|
|
|
+ procedure allocLocalVarNoReuseToRef(wbt: TWasmBasicType; out ref: treference);
|
|
|
procedure LocalVarToRef(idx: integer; size: Integer; out ref: treference);
|
|
|
public
|
|
|
localvars: TWasmLocalVars;
|
|
@@ -203,12 +204,12 @@ unit tgcpu;
|
|
|
|
|
|
procedure ttgwasm.allocframepointer(list: TAsmList; out ref: treference);
|
|
|
begin
|
|
|
- allocLocalVarToRef(wbt_i32,ref);
|
|
|
+ allocLocalVarNoReuseToRef(wbt_i32,ref);
|
|
|
end;
|
|
|
|
|
|
procedure ttgwasm.allocbasepointer(list: TAsmList; out ref: treference);
|
|
|
begin
|
|
|
- allocLocalVarToRef(wbt_i32,ref);
|
|
|
+ allocLocalVarNoReuseToRef(wbt_i32,ref);
|
|
|
end;
|
|
|
|
|
|
procedure ttgwasm.allocLocalVarToRef(wbt: TWasmBasicType; out ref: treference);
|
|
@@ -219,6 +220,14 @@ unit tgcpu;
|
|
|
localVarToRef(idx, 1, ref);
|
|
|
end;
|
|
|
|
|
|
+ procedure ttgwasm.allocLocalVarNoReuseToRef(wbt: TWasmBasicType; out ref: treference);
|
|
|
+ var
|
|
|
+ idx : integer;
|
|
|
+ begin
|
|
|
+ idx := localvars.allocnoreuse(wbt);
|
|
|
+ localVarToRef(idx, 1, ref);
|
|
|
+ end;
|
|
|
+
|
|
|
procedure ttgwasm.localVarToRef(idx: integer; size: integer; out ref: treference);
|
|
|
begin
|
|
|
reference_reset_base(ref,NR_LOCAL_STACK_POINTER_REG,idx,ctempposinvalid,size,[]);
|