Changeset 2d8a770

Ignore:
Timestamp:
Apr 29, 2021, 11:00:18 AM (19 months ago)
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3eb55f98
Parents:
3ec79f7 (diff), a6c45c6 (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 'andrew-mmath' into branch 'master', some major LaTeX changes and some thesis work.

Location:
doc/theses/andrew_beach_MMath
Files:
7 edited

Unmodified
Removed
• doc/theses/andrew_beach_MMath/Makefile

 r3ec79f7 ${LATEX}${BASE} ${BIBTEX}${BUILD}/${BASE}${LATEX} ${BASE}${GLOSSARY} ${BUILD}/${BASE} ${LATEX}${BASE}

• doc/theses/andrew_beach_MMath/features.tex

 r3ec79f7 \subparagraph{Raise} The raise is the starting point for exception handling. It marks the beginning of exception handling by \newterm{raising} an excepion, which passes it to of exception handling by raising an excepion, which passes it to the EHM. between different sub-hierarchies. This design is used in \CFA even though it is not a object-orientated language using different tools to create the hierarchy. language; so different tools are used to create the hierarchy. % Could I cite the rational for the Python IO exception rework? \section{Virtuals} Virtual types and casts are not part of \CFA's EHM nor are they required for any EHM. But \CFA uses a hierarchial system of exceptions and this feature is leveraged to create that. % Maybe talk about why the virtual system is so minimal. % Created for but not a part of the exception system. any EHM. However the \CFA uses a hierarchy built with the virtual system as the basis for exceptions and exception matching. The virtual system would have ideally been part of \CFA before the work on exception handling began, but unfortunately it was not. Because of this only the features and framework needed for the EHM were designed and implemented. Other features were considered to ensure that the structure could accomidate other desirable features but they were not implemented. The rest of this section will only discuss the finalized portion of the virtual system. The virtual system supports multiple trees" of types. Each tree is While much of the virtual infrastructure is created, it is currently only used internally for exception handling. The only user-level feature is the virtual cast, which is the same as the \Cpp \lstinline[language=C++]|dynamic_cast|. cast, which is the same as the \Cpp \codeCpp{dynamic_cast}. \label{p:VirtualCast} \begin{cfa} \begin{cfa} trait is_exception(exceptT &, virtualT &) { virtualT const & get_exception_vtable(exceptT *); // Numerous imaginary assertions. }; \end{cfa} The trait is defined over two types, the exception type and the virtual table type. This should be one-to-one: each exception type has only one virtual table type and vice versa. The only assertion in the trait is @get_exception_vtable@, which takes a pointer of the exception type and returns a reference to the virtual table type instance. % TODO: This section, and all references to get_exception_vtable, are % out-of-data. Perhaps wait until the update is finished before rewriting it. The function @get_exception_vtable@ is actually a constant function. Regardless of the value passed in (including the null pointer) it should return a reference to the virtual table instance for that type. The reason it is a function instead of a constant is that it make type annotations easier to write as you can use the exception type instead of the virtual table type; which usually has a mangled name. % Also \CFA's trait system handles functions better than constants and doing % it this way reduce the amount of boiler plate we need. type. Each exception type should have but a single virtual table type. Now there are no actual assertions in this trait because the trait system actually can't express them (adding such assertions would be part of completing the virtual system). The imaginary assertions would probably come from a trait defined by the virtual system, and state that the exception type is a virtual type, is a decendent of @exception_t@ (the base exception type) and note its virtual table type. % I did have a note about how it is the programmer's responsibility to make Both traits ensure a pair of types are an exception type and its virtual table and defines one of the two default handlers. The default handlers are used as fallbacks and are discussed in detail in \VRef{s:ExceptionHandling}. as fallbacks and are discussed in detail in \vref{s:ExceptionHandling}. However, all three of these traits can be tricky to use directly. for particular exception type. The global default termination handler performs a cancellation \see{\VRef{s:Cancellation}} on the current stack with the copied exception. (see \vref{s:Cancellation}) on the current stack with the copied exception. \subsection{Resumption} \subsubsection{Resumption Marking} \label{s:ResumptionMarking} A key difference between resumption and termination is that resumption does not unwind the stack. A side effect that is that when a handler is matched The symmetry between resumption termination is why this pattern was picked. Other patterns, such as marking just the handlers that caught, also work but lack the symmetry means there are less rules to remember. lack the symmetry means there are more rules to remember. \section{Conditional Catch} \end{cfa} If there are further handlers after this handler only the first version will check them. If multiple handlers on a single try block could handle the same exception the translations get more complex but they are equivilantly check them. If multiple handlers on a single try block that could handle the same exception the translations get more complex but they are equivilantly powerful. and the current stack is unwound. After that it depends one which stack is being cancelled. \begin{description} \item[Main Stack:] \paragraph{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. to, so it would have be explicitly managed. \item[Thread Stack:] \paragraph{Thread Stack} A thread stack is created for a \CFA @thread@ object or object that satisfies the @is_thread@ trait. Also you can always add an explicit join if that is the desired behaviour. \item[Coroutine Stack:] \paragraph{Coroutine Stack} A coroutine stack is created for a @coroutine@ object or object that satisfies the @is_coroutine@ trait. (in terms of coroutine state) called resume on this coroutine, so the message is passed to the latter. \end{description}
• doc/theses/andrew_beach_MMath/future.tex

 r3ec79f7 \section{Zero-Cost Try} \CFA does not have zero-cost try-statements because the compiler generates C code rather than assembler code \see{\VPageref{p:zero-cost}}. When the compiler code rather than assembler code (see \vpageref{p:zero-cost}). When the compiler does create its own assembly (or LLVM byte-code), then zero-cost try-statements are possible. The downside of zero-cost try-statements is the LSDA complexity,
• doc/theses/andrew_beach_MMath/implement.tex

 r3ec79f7 % Virtual table rules. Virtual tables, the pointer to them and the cast. While the \CFA virtual system currently has only one public feature, virtual cast \see{\VPageref{p:VirtualCast}}, substantial structure is required to support it, and provide features for exception handling and the standard library. cast (see the virtual cast feature \vpageref{p:VirtualCast}), substantial structure is required to support it, and provide features for exception handling and the standard library. \subsection{Virtual Type} \subsection{libunwind Usage} Libunwind, accessed through @unwind.h@ on most platforms, is a C library that provides \CC-style stack-unwinding. Its operation is divided into two phases: provides \Cpp-style stack-unwinding. Its operation is divided into two phases: search and cleanup. The dynamic target search -- phase 1 -- is used to scan the stack and decide where unwinding should stop (but no unwinding occurs). The @_UA_FORCE_UNWIND@ specifies a forced unwind call. Forced unwind only performs the cleanup phase and uses a different means to decide when to stop \see{\VRef{s:ForcedUnwind}}. (see \vref{s:ForcedUnwind}). \end{enumerate} Termination exceptions use libunwind heavily because it matches the intended use from \CC exceptions closely. The main complication for \CFA is that the use from \Cpp exceptions closely. The main complication for \CFA is that the compiler generates C code, making it very difficult to generate the assembly to form the LSDA for try blocks or destructors. % Recursive Resumption Stuff: Search skipping \see{\VPageref{p:searchskip}}, which ignores parts of the stack Search skipping (see \vpageref{s:ResumptionMarking}), which ignores parts of the stack already examined, is accomplished by updating the front of the list as the search continues. Before the handler at a node is called the head of the list Cancellation also uses libunwind to do its stack traversal and unwinding, however it uses a different primary function @_Unwind_ForcedUnwind@. Details of its interface can be found in the \VRef{s:ForcedUnwind}. of its interface can be found in the \vref{s:ForcedUnwind}. The first step of cancellation is to find the cancelled stack and its type:
• doc/theses/andrew_beach_MMath/uw-ethesis.tex

Note: See TracChangeset for help on using the changeset viewer.