@@ -62,70 +62,6 @@ var LibraryExceptions = {
6262 }
6363 } ,
6464
65- $CatchInfo__deps: [ '$ExceptionInfo' , '__cxa_is_pointer_type' ] ,
66- // This native structure is returned from __cxa_find_matching_catch, and serves as catching
67- // context, i.e. stores information required to proceed with a specific selected catch. It stores
68- // base and adjusted pointers of a thrown object. It is allocated dynamically and should be freed
69- // when it is done with a specific catch (i.e. either in __cxa_end_catch when caught or in
70- // __resumeException when no catch clause matched). The class itself is just a native pointer
71- // wrapper, and contains all the necessary accessors for the fields in the native structure.
72- // ptr - Native structure pointer to wrap, the structure is allocated when not specified.
73- $CatchInfo : function ( ptr ) {
74-
75- this . free = function ( ) {
76- _free ( this . ptr ) ;
77- this . ptr = 0 ;
78- } ;
79-
80- this . set_base_ptr = function ( basePtr ) {
81- { { { makeSetValue ( 'this.ptr' , '0' , 'basePtr' , '*' ) } } } ;
82- } ;
83-
84- this . get_base_ptr = function ( ) {
85- return { { { makeGetValue ( 'this.ptr' , '0' , '*' ) } } } ;
86- } ;
87-
88- this . set_adjusted_ptr = function ( adjustedPtr ) {
89- { { { makeSetValue ( 'this.ptr' , Runtime . POINTER_SIZE , 'adjustedPtr' , '*' ) } } } ;
90- } ;
91-
92- this . get_adjusted_ptr_addr = function ( ) {
93- return this . ptr + { { { Runtime . POINTER_SIZE } } } ;
94- }
95-
96- this . get_adjusted_ptr = function ( ) {
97- return { { { makeGetValue ( 'this.ptr' , Runtime . POINTER_SIZE , '*' ) } } } ;
98- } ;
99-
100- // Get pointer which is expected to be received by catch clause in C++ code. It may be adjusted
101- // when the pointer is casted to some of the exception object base classes (e.g. when virtual
102- // inheritance is used). When a pointer is thrown this method should return the thrown pointer
103- // itself.
104- this . get_exception_ptr = function ( ) {
105- // Work around a fastcomp bug, this code is still included for some reason in a build without
106- // exceptions support.
107- var isPointer = { { { exportedAsmFunc ( '___cxa_is_pointer_type' ) } } } (
108- this . get_exception_info ( ) . get_type ( ) ) ;
109- if ( isPointer ) {
110- return { { { makeGetValue ( 'this.get_base_ptr()' , '0' , '*' ) } } } ;
111- }
112- var adjusted = this . get_adjusted_ptr ( ) ;
113- if ( adjusted !== 0 ) return adjusted ;
114- return this . get_base_ptr ( ) ;
115- } ;
116-
117- this . get_exception_info = function ( ) {
118- return new ExceptionInfo ( this . get_base_ptr ( ) ) ;
119- } ;
120-
121- if ( ptr === undefined ) {
122- this . ptr = _malloc ( { { { Runtime . POINTER_SIZE * 2 } } } ) ;
123- this . set_adjusted_ptr ( 0 ) ;
124- } else {
125- this . ptr = ptr ;
126- }
127- } ,
128-
12965 // Here, we throw an exception after recording a couple of values that we need to remember
13066 // We also remember that it was the last exception thrown as we need to know that later.
13167 __cxa_throw__sig: 'viii' ,
@@ -175,25 +111,6 @@ var LibraryExceptions = {
175111 return type ;
176112 } ,
177113
178- __cxa_begin_catch__deps : [ '$CatchInfo' , '$exceptionCaught' ,
179- '$uncaughtExceptionCount' ,
180- '__cxa_increment_exception_refcount' ] ,
181- __cxa_begin_catch : function ( ptr ) {
182- var catchInfo = new CatchInfo ( ptr ) ;
183- var info = catchInfo . get_exception_info ( ) ;
184- if ( ! info . get_caught ( ) ) {
185- info . set_caught ( true ) ;
186- uncaughtExceptionCount -- ;
187- }
188- info . set_rethrown ( false ) ;
189- exceptionCaught . push ( catchInfo ) ;
190- #if EXCEPTION_DEBUG
191- err ( 'cxa_begin_catch ' + [ ptr , 'stack' , exceptionCaught ] ) ;
192- #endif
193- ___cxa_increment_exception_refcount ( catchInfo . get_base_ptr ( ) ) ;
194- return catchInfo . get_exception_ptr ( ) ;
195- } ,
196-
197114 // We're done with a catch. Now, we can run the destructor if there is one
198115 // and free the exception. Note that if the dynCall on the destructor fails
199116 // due to calling apply on undefined, that means that the destructor is
0 commit comments