Browse Source

+ added the new WebAssembly instructions, added by the exception handling proposal

Nikolay Nikolov 3 years ago
parent
commit
10d8332563
3 changed files with 9 additions and 3 deletions
  1. 3 1
      compiler/wasm32/cpubase.pas
  2. 3 1
      compiler/wasm32/itcpugas.pas
  3. 3 1
      compiler/wasm32/strinst.inc

+ 3 - 1
compiler/wasm32/cpubase.pas

@@ -83,7 +83,9 @@ uses
       a_i32_load8_u, a_i32_load16_u, a_i64_load8_u, a_i64_load16_u, a_i64_load32_u,
       a_i32_load8_u, a_i32_load16_u, a_i64_load8_u, a_i64_load16_u, a_i64_load32_u,
       a_i32_store8, a_i32_store16, a_i64_store8, a_i64_store16, a_i64_store32,
       a_i32_store8, a_i32_store16, a_i64_store8, a_i64_store16, a_i64_store32,
       // additional memory
       // additional memory
-      a_memory_grow, a_memory_size
+      a_memory_grow, a_memory_size,
+      // exceptions
+      a_try,a_catch,a_catch_all,a_delegate,a_throw,a_rethrow,a_end_try
       );
       );
 
 
       TWasmBasicType = (wbt_i32, wbt_i64, wbt_f32, wbt_f64);
       TWasmBasicType = (wbt_i32, wbt_i64, wbt_f32, wbt_f64);

+ 3 - 1
compiler/wasm32/itcpugas.pas

@@ -82,7 +82,9 @@ interface
       'i32.load8_u', 'i32.load16_u', 'i64.load8_u', 'i64.load16_u', 'i64.load32_u',
       'i32.load8_u', 'i32.load16_u', 'i64.load8_u', 'i64.load16_u', 'i64.load32_u',
       'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
       'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
       // additional memory
       // additional memory
-      'memory.grow 0', 'memory.size 0'
+      'memory.grow 0', 'memory.size 0',
+      // exceptions
+      'try','catch','catch_all','delegate','throw','rethrow','end_try'
     );
     );
 
 
     gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
     gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64');

+ 3 - 1
compiler/wasm32/strinst.inc

@@ -66,5 +66,7 @@
         'i32.load8_u', 'i32.load16_u', 'i64.load8_u', 'i64.load16_u', 'i64.load32_u',
         'i32.load8_u', 'i32.load16_u', 'i64.load8_u', 'i64.load16_u', 'i64.load32_u',
         'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
         'i32.store8', 'i32.store16', 'i64.store8', 'i64.store16', 'i64.store32',
         // additional memory
         // additional memory
-        'grow_memory', 'current_memory'
+        'grow_memory', 'current_memory',
+        // exceptions
+        'try','catch','catch_all','delegate','throw','rethrow','end'