Browse Source

* decstack after each br_if in the a_cmp_XXX_br methods

git-svn-id: branches/wasm@48192 -
nickysn 4 years ago
parent
commit
f9d1a9b8e3
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compiler/wasm32/hlcgcpu.pas

+ 5 - 0
compiler/wasm32/hlcgcpu.pas

@@ -762,30 +762,35 @@ implementation
     begin
     begin
       a_cmp_const_ref_stack(list,size,cmp_op,a,ref);
       a_cmp_const_ref_stack(list,size,cmp_op,a,ref);
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
+      thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
     end;
     end;
 
 
   procedure thlcgwasm.a_cmp_const_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; a: tcgint; reg: tregister; br: Integer);
   procedure thlcgwasm.a_cmp_const_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; a: tcgint; reg: tregister; br: Integer);
     begin
     begin
       a_cmp_const_reg_stack(list,size,cmp_op,a,reg);
       a_cmp_const_reg_stack(list,size,cmp_op,a,reg);
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
+      thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
     end;
     end;
 
 
   procedure thlcgwasm.a_cmp_ref_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; const ref: treference; reg: tregister; br: Integer);
   procedure thlcgwasm.a_cmp_ref_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; const ref: treference; reg: tregister; br: Integer);
     begin
     begin
       a_cmp_ref_reg_stack(list,size,cmp_op,ref,reg);
       a_cmp_ref_reg_stack(list,size,cmp_op,ref,reg);
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
+      thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
     end;
     end;
 
 
   procedure thlcgwasm.a_cmp_reg_ref_br(list: TAsmList; size: tdef; cmp_op: topcmp; reg: tregister; const ref: treference; br: Integer);
   procedure thlcgwasm.a_cmp_reg_ref_br(list: TAsmList; size: tdef; cmp_op: topcmp; reg: tregister; const ref: treference; br: Integer);
     begin
     begin
       a_cmp_reg_ref_stack(list,size,cmp_op,reg,ref);
       a_cmp_reg_ref_stack(list,size,cmp_op,reg,ref);
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
+      thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
     end;
     end;
 
 
   procedure thlcgwasm.a_cmp_reg_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; reg1, reg2: tregister; br: Integer);
   procedure thlcgwasm.a_cmp_reg_reg_br(list: TAsmList; size: tdef; cmp_op: topcmp; reg1, reg2: tregister; br: Integer);
     begin
     begin
       a_cmp_reg_reg_stack(list,size,cmp_op,reg1,reg2);
       a_cmp_reg_reg_stack(list,size,cmp_op,reg1,reg2);
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
       current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
+      thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
     end;
     end;
 
 
   procedure thlcgwasm.g_reference_loc(list: TAsmList; def: tdef; const fromloc: tlocation; out toloc: tlocation);
   procedure thlcgwasm.g_reference_loc(list: TAsmList; def: tdef; const fromloc: tlocation; out toloc: tlocation);