Browse Source

* WebAssembly: a_try instruction renamed a_legacy_try

Nikolay Nikolov 2 days ago
parent
commit
8c3758f976

+ 8 - 8
compiler/wasm32/aasmcpu.pas

@@ -1054,7 +1054,7 @@ uses
           a_if,
           a_block,
           a_loop,
-          a_try:
+          a_legacy_try:
             begin
               if a.opcode=a_if then
                 PopVal(wbt_i32);
@@ -1080,7 +1080,7 @@ uses
           a_catch:
             begin
               frame:=PopCtrl;
-              if (frame.opcode<>a_try) and (frame.opcode<>a_catch) then
+              if (frame.opcode<>a_legacy_try) and (frame.opcode<>a_catch) then
                 internalerror(2024022701);
               PushCtrl(a_catch,frame.start_types,frame.end_types);
             end;
@@ -1108,7 +1108,7 @@ uses
           a_end_try:
             begin
               frame:=PopCtrl;
-              if (frame.opcode<>a_try) and (frame.opcode<>a_catch) then
+              if (frame.opcode<>a_legacy_try) and (frame.opcode<>a_catch) then
                 internalerror(2024022702);
               PushVals(frame.end_types);
             end;
@@ -1604,7 +1604,7 @@ uses
 
     procedure tai_wasmstruc_try.ConvertToFlatList(l: TAsmList);
       begin
-        l.Concat(taicpu.op_none(A_TRY));
+        l.Concat(taicpu.op_none(a_legacy_try));
         l.concatList(try_asmlist);
       end;
 
@@ -2363,7 +2363,7 @@ uses
           a_block,
           a_loop,
           a_if,
-          a_try:
+          a_legacy_try:
             begin
               if ops=0 then
                 result:=2
@@ -3144,7 +3144,7 @@ uses
           a_block,
           a_loop,
           a_if,
-          a_try:
+          a_legacy_try:
             begin
               case opcode of
                 a_block:
@@ -3153,7 +3153,7 @@ uses
                   WriteByte($03);
                 a_if:
                   WriteByte($04);
-                a_try:
+                a_legacy_try:
                   WriteByte($06);
                 else
                   internalerror(2021092626);
@@ -3730,7 +3730,7 @@ uses
                   result:=tai_wasmstruc_block.create_from(taicpu(result),srclist);
                 a_loop:
                   result:=tai_wasmstruc_loop.create_from(taicpu(result),srclist);
-                a_try:
+                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_catch,a_catch_all,a_delegate:
                   internalerror(2023100503);

+ 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_try,a_catch,a_catch_all,a_delegate,a_throw,a_rethrow,a_end_try,
+      a_legacy_try,a_catch,a_catch_all,a_delegate,a_throw,a_rethrow,a_end_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,

+ 3 - 3
compiler/wasm32/cpupi.pas

@@ -558,7 +558,7 @@ implementation
                       a_block,
                       a_loop,
                       a_if,
-                      a_try:
+                      a_legacy_try:
                         begin
                           blockstack.Concat(twasmblockitem.create(lastinstr));
                           inc(cur_nesting_depth);
@@ -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_try) and (lastinstr.opcode<>a_end_try)) then
+                             ((cblock.blockstart.opcode=a_legacy_try) and (lastinstr.opcode<>a_end_try)) then
                             Message1(parser_f_unsupported_feature,'incompatible nesting level');
                           cblock.free;
                         end;
@@ -640,7 +640,7 @@ implementation
                     a_block,
                     a_loop,
                     a_if,
-                    a_try:
+                    a_legacy_try:
                       inc(cur_nesting_depth);
 
                     a_end_block,

+ 4 - 4
compiler/wasm32/nwasmflw.pas

@@ -464,7 +464,7 @@ implementation
 
         cexceptionstatehandler.new_exception(current_asmdata.CurrAsmList,excepttemps,tek_except,trystate);
 
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_legacy_try));
 
         { try block }
         secondpass(left);
@@ -512,7 +512,7 @@ implementation
                   flowcontrol+
                   afteronflowcontrol;
 
-                current_asmdata.CurrAsmList.concat(taicpu.op_none(a_try));
+                current_asmdata.CurrAsmList.concat(taicpu.op_none(a_legacy_try));
 
                 { the 'exit' block }
                 current_asmdata.CurrAsmList.concat(taicpu.op_none(a_block));
@@ -1110,7 +1110,7 @@ implementation
           end;
 
         { the inner 'try..end_try' block }
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_legacy_try));
 
         { try code }
         if assigned(left) then
@@ -1489,7 +1489,7 @@ implementation
         { in the case that another exception is risen
           we've to destroy the old one, so create a new
           exception frame for the catch-handler }
-        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_try));
+        current_asmdata.CurrAsmList.concat(taicpu.op_none(a_legacy_try));
 
         { the 'exit' block }
         current_asmdata.CurrAsmList.concat(taicpu.op_none(a_block));