Ignore:
Timestamp:
Jan 20, 2021, 5:27:42 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

incorporate uw-thesis macros and CFA common macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/features.tex

    r79e261b7 rf28fdee  
    5454returns a reference to the virtual table instance. Defining this function
    5555also 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 the
     56and promises that @exceptT@ is a virtual type and a child of the
    5757base exception type.
    5858
    59 One odd thing about \codeCFA{get_exception_vtable} is that it should always
     59One odd thing about @get_exception_vtable@ is that it should always
    6060be a constant function, returning the same value regardless of its argument.
    6161A pointer or reference to the virtual table instance could be used instead,
     
    6666
    6767Also note the use of the word ``promise" in the trait description. \CFA
    68 cannot currently check to see if either \codeCFA{exceptT} or
    69 \codeCFA{virtualT} match the layout requirements. Currently this is
    70 considered part of \codeCFA{get_exception_vtable}'s correct implementation.
     68cannot currently check to see if either @exceptT@ or
     69@virtualT@ match the layout requirements. Currently this is
     70considered part of @get_exception_vtable@'s correct implementation.
    7171
    7272\begin{lstlisting}
     
    9292
    9393Finally 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}.
     94these traits. They are @IS_EXCEPTION@,
     95@IS_TERMINATION_EXCEPTION@ and @IS_RESUMPTION_EXCEPTION@.
    9696Each takes the virtual type's name and, for polymorphic types only, the
    9797parenthesized list of polymorphic arguments. These do the name mangling to
     
    113113The expression must evaluate to a reference to a termination exception. A
    114114termination exception is any exception with a
    115 \codeCFA{void defaultTerminationHandler(T &);} (the default handler) defined
     115@void defaultTerminationHandler(T &);@ (the default handler) defined
    116116on it. The handler is taken from the call sight with \CFA's trait system and
    117117passed into the exception system along with the exception itself.
     
    169169
    170170You 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.
    172172This can be done in a handler or any function that could be called from a
    173173handler.
     
    193193The result of EXPRESSION must be a resumption exception type. A resumption
    194194exception type is any type that satisfies the assertion
    195 \codeCFA{void defaultResumptionHandler(T &);} (the default handler). When the
     195@void defaultResumptionHandler(T &);@ (the default handler). When the
    196196statement is executed the expression is evaluated and the result is thrown.
    197197
     
    260260\paragraph{Re-Throwing}
    261261
    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.
     262You may also re-throw resumptions with a @throwResume;@ statement.
     263This can only be done from inside of a @catchResume@ block.
    264264
    265265Outside of any side effects of any code already run in the handler this will
     
    269269\section{Finally Clauses}
    270270
    271 A \codeCFA{finally} clause may be placed at the end of a try statement after
     271A @finally@ clause may be placed at the end of a try statement after
    272272all the handler clauses. In the simply case, with no handlers, it looks like
    273273this:
     
    294294
    295295Because 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 leave
     296The compiler rejects uses of @break@, @continue@,
     297@fallthru@ and @return@ that would cause control to leave
    298298the finally block. Other ways to leave the finally block - such as a long
    299299jump or termination - are much harder to check, at best requiring additional
     
    307307
    308308There is no special statement for starting a cancellation, instead you call
    309 the standard library function \codeCFA{cancel\_stack} which takes an exception.
     309the standard library function @cancel\_stack@ which takes an exception.
    310310Unlike in a throw this exception is not used in control flow but is just there
    311311to pass information about why the cancellation happened.
     
    323323
    324324\item Thread Stack:
    325 Thread stacks are those created \codeCFA{thread} or otherwise satisfy the
    326 \codeCFA{is\_thread} trait.
     325Thread stacks are those created @thread@ or otherwise satisfy the
     326@is\_thread@ trait.
    327327
    328328Threads only have two structural points of communication that must happen,
     
    333333and wait for another thread to join with it. The other thread, when it joins,
    334334checks 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
     337There is a difference here in how explicate joins (with the @join@
    338338function) and implicate joins (from a destructor call). Explicate joins will
    339 take the default handler (\codeCFA{defaultResumptionHandler}) from the context
     339take the default handler (@defaultResumptionHandler@) from the context
    340340and use like a regular through does if the exception is not caught. The
    341341implicate join does a program abort instead.
     
    349349
    350350\item Coroutine Stack:
    351 Coroutine stacks are those created with \codeCFA{coroutine} or otherwise
    352 satisfy the \codeCFA{is\_coroutine} trait.
     351Coroutine stacks are those created with @coroutine@ or otherwise
     352satisfy the @is\_coroutine@ trait.
    353353
    354354A coroutine knows of two other coroutines, its starter and its last resumer.
     
    356356
    357357After the stack is unwound control goes to the last resumer.
    358 Resume will resume throw a \codeCFA{CoroutineCancelled} exception, which is
     358Resume will resume throw a @CoroutineCancelled@ exception, which is
    359359polymorphic over the coroutine type and has a pointer to the coroutine being
    360360canceled and the canceling exception. The resume function also has an
    361 assertion that the \codeCFA{defaultResumptionHandler} for the exception. So it
     361assertion that the @defaultResumptionHandler@ for the exception. So it
    362362will use the default handler like a regular throw.
    363363
Note: See TracChangeset for help on using the changeset viewer.