瀏覽代碼

* removed the JSEXCEPTIONS WebAssembly exceptions mode. It was never completed
and was made obsolete by the other exceptions modes, so it's unlikely it will
ever be implemented.

Nikolay Nikolov 1 天之前
父節點
當前提交
1961de4ce0
共有 6 個文件被更改,包括 2 次插入83 次删除
  1. 0 4
      compiler/fppu.pas
  2. 0 3
      compiler/globtype.pas
  3. 1 2
      compiler/msg/errore.msg
  4. 1 2
      compiler/options.pas
  5. 0 47
      compiler/wasm32/cpupi.pas
  6. 0 25
      compiler/wasm32/nwasmflw.pas

+ 0 - 4
compiler/fppu.pas

@@ -394,8 +394,6 @@ var
               (ts_wasm_no_exceptions in current_settings.targetswitches)) or
              ((mf_wasm_bf_exceptions in moduleflags) <>
               (ts_wasm_bf_exceptions in current_settings.targetswitches)) or
-             ((mf_wasm_js_exceptions in moduleflags) <>
-              (ts_wasm_js_exceptions in current_settings.targetswitches)) or
              ((mf_wasm_native_exceptions in moduleflags) <>
               (ts_wasm_native_legacy_exceptions in current_settings.targetswitches)) then
             begin
@@ -1123,8 +1121,6 @@ var
           include(moduleflags,mf_wasm_no_exceptions);
         if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
           include(moduleflags,mf_wasm_native_exceptions);
-        if ts_wasm_js_exceptions in current_settings.targetswitches then
-          include(moduleflags,mf_wasm_js_exceptions);
         if ts_wasm_bf_exceptions in current_settings.targetswitches then
           include(moduleflags,mf_wasm_bf_exceptions);
         if ts_wasm_threads in current_settings.targetswitches then

+ 0 - 3
compiler/globtype.pas

@@ -327,8 +327,6 @@ interface
          ts_wasm_no_exceptions,
          { Branchful exceptions support. A global threadvar is checked after each function call. }
          ts_wasm_bf_exceptions,
-         { JavaScript-based exception support }
-         ts_wasm_js_exceptions,
          { WebAssembly legacy exceptions support:
            https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/legacy/Exceptions.md }
          ts_wasm_native_legacy_exceptions,
@@ -475,7 +473,6 @@ interface
          (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: 'BFEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_BRANCHFUL_EXCEPTIONS'),
-         (name: 'JSEXCEPTIONS';        hasvalue: false; isglobal: true ; define: 'FPC_WASM_JS_EXCEPTIONS'),
          (name: 'WASMEXCEPTIONS';      hasvalue: false; isglobal: true ; define: 'FPC_WASM_NATIVE_EXCEPTIONS'),
          (name: 'WASMTHREADS';         hasvalue: false; isglobal: true ; define: 'FPC_WASM_THREADS'),
          (name: 'SATURATINGFLOATTOINT';hasvalue: false; isglobal: false; define: 'FPC_WASM_SATURATING_FLOAT_TO_INT')

+ 1 - 2
compiler/msg/errore.msg

@@ -3728,7 +3728,7 @@ option_valgrind_heaptrc_mismatch=11062_E_You can not use both options ($1) ($2)
 option_unsupported_fpu=11063_F_The selected FPU type "$1" is not supported by the selected instruction set "$2"
 % Not all instruction sets support all FPU types. For example on ARM, Thumb(-1) supports no FPU/VFP instruction set
 option_too_many_exception_modes=11064_E_Only one WebAssembly exception support mode can be specified.
-% Only one WebAssembly exception support mode (NOEXCEPTIONS, JSEXCEPTIONS, BFEXCEPTIONS or NATIVEEXCEPTIONS) can be specified.
+% Only one WebAssembly exception support mode (NOEXCEPTIONS, BFEXCEPTIONS or NATIVEEXCEPTIONS) can be specified.
 option_subtarget_is_already_set=11065_W_Subtarget is already set to: $1
 % Displayed if more than one \var{-t} option is specified.
 option_subtarget_config_not_found=11066_E_Subtarget $1 specified but no corresponding config file $2 found.
@@ -4161,7 +4161,6 @@ J*3CTlowercaseprocstart_  Lowercase the first character of procedure/function/me
 A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possible
 W*3CTnoexceptions_        Disable the exception support. Raising an exception will abort the program.
 W*3CTbfexceptions_        Enable the branchful exception support for WebAssembly
-W*3CTjsexceptions_        Enable the JavaScript-based exception support for WebAssembly (experimental)
 W*3CTwasmexceptions_      Enable the native WebAssembly exceptions support
 W*3CTwasmthreads_         Enable WebAssembly threads support (experimental)
 W*3CTsaturatingfloattoint_ Use saturating (non-trapping) float-to-int conversion instructions

+ 1 - 2
compiler/options.pas

@@ -2239,7 +2239,6 @@ procedure TOption.CheckOptionsCompatibility;
 begin
 {$ifdef wasm}
   if (Ord(ts_wasm_no_exceptions in init_settings.targetswitches)+
-      Ord(ts_wasm_js_exceptions in init_settings.targetswitches)+
       Ord(ts_wasm_native_legacy_exceptions in init_settings.targetswitches)+
       Ord(ts_wasm_bf_exceptions in init_settings.targetswitches))>1 then
     begin
@@ -5664,7 +5663,7 @@ begin
 {$endif m68k}
 {$ifdef wasm}
   { if no explicit exception handling mode is set for WebAssembly, assume no exceptions }
-  if init_settings.targetswitches*[ts_wasm_no_exceptions,ts_wasm_js_exceptions,ts_wasm_native_legacy_exceptions,ts_wasm_bf_exceptions]=[] then
+  if init_settings.targetswitches*[ts_wasm_no_exceptions,ts_wasm_native_legacy_exceptions,ts_wasm_bf_exceptions]=[] then
     begin
       def_system_macro(TargetSwitchStr[ts_wasm_no_exceptions].define);
       include(init_settings.targetswitches,ts_wasm_no_exceptions);

+ 0 - 47
compiler/wasm32/cpupi.pas

@@ -121,51 +121,6 @@ implementation
         list.Concat(tai_comment.Create(strpnew('TODO: handle_nested_exception')));
       end;
 
-{*****************************************************************************
-                     twasmexceptionstatehandler_jsexceptions
-*****************************************************************************}
-
-    type
-      twasmexceptionstatehandler_jsexceptions = class(tcgexceptionstatehandler)
-        class procedure get_exception_temps(list:TAsmList;var t:texceptiontemps); override;
-        class procedure unget_exception_temps(list:TAsmList;const t:texceptiontemps); override;
-        class procedure new_exception(list:TAsmList;const t:texceptiontemps; const exceptframekind: texceptframekind; out exceptstate: texceptionstate); override;
-        class procedure free_exception(list: TAsmList; const t: texceptiontemps; const s: texceptionstate; a: aint; endexceptlabel: tasmlabel; onlyfree:boolean); override;
-        class procedure handle_nested_exception(list:TAsmList;var t:texceptiontemps;var entrystate: texceptionstate); override;
-      end;
-
-    class procedure twasmexceptionstatehandler_jsexceptions.get_exception_temps(list:TAsmList;var t:texceptiontemps);
-      begin
-        if not assigned(exceptionreasontype) then
-          exceptionreasontype:=search_system_proc('fpc_setjmp').returndef;
-        reference_reset(t.envbuf,0,[]);
-        reference_reset(t.jmpbuf,0,[]);
-        tg.gethltemp(list,exceptionreasontype,exceptionreasontype.size,tt_persistent,t.reasonbuf);
-      end;
-
-    class procedure twasmexceptionstatehandler_jsexceptions.unget_exception_temps(list:TAsmList;const t:texceptiontemps);
-      begin
-        tg.ungettemp(list,t.reasonbuf);
-      end;
-
-    class procedure twasmexceptionstatehandler_jsexceptions.new_exception(list:TAsmList;const t:texceptiontemps; const exceptframekind: texceptframekind; out exceptstate: texceptionstate);
-      begin
-        exceptstate.exceptionlabel:=nil;
-        exceptstate.oldflowcontrol:=flowcontrol;
-        exceptstate.finallycodelabel:=nil;
-
-        flowcontrol:=[fc_inflowcontrol,fc_catching_exceptions];
-      end;
-
-    class procedure twasmexceptionstatehandler_jsexceptions.free_exception(list: TAsmList; const t: texceptiontemps; const s: texceptionstate; a: aint; endexceptlabel: tasmlabel; onlyfree:boolean);
-      begin
-      end;
-
-    class procedure twasmexceptionstatehandler_jsexceptions.handle_nested_exception(list:TAsmList;var t:texceptiontemps;var entrystate: texceptionstate);
-      begin
-        list.Concat(tai_comment.Create(strpnew('TODO: handle_nested_exception')));
-      end;
-
 {*****************************************************************************
                      twasmexceptionstatehandler_nativeexceptions
 *****************************************************************************}
@@ -463,8 +418,6 @@ implementation
       begin
         if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
           cexceptionstatehandler:=twasmexceptionstatehandler_nativeexceptions
-        else if ts_wasm_js_exceptions in current_settings.targetswitches then
-          cexceptionstatehandler:=twasmexceptionstatehandler_jsexceptions
         else if ts_wasm_no_exceptions in current_settings.targetswitches then
           cexceptionstatehandler:=twasmexceptionstatehandler_noexceptions
         else if ts_wasm_bf_exceptions in current_settings.targetswitches then

+ 0 - 25
compiler/wasm32/nwasmflw.pas

@@ -65,7 +65,6 @@ interface
       twasmtryexceptnode = class(tcgtryexceptnode)
       private
         procedure pass_generate_code_no_exceptions;
-        procedure pass_generate_code_js_exceptions;
         procedure pass_generate_code_native_exceptions;
         procedure pass_generate_code_bf_exceptions;
       public
@@ -77,7 +76,6 @@ interface
       twasmtryfinallynode = class(tcgtryfinallynode)
       private
         procedure pass_generate_code_no_exceptions;
-        procedure pass_generate_code_js_exceptions;
         procedure pass_generate_code_native_exceptions;
         procedure pass_generate_code_bf_exceptions;
       public
@@ -89,7 +87,6 @@ interface
       twasmonnode = class(tcgonnode)
       private
         procedure pass_generate_code_no_exceptions;
-        procedure pass_generate_code_js_exceptions;
         procedure pass_generate_code_native_exceptions;
         procedure pass_generate_code_bf_exceptions;
       public
@@ -427,11 +424,6 @@ implementation
         secondpass(left);
       end;
 
-    procedure twasmtryexceptnode.pass_generate_code_js_exceptions;
-      begin
-        internalerror(2021091706);
-      end;
-
     procedure twasmtryexceptnode.pass_generate_code_native_exceptions;
       var
         trystate,doobjectdestroyandreraisestate: tcgexceptionstatehandler.texceptionstate;
@@ -816,8 +808,6 @@ implementation
       begin
         if ts_wasm_no_exceptions in current_settings.targetswitches then
           pass_generate_code_no_exceptions
-        else if ts_wasm_js_exceptions in current_settings.targetswitches then
-          pass_generate_code_js_exceptions
         else if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
           pass_generate_code_native_exceptions
         else if ts_wasm_bf_exceptions in current_settings.targetswitches then
@@ -1002,11 +992,6 @@ implementation
         flowcontrol:=finallyexceptionstate.oldflowcontrol+(finallyexceptionstate.newflowcontrol-[fc_inflowcontrol,fc_catching_exceptions]);
       end;
 
-    procedure twasmtryfinallynode.pass_generate_code_js_exceptions;
-      begin
-        internalerror(2021091702);
-      end;
-
     procedure twasmtryfinallynode.pass_generate_code_native_exceptions;
       var
         exitfinallylabel,
@@ -1415,8 +1400,6 @@ implementation
       begin
         if ts_wasm_no_exceptions in current_settings.targetswitches then
           pass_generate_code_no_exceptions
-        else if ts_wasm_js_exceptions in current_settings.targetswitches then
-          pass_generate_code_js_exceptions
         else if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
           pass_generate_code_native_exceptions
         else if ts_wasm_bf_exceptions in current_settings.targetswitches then
@@ -1435,12 +1418,6 @@ implementation
         internalerror(2021092803);
       end;
 
-    procedure twasmonnode.pass_generate_code_js_exceptions;
-      begin
-        { not yet implemented }
-        internalerror(2021092804);
-      end;
-
     procedure twasmonnode.pass_generate_code_native_exceptions;
       var
         exceptvarsym : tlocalvarsym;
@@ -1743,8 +1720,6 @@ implementation
       begin
         if ts_wasm_no_exceptions in current_settings.targetswitches then
           pass_generate_code_no_exceptions
-        else if ts_wasm_js_exceptions in current_settings.targetswitches then
-          pass_generate_code_js_exceptions
         else if ts_wasm_native_legacy_exceptions in current_settings.targetswitches then
           pass_generate_code_native_exceptions
         else if ts_wasm_bf_exceptions in current_settings.targetswitches then