@@ -70,7 +70,7 @@ extern "C" EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD,
70
70
+------------------+--+-----+-----+------------------------+--------------------------+
71
71
| callSiteTableLength | (ULEB128) | Call Site Table length, used to find Action table |
72
72
+---------------------+-----------+---------------------------------------------------+
73
- #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__ )
73
+ #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__ )
74
74
+---------------------+-----------+------------------------------------------------+
75
75
| Beginning of Call Site Table The current ip lies within the |
76
76
| ... (start, length) range of one of these |
@@ -84,7 +84,7 @@ extern "C" EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD,
84
84
| +-------------+---------------------------------+------------------------------+ |
85
85
| ... |
86
86
+----------------------------------------------------------------------------------+
87
- #else // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
87
+ #else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
88
88
+---------------------+-----------+------------------------------------------------+
89
89
| Beginning of Call Site Table The current ip is a 1-based index into |
90
90
| ... this table. Or it is -1 meaning no |
@@ -97,7 +97,7 @@ extern "C" EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD,
97
97
| +-------------+---------------------------------+------------------------------+ |
98
98
| ... |
99
99
+----------------------------------------------------------------------------------+
100
- #endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
100
+ #endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
101
101
+---------------------------------------------------------------------+
102
102
| Beginning of Action Table ttypeIndex == 0 : cleanup |
103
103
| ... ttypeIndex > 0 : catch |
547
547
set_registers (_Unwind_Exception* unwind_exception, _Unwind_Context* context,
548
548
const scan_results& results)
549
549
{
550
- #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__ )
550
+ #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__ )
551
551
#define __builtin_eh_return_data_regno (regno ) regno
552
552
#elif defined(__ibmxl__)
553
553
// IBM xlclang++ compiler does not support __builtin_eh_return_data_regno.
@@ -642,7 +642,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
642
642
// Get beginning current frame's code (as defined by the
643
643
// emitted dwarf code)
644
644
uintptr_t funcStart = _Unwind_GetRegionStart (context);
645
- #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__ )
645
+ #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__ )
646
646
if (ip == uintptr_t (-1 ))
647
647
{
648
648
// no action
@@ -652,9 +652,9 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
652
652
else if (ip == 0 )
653
653
call_terminate (native_exception, unwind_exception);
654
654
// ip is 1-based index into call site table
655
- #else // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
655
+ #else // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
656
656
uintptr_t ipOffset = ip - funcStart;
657
- #endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
657
+ #endif // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
658
658
const uint8_t * classInfo = NULL ;
659
659
// Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
660
660
// dwarf emission
@@ -675,7 +675,7 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
675
675
// Walk call-site table looking for range that
676
676
// includes current PC.
677
677
uint8_t callSiteEncoding = *lsda++;
678
- #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__USING_WASM_EXCEPTIONS__ )
678
+ #if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__ )
679
679
(void )callSiteEncoding; // When using SjLj/Wasm exceptions, callSiteEncoding is never used
680
680
#endif
681
681
uint32_t callSiteTableLength = static_cast <uint32_t >(readULEB128 (&lsda));
@@ -686,33 +686,33 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
686
686
while (callSitePtr < callSiteTableEnd)
687
687
{
688
688
// There is one entry per call site.
689
- #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__ )
689
+ #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__ )
690
690
// The call sites are non-overlapping in [start, start+length)
691
691
// The call sites are ordered in increasing value of start
692
692
uintptr_t start = readEncodedPointer (&callSitePtr, callSiteEncoding);
693
693
uintptr_t length = readEncodedPointer (&callSitePtr, callSiteEncoding);
694
694
uintptr_t landingPad = readEncodedPointer (&callSitePtr, callSiteEncoding);
695
695
uintptr_t actionEntry = readULEB128 (&callSitePtr);
696
696
if ((start <= ipOffset) && (ipOffset < (start + length)))
697
- #else // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
697
+ #else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
698
698
// ip is 1-based index into this table
699
699
uintptr_t landingPad = readULEB128 (&callSitePtr);
700
700
uintptr_t actionEntry = readULEB128 (&callSitePtr);
701
701
if (--ip == 0 )
702
- #endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
702
+ #endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
703
703
{
704
704
// Found the call site containing ip.
705
- #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__ )
705
+ #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__ )
706
706
if (landingPad == 0 )
707
707
{
708
708
// No handler here
709
709
results.reason = _URC_CONTINUE_UNWIND;
710
710
return ;
711
711
}
712
712
landingPad = (uintptr_t )lpStart + landingPad;
713
- #else // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
713
+ #else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
714
714
++landingPad;
715
- #endif // __USING_SJLJ_EXCEPTIONS__ || __USING_WASM_EXCEPTIONS__
715
+ #endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
716
716
results.landingPad = landingPad;
717
717
if (actionEntry == 0 )
718
718
{
@@ -838,15 +838,15 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
838
838
action += actionOffset;
839
839
} // there is no break out of this loop, only return
840
840
}
841
- #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__USING_WASM_EXCEPTIONS__ )
841
+ #if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__ )
842
842
else if (ipOffset < start)
843
843
{
844
844
// There is no call site for this ip
845
845
// Something bad has happened. We should never get here.
846
846
// Possible stack corruption.
847
847
call_terminate (native_exception, unwind_exception);
848
848
}
849
- #endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
849
+ #endif // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
850
850
} // there might be some tricky cases which break out of this loop
851
851
852
852
// It is possible that no eh table entry specify how to handle
@@ -903,7 +903,7 @@ _UA_CLEANUP_PHASE
903
903
*/
904
904
905
905
#if !defined(_LIBCXXABI_ARM_EHABI)
906
- #ifdef __USING_WASM_EXCEPTIONS__
906
+ #ifdef __WASM_EXCEPTIONS__
907
907
_Unwind_Reason_Code __gxx_personality_wasm0
908
908
#elif defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
909
909
static _Unwind_Reason_Code __gxx_personality_imp
@@ -972,7 +972,7 @@ __gxx_personality_v0
972
972
exc->languageSpecificData = results.languageSpecificData ;
973
973
exc->catchTemp = reinterpret_cast <void *>(results.landingPad );
974
974
exc->adjustedPtr = results.adjustedPtr ;
975
- #ifdef __USING_WASM_EXCEPTIONS__
975
+ #ifdef __WASM_EXCEPTIONS__
976
976
// Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the
977
977
// results here.
978
978
set_registers (unwind_exception, context, results);
0 commit comments