Changeset f28fdee for doc/theses/andrew_beach_MMath/features.tex
- Timestamp:
- Jan 20, 2021, 5:27:42 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 09ee131
- Parents:
- 79e261b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/features.tex
r79e261b7 rf28fdee 54 54 returns a reference to the virtual table instance. Defining this function 55 55 also establishes the virtual type and virtual table pair to the resolver 56 and promises that \codeCFA{exceptT}is a virtual type and a child of the56 and promises that @exceptT@ is a virtual type and a child of the 57 57 base exception type. 58 58 59 One odd thing about \codeCFA{get_exception_vtable}is that it should always59 One odd thing about @get_exception_vtable@ is that it should always 60 60 be a constant function, returning the same value regardless of its argument. 61 61 A pointer or reference to the virtual table instance could be used instead, … … 66 66 67 67 Also note the use of the word ``promise" in the trait description. \CFA 68 cannot currently check to see if either \codeCFA{exceptT}or69 \codeCFA{virtualT}match the layout requirements. Currently this is70 considered part of \codeCFA{get_exception_vtable}'s correct implementation.68 cannot currently check to see if either @exceptT@ or 69 @virtualT@ match the layout requirements. Currently this is 70 considered part of @get_exception_vtable@'s correct implementation. 71 71 72 72 \begin{lstlisting} … … 92 92 93 93 Finally there are three additional macros that can be used to refer to the 94 these traits. They are \codeCFA{IS_EXCEPTION},95 \codeCFA{IS_TERMINATION_EXCEPTION} and \codeCFA{IS_RESUMPTION_EXCEPTION}.94 these traits. They are @IS_EXCEPTION@, 95 @IS_TERMINATION_EXCEPTION@ and @IS_RESUMPTION_EXCEPTION@. 96 96 Each takes the virtual type's name and, for polymorphic types only, the 97 97 parenthesized list of polymorphic arguments. These do the name mangling to … … 113 113 The expression must evaluate to a reference to a termination exception. A 114 114 termination exception is any exception with a 115 \codeCFA{void defaultTerminationHandler(T &);}(the default handler) defined115 @void defaultTerminationHandler(T &);@ (the default handler) defined 116 116 on it. The handler is taken from the call sight with \CFA's trait system and 117 117 passed into the exception system along with the exception itself. … … 169 169 170 170 You can also re-throw the most recent termination exception with 171 \codeCFA{throw;}. % This is terrible and you should never do it.171 @throw;@. % This is terrible and you should never do it. 172 172 This can be done in a handler or any function that could be called from a 173 173 handler. … … 193 193 The result of EXPRESSION must be a resumption exception type. A resumption 194 194 exception type is any type that satisfies the assertion 195 \codeCFA{void defaultResumptionHandler(T &);}(the default handler). When the195 @void defaultResumptionHandler(T &);@ (the default handler). When the 196 196 statement is executed the expression is evaluated and the result is thrown. 197 197 … … 260 260 \paragraph{Re-Throwing} 261 261 262 You may also re-throw resumptions with a \codeCFA{throwResume;}statement.263 This can only be done from inside of a \codeCFA{catchResume}block.262 You may also re-throw resumptions with a @throwResume;@ statement. 263 This can only be done from inside of a @catchResume@ block. 264 264 265 265 Outside of any side effects of any code already run in the handler this will … … 269 269 \section{Finally Clauses} 270 270 271 A \codeCFA{finally}clause may be placed at the end of a try statement after271 A @finally@ clause may be placed at the end of a try statement after 272 272 all the handler clauses. In the simply case, with no handlers, it looks like 273 273 this: … … 294 294 295 295 Because of this local control flow out of the finally block is forbidden. 296 The compiler rejects uses of \codeCFA{break}, \codeCFA{continue},297 \codeCFA{fallthru} and \codeCFA{return}that would cause control to leave296 The compiler rejects uses of @break@, @continue@, 297 @fallthru@ and @return@ that would cause control to leave 298 298 the finally block. Other ways to leave the finally block - such as a long 299 299 jump or termination - are much harder to check, at best requiring additional … … 307 307 308 308 There is no special statement for starting a cancellation, instead you call 309 the standard library function \codeCFA{cancel\_stack}which takes an exception.309 the standard library function @cancel\_stack@ which takes an exception. 310 310 Unlike in a throw this exception is not used in control flow but is just there 311 311 to pass information about why the cancellation happened. … … 323 323 324 324 \item Thread Stack: 325 Thread stacks are those created \codeCFA{thread}or otherwise satisfy the326 \codeCFA{is\_thread}trait.325 Thread stacks are those created @thread@ or otherwise satisfy the 326 @is\_thread@ trait. 327 327 328 328 Threads only have two structural points of communication that must happen, … … 333 333 and wait for another thread to join with it. The other thread, when it joins, 334 334 checks for a cancellation. If so it will throw the resumption exception 335 \codeCFA{ThreadCancelled}.336 337 There is a difference here in how explicate joins (with the \codeCFA{join}335 @ThreadCancelled@. 336 337 There is a difference here in how explicate joins (with the @join@ 338 338 function) and implicate joins (from a destructor call). Explicate joins will 339 take the default handler ( \codeCFA{defaultResumptionHandler}) from the context339 take the default handler (@defaultResumptionHandler@) from the context 340 340 and use like a regular through does if the exception is not caught. The 341 341 implicate join does a program abort instead. … … 349 349 350 350 \item Coroutine Stack: 351 Coroutine stacks are those created with \codeCFA{coroutine}or otherwise352 satisfy the \codeCFA{is\_coroutine}trait.351 Coroutine stacks are those created with @coroutine@ or otherwise 352 satisfy the @is\_coroutine@ trait. 353 353 354 354 A coroutine knows of two other coroutines, its starter and its last resumer. … … 356 356 357 357 After the stack is unwound control goes to the last resumer. 358 Resume will resume throw a \codeCFA{CoroutineCancelled}exception, which is358 Resume will resume throw a @CoroutineCancelled@ exception, which is 359 359 polymorphic over the coroutine type and has a pointer to the coroutine being 360 360 canceled and the canceling exception. The resume function also has an 361 assertion that the \codeCFA{defaultResumptionHandler}for the exception. So it361 assertion that the @defaultResumptionHandler@ for the exception. So it 362 362 will use the default handler like a regular throw. 363 363
Note: See TracChangeset
for help on using the changeset viewer.