فهرست منبع

* WebAssembly: a_end_try instruction renamed a_end_legacy_try

Nikolay Nikolov 2 روز پیش
والد
کامیت
9301931bcc
4فایلهای تغییر یافته به همراه21 افزوده شده و 21 حذف شده
  1. 11 11
      compiler/wasm32/aasmcpu.pas
  2. 1 1
      compiler/wasm32/cpubase.pas
  3. 5 5
      compiler/wasm32/cpupi.pas
  4. 4 4
      compiler/wasm32/nwasmflw.pas

+ 11 - 11
compiler/wasm32/aasmcpu.pas

@@ -1105,7 +1105,7 @@ uses
                 internalerror(2024022515);
               PushVals(frame.end_types);
             end;
-          a_end_try:
+          a_end_legacy_try:
             begin
               frame:=PopCtrl;
               if (frame.opcode<>a_legacy_try) and (frame.opcode<>a_legacy_catch) then
@@ -1212,7 +1212,7 @@ uses
           p:=tai(srclist.First);
           if not assigned(p) then
             internalerror(2023100302);
-          if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_else,a_end_if,a_end_block,a_end_loop,a_end_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate]) then
+          if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_else,a_end_if,a_end_block,a_end_loop,a_end_legacy_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate]) then
             begin
               srclist.Remove(p);
               case taicpu(p).opcode of
@@ -1559,7 +1559,7 @@ uses
           p:=tai(srclist.First);
           if not assigned(p) then
             internalerror(2023100308);
-          if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_end_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate]) then
+          if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_end_legacy_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate]) then
             begin
               srclist.Remove(p);
               Done:=True;
@@ -1568,7 +1568,7 @@ uses
             tmp_asmlist.Concat(wasm_convert_first_item_to_structured(srclist));
         until Done;
         case taicpu(p).opcode of
-          a_end_try,a_legacy_catch,a_legacy_catch_all:
+          a_end_legacy_try,a_legacy_catch,a_legacy_catch_all:
             result:=tai_wasmstruc_try_catch.internal_create(taicpu(p),tmp_asmlist,srclist);
           a_legacy_delegate:
             result:=tai_wasmstruc_try_delegate.internal_create(taicpu(p),tmp_asmlist,srclist);
@@ -1629,7 +1629,7 @@ uses
             Done:=False;
             repeat
               pp:=tai(srclist.First);
-              if (pp.typ=ait_instruction) and (taicpu(pp).opcode in [a_legacy_catch,a_legacy_catch_all,a_end_try]) then
+              if (pp.typ=ait_instruction) and (taicpu(pp).opcode in [a_legacy_catch,a_legacy_catch_all,a_end_legacy_try]) then
                 Done:=True
               else
                 al.Concat(wasm_convert_first_item_to_structured(srclist));
@@ -1645,7 +1645,7 @@ uses
             Done:=False;
             repeat
               pp:=tai(srclist.First);
-              if (pp.typ=ait_instruction) and (taicpu(pp).opcode=a_end_try) then
+              if (pp.typ=ait_instruction) and (taicpu(pp).opcode=a_end_legacy_try) then
                 begin
                   srclist.Remove(pp);
                   Done:=True;
@@ -1678,7 +1678,7 @@ uses
                   parse_catch_all;
                   Done:=True;
                 end;
-              a_end_try:
+              a_end_legacy_try:
                 Done:=True;
               else
                 internalerror(2023100311);
@@ -1754,7 +1754,7 @@ uses
             l.Concat(taicpu.op_none(a_legacy_catch_all));
             l.concatList(catch_all_asmlist);
           end;
-        l.Concat(taicpu.op_none(a_end_try));
+        l.Concat(taicpu.op_none(a_end_legacy_try));
         if FLabelIsNew then
           l.concat(tai_label.create(FLabel));
       end;
@@ -2244,7 +2244,7 @@ uses
           a_end_block,
           a_end_if,
           a_end_loop,
-          a_end_try,
+          a_end_legacy_try,
           a_end_function,
           a_legacy_catch_all,
           a_ref_is_null:
@@ -3001,7 +3001,7 @@ uses
           a_end_block,
           a_end_if,
           a_end_loop,
-          a_end_try,
+          a_end_legacy_try,
           a_end_function:
             WriteByte($0B);
           a_legacy_catch_all:
@@ -3732,7 +3732,7 @@ uses
                   result:=tai_wasmstruc_loop.create_from(taicpu(result),srclist);
                 a_legacy_try:
                   result:=tai_wasmstruc_try.create_from(srclist);
-                a_else,a_end_if,a_end_block,a_end_loop,a_end_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate:
+                a_else,a_end_if,a_end_block,a_end_loop,a_end_legacy_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate:
                   internalerror(2023100503);
                 else
                   ;

+ 1 - 1
compiler/wasm32/cpubase.pas

@@ -100,7 +100,7 @@ uses
       a_i64_trunc_sat_f64_s,
       a_i64_trunc_sat_f64_u,
       // exceptions (legacy)
-      a_legacy_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate,a_legacy_throw,a_legacy_rethrow,a_end_try,
+      a_legacy_try,a_legacy_catch,a_legacy_catch_all,a_legacy_delegate,a_legacy_throw,a_legacy_rethrow,a_end_legacy_try,
       // atomic memory accesses - load/store
       a_i32_atomic_load8_u, a_i32_atomic_load16_u, a_i32_atomic_load,
       a_i64_atomic_load8_u, a_i64_atomic_load16_u, a_i64_atomic_load32_u,

+ 5 - 5
compiler/wasm32/cpupi.pas

@@ -577,7 +577,7 @@ implementation
                       a_end_block,
                       a_end_loop,
                       a_end_if,
-                      a_end_try:
+                      a_end_legacy_try:
                         begin
                           dec(cur_nesting_depth);
                           if cur_nesting_depth<0 then
@@ -587,7 +587,7 @@ implementation
                              ((cblock.blockstart.opcode=a_block) and (lastinstr.opcode<>a_end_block)) or
                              ((cblock.blockstart.opcode=a_loop) and (lastinstr.opcode<>a_end_loop)) or
                              ((cblock.blockstart.opcode=a_if) and (lastinstr.opcode<>a_end_if)) or
-                             ((cblock.blockstart.opcode=a_legacy_try) and (lastinstr.opcode<>a_end_try)) then
+                             ((cblock.blockstart.opcode=a_legacy_try) and (lastinstr.opcode<>a_end_legacy_try)) then
                             Message1(parser_f_unsupported_feature,'incompatible nesting level');
                           cblock.free;
                         end;
@@ -602,11 +602,11 @@ implementation
                     lbl.labsym.nestingdepth:=-1;
                     nextinstr:=FindNextInstruction(hp);
 
-                    if assigned(nextinstr) and (nextinstr.opcode in [a_end_block,a_end_try,a_end_if]) then
+                    if assigned(nextinstr) and (nextinstr.opcode in [a_end_block,a_end_legacy_try,a_end_if]) then
                       lbl.labsym.nestingdepth:=cur_nesting_depth
                     else if assigned(lastinstr) and (lastinstr.opcode=a_loop) then
                       lbl.labsym.nestingdepth:=cur_nesting_depth
-                    else if assigned(lastinstr) and (lastinstr.opcode in [a_end_block,a_end_try,a_end_if]) then
+                    else if assigned(lastinstr) and (lastinstr.opcode in [a_end_block,a_end_legacy_try,a_end_if]) then
                       lbl.labsym.nestingdepth:=cur_nesting_depth+1
                     else if assigned(nextinstr) and (nextinstr.opcode=a_loop) then
                       lbl.labsym.nestingdepth:=cur_nesting_depth+1;
@@ -646,7 +646,7 @@ implementation
                     a_end_block,
                     a_end_loop,
                     a_end_if,
-                    a_end_try:
+                    a_end_legacy_try:
                       begin
                         dec(cur_nesting_depth);
                         if cur_nesting_depth<0 then

+ 4 - 4
compiler/wasm32/nwasmflw.pas

@@ -588,7 +588,7 @@ implementation
 
                 hlcg.g_call_system_proc(current_asmdata.CurrAsmList,'fpc_raise_nested',[],nil).resetiftemp;
 
-                current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_try));
+                current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_legacy_try));
               end
             else
               begin
@@ -602,7 +602,7 @@ implementation
             doobjectdestroyandreraisestate.newflowcontrol:=afteronflowcontrol;
           end;
 
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_legacy_try));
 
       errorexit:
         { return all used control flow statements }
@@ -1135,7 +1135,7 @@ implementation
         current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,4)); // jump to the 'finally' section
 
         { exit the inner 'try..end_try' block }
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_legacy_try));
 
         { exit the 'continue' block }
         current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_block));
@@ -1566,7 +1566,7 @@ implementation
 
         hlcg.g_call_system_proc(current_asmdata.CurrAsmList,'fpc_raise_nested',[],nil).resetiftemp;
 
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_legacy_try));
 
         { clear some stuff }
         if assigned(exceptvarsym) then