Changeset 3b402339 for doc/theses/andrew_beach_MMath/features.tex

Ignore:
Timestamp:
Feb 2, 2021, 9:56:41 PM (2 years ago)
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3d67f83
Parents:
144fa5c (diff), 1c1c180 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
 r144fa5c Virtual types and casts are not required for a basic exception-system but are useful for advanced exception features. However, \CFA is not object-oriented so there is no obvious concept of virtuals.  Hence, to create advanced exception there is no obvious concept of virtuals. Hence, to create advanced exception features for this work, I needed to designed and implemented a virtual-like system for \CFA. \end{center} The hierarchy provides the ability to handle an exception at different degrees of specificity (left to right).  Hence, it is possible to catch a more general of specificity (left to right). Hence, it is possible to catch a more general exception-type in higher-level code where the implementation details are unknown, which reduces tight coupling to the lower-level implementation. Exceptions are defined by the trait system; there are a series of traits, and if a type satisfies them, then it can be used as an exception.  The following if a type satisfies them, then it can be used as an exception. The following is the base trait all exceptions need to match. \begin{cfa} \PAB{I do not understand this paragraph.} One odd thing about @get_exception_vtable@ is that it should always be a constant function, returning the same value regardless of its argument.  A constant function, returning the same value regardless of its argument. A pointer or reference to the virtual table instance could be used instead, however using a function has some ease of implementation advantages and allows for easier disambiguation because the virtual type name (or the address of an instance that is in scope) can be used instead of the mangled virtual table name.  Also note the use of the word promise'' in the trait name. Also note the use of the word promise'' in the trait description. Currently, \CFA cannot check to see if either @exceptT@ or @virtualT@ match the layout requirements. This is considered part of Finally there are three convenience macros for referring to the these traits: @IS_EXCEPTION@, @IS_TERMINATION_EXCEPTION@ and @IS_RESUMPTION_EXCEPTION@.  Each @IS_EXCEPTION@, @IS_TERMINATION_EXCEPTION@ and @IS_RESUMPTION_EXCEPTION@. Each takes the virtual type's name, and for polymorphic types only, the parenthesized list of polymorphic arguments. These macros do the name mangling expression has a type with a @void defaultResumptionHandler(T &)@ (default handler) defined, where the handler is found at the call site by the type system.  At runtime, a representation of the exception type and an instance of system. At runtime, a representation of the exception type and an instance of the exception type is \emph{not} copied because the stack is maintained during the handler search. exception matches, @CONDITION@ is executed. The condition expression may reference all names in scope at the beginning of the try block and @NAME@ introduced in the handler clause.  If the condition is true, then the handler introduced in the handler clause. If the condition is true, then the handler matches. Otherwise, the exception search continues at the next appropriate kind of handler clause in the try block. the end of the block. This requirement ensures always continues as if the finally clause is not present, \ie finally is for cleanup not changing control flow.  Because of this requirement, local control flow out of the finally block is forbidden.  The compiler precludes any @break@, @continue@, @fallthru@ or flow. Because of this requirement, local control flow out of the finally block is forbidden. The compiler precludes any @break@, @continue@, @fallthru@ or @return@ that causes control to leave the finally block. Other ways to leave the finally block, such as a long jump or termination are much harder to check, There is no special statement for starting a cancellation; instead the standard library function @cancel_stack@ is called passing an exception.  Unlike a library function @cancel_stack@ is called passing an exception. Unlike a raise, this exception is not used in matching only to pass information about the cause of the cancellation. \item[Main Stack:] The main stack is the one used by the program main at the start of execution, and is the only stack in a sequential program.  Hence, when cancellation is and is the only stack in a sequential program. Hence, when cancellation is forwarded to the main stack, there is no other forwarding stack, so after the stack is unwound, there is a program-level abort. \item[Thread Stack:] A thread stack is created for a @thread@ object or object that satisfies the @is_thread@ trait.  A thread only has two points of communication that must @is_thread@ trait. A thread only has two points of communication that must happen: start and join. As the thread must be running to perform a cancellation, it must occur after start and before join, so join is a cancellation point.  After the stack is unwound, the thread halts and waits for cancellation point. After the stack is unwound, the thread halts and waits for another thread to join with it. The joining thread, checks for a cancellation, and if present, resumes exception @ThreadCancelled@. \item[Coroutine Stack:] A coroutine stack is created for a @coroutine@ object or object that satisfies the @is_coroutine@ trait.  A coroutine only knows of two other coroutines, its starter and its last resumer.  The last resumer has the tightest coupling to the coroutine it activated.  Hence, cancellation of or object that satisfies the @is_coroutine@ trait. A coroutine only knows of two other coroutines, its starter and its last resumer. The last resumer has the tightest coupling to the coroutine it activated. Hence, cancellation of the active coroutine is forwarded to the last resumer after the stack is unwound, as the last resumer has the most precise knowledge about the current