@@ -20,12 +20,9 @@ var LibraryExceptions = {
20
20
// reference counter) is not protected from that. Also protection is not enough, separate state
21
21
// should be allocated. libcxxabi has concept of dependent exception which is used for that
22
22
// purpose, it references the primary exception.
23
- $ExceptionInfo__deps : [
24
- '__cxa_is_pointer_type' ,
25
23
#if EXCEPTION_DEBUG
26
- '$ptrToString'
24
+ $ExceptionInfo__deps: [ '$ptrToString' ] ,
27
25
#endif
28
- ] ,
29
26
$ExceptionInfo : class {
30
27
// excPtr - Thrown object pointer to wrap. Metadata pointer is calculated from it.
31
28
constructor ( excPtr ) {
@@ -84,22 +81,6 @@ var LibraryExceptions = {
84
81
get_adjusted_ptr ( ) {
85
82
return { { { makeGetValue ( 'this.ptr' , C_STRUCTS . __cxa_exception . adjustedPtr , '*' ) } } } ;
86
83
}
87
-
88
- // Get pointer which is expected to be received by catch clause in C++ code. It may be adjusted
89
- // when the pointer is casted to some of the exception object base classes (e.g. when virtual
90
- // inheritance is used). When a pointer is thrown this method should return the thrown pointer
91
- // itself.
92
- get_exception_ptr ( ) {
93
- // Work around a fastcomp bug, this code is still included for some reason in a build without
94
- // exceptions support.
95
- var isPointer = ___cxa_is_pointer_type ( this . get_type ( ) ) ;
96
- if ( isPointer ) {
97
- return { { { makeGetValue ( 'this.excPtr' , '0' , '*' ) } } } ;
98
- }
99
- var adjusted = this . get_adjusted_ptr ( ) ;
100
- if ( adjusted !== 0 ) return adjusted ;
101
- return this . excPtr ;
102
- }
103
84
} ,
104
85
105
86
// Here, we throw an exception after recording a couple of values that we need to remember
@@ -146,6 +127,7 @@ var LibraryExceptions = {
146
127
147
128
#if ! DISABLE_EXCEPTION_CATCHING
148
129
__cxa_begin_catch__deps: [ '$exceptionCaught' , '__cxa_increment_exception_refcount' ,
130
+ '__cxa_get_exception_ptr' ,
149
131
'$uncaughtExceptionCount' ] ,
150
132
__cxa_begin_catch : ( ptr ) = > {
151
133
var info = new ExceptionInfo ( ptr ) ;
@@ -158,8 +140,8 @@ var LibraryExceptions = {
158
140
#if EXCEPTION_DEBUG
159
141
dbg ( '__cxa_begin_catch ' + [ ptrToString ( ptr ) , 'stack' , exceptionCaught ] ) ;
160
142
#endif
161
- ___cxa_increment_exception_refcount ( info . excPtr ) ;
162
- return info . get_exception_ptr ( ) ;
143
+ ___cxa_increment_exception_refcount ( ptr ) ;
144
+ return ___cxa_get_exception_ptr ( ptr ) ;
163
145
} ,
164
146
165
147
// We're done with a catch. Now, we can run the destructor if there is one
@@ -183,15 +165,6 @@ var LibraryExceptions = {
183
165
exceptionLast = 0 ; // XXX in decRef?
184
166
} ,
185
167
186
- __cxa_get_exception_ptr__deps : [ '$ExceptionInfo' ] ,
187
- __cxa_get_exception_ptr : ( ptr ) = > {
188
- var rtn = new ExceptionInfo ( ptr ) . get_exception_ptr ( ) ;
189
- #if EXCEPTION_DEBUG
190
- dbg ( '__cxa_get_exception_ptr ' + ptrToString ( ptr ) + ' -> ' + ptrToString ( rtn ) ) ;
191
- #endif
192
- return rtn ;
193
- } ,
194
-
195
168
__cxa_uncaught_exceptions__deps : [ '$uncaughtExceptionCount' ] ,
196
169
__cxa_uncaught_exceptions : ( ) = > uncaughtExceptionCount ,
197
170
0 commit comments