浏览代码

+ added target flags for the different WebAssembly exception modes that I'm
planning to implement

Nikolay Nikolov 4 年之前
父节点
当前提交
eda6b105b7
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      compiler/globtype.pas

+ 12 - 2
compiler/globtype.pas

@@ -310,7 +310,14 @@ interface
            allows Windows to move code segments around (in order to defragment
            allows Windows to move code segments around (in order to defragment
            memory) and then walk through the stacks of all running programs and
            memory) and then walk through the stacks of all running programs and
            update the segment values of the segment that has moved. }
            update the segment values of the segment that has moved. }
-         ts_x86_far_procs_push_odd_bp
+         ts_x86_far_procs_push_odd_bp,
+         { no exception support. Raising an exception will abort the program. }
+         ts_wasm_no_exceptions,
+         { JavaScript-based exception support }
+         ts_wasm_js_exceptions,
+         { native WebAssembly exceptions support:
+           https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md }
+         ts_wasm_native_exceptions
        );
        );
        ttargetswitches = set of ttargetswitch;
        ttargetswitches = set of ttargetswitch;
 
 
@@ -436,7 +443,10 @@ interface
          (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ; define: ''),
          (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ; define: ''),
          (name: 'INITLOCALS';          hasvalue: false; isglobal: true ; define: ''),
          (name: 'INITLOCALS';          hasvalue: false; isglobal: true ; define: ''),
          (name: 'CLD';                 hasvalue: false; isglobal: true ; define: 'FPC_ENABLED_CLD'),
          (name: 'CLD';                 hasvalue: false; isglobal: true ; define: 'FPC_ENABLED_CLD'),
-         (name: 'FARPROCSPUSHODDBP';   hasvalue: false; isglobal: false; define: 'FPC_FAR_PROCS_PUSH_ODD_BP')
+         (name: 'FARPROCSPUSHODDBP';   hasvalue: false; isglobal: false; define: 'FPC_FAR_PROCS_PUSH_ODD_BP'),
+         (name: 'NOEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_NO_EXCEPTIONS'),
+         (name: 'JSEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_JS_EXCEPTIONS'),
+         (name: 'WASMEXCEPTIONS';      hasvalue: false; isglobal: true ; define: 'FPC_WASM_NATIVE_EXCEPTIONS')
        );
        );
 
 
        { switches being applied to all CPUs at the given level }
        { switches being applied to all CPUs at the given level }