Changeset c65b930 for doc/theses/andrew_beach_MMath
- Timestamp:
- May 25, 2021, 4:15:06 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 375fb46, 82f4063
- Parents:
- b984d54 (diff), 887fc79 (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. - Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 3 added
- 5 edited
-
cfalab.sty (modified) (1 diff)
-
exception-layout.fig (added)
-
existing.tex (modified) (3 diffs)
-
features.tex (modified) (5 diffs)
-
implement.tex (modified) (14 diffs)
-
resumption-marking.fig (added)
-
uw-ethesis.tex (modified) (1 diff)
-
vtable-layout.fig (added)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/cfalab.sty
rb984d54 rc65b930 126 126 } 127 127 128 % \snake{<identifier>} 129 % Improves writing of snake case (or any convention that uses _) by allowing 130 % line breaks after _. Disables commands inside the block and formats the 131 % identifier to look like code. 132 \newcommand*\snake[1]{\snakefont{\expandafter\snake@next\detokenize{#1}\@nil}} 133 134 % \snakefont{<text>} 135 % Command used by \snake, you may renew the command to change its formating. 136 \newcommand*\snakefont[1]{\texttt{#1}} 137 138 % Thanks Manuel of TeX Stack exchange. (I got the base pattern from one of 139 % their answers.) Note: \@nil should never be defined. 140 \newcommand*\snake@next[1]{\ifx\@nil#1\else 141 \expandafter\ifx\string_#1\string_\allowbreak\else#1\fi 142 \expandafter\snake@next\fi 143 } 144 128 145 % common.tex Compatablity =================================================== 129 146 % Below this line is for compatability with the old common.tex file. -
doc/theses/andrew_beach_MMath/existing.tex
rb984d54 rc65b930 199 199 forall(dtype T) 200 200 struct node { 201 node(T) * next; // generic linked node201 node(T) * next; 202 202 T * data; 203 203 } … … 238 238 \begin{cfa} 239 239 coroutine CountUp { 240 unsigned int next; // communication variable240 unsigned int next; 241 241 } 242 242 CountUp countup; … … 308 308 { 309 309 StringWorker stringworker; // fork thread running in "main" 310 } // implicitly join with thread $\(\Rightarrow\)$wait for completion310 } // <- implicitly join with thread / wait for completion 311 311 \end{cfa} 312 312 The thread main is where a new thread starts execution after a fork operation -
doc/theses/andrew_beach_MMath/features.tex
rb984d54 rc65b930 115 115 116 116 \paragraph{Communication} 117 For effective exception handling, additional information is usuallypassed117 For effective exception handling, additional information is often passed 118 118 from the raise to the handler. 119 119 So far only communication of the exceptions' identity has been covered. … … 327 327 \end{cfa} 328 328 When viewed on its own, a try statement will simply execute the statements 329 in @GUARDED_BLOCK@and when those are finished the try statement finishes.329 in \snake{GUARDED_BLOCK} and when those are finished the try statement finishes. 330 330 331 331 However, while the guarded statements are being executed, including any … … 343 343 344 344 If no termination handler is found during the search then the default handler 345 ( @defaultTerminationHandler@) is run.345 (\defaultTerminationHandler) is run. 346 346 Through \CFA's trait system the best match at the throw sight will be used. 347 347 This function is run and is passed the copied exception. After the default … … 421 421 execution continues after the raise statement. 422 422 423 There is a global @defaultResumptionHandler@is polymorphic over all423 There is a global \defaultResumptionHandler{} is polymorphic over all 424 424 termination exceptions and preforms a termination throw on the exception. 425 The @defaultTerminationHandler@ for that raise is matched at the original426 raise statement (the resumption @throwResume@) and it can be customized by 427 introducing a new or better match as well.425 The \defaultTerminationHandler{} for that raise is matched at the 426 original raise statement (the resumption @throw@\-@Resume@) and it can be 427 customized by introducing a new or better match as well. 428 428 429 429 \subsubsection{Resumption Marking} … … 681 681 @CoroutineCancelled@ exception, which contains a references to the cancelled 682 682 coroutine and the exception used to cancel it. 683 The resume function also takes the @defaultResumptionHandler@from the683 The resume function also takes the \defaultResumptionHandler{} from the 684 684 caller's context and passes it to the internal report. 685 685 -
doc/theses/andrew_beach_MMath/implement.tex
rb984d54 rc65b930 16 16 Virtual types only have one change to their structure: the addition of a 17 17 pointer to the virtual table, which is called the \emph{virtual-table pointer}. 18 Internally, the field is called @virtual_table@.18 Internally, the field is called \snake{virtual_table}. 19 19 The field is fixed after construction. It is always the first field in the 20 20 structure so that its location is always known. … … 124 124 125 125 \begin{figure} 126 \begin{cfa} 127 type_id 128 parent_field0 129 ... 130 parent_fieldN 131 child_field0 132 ... 133 child_fieldN 134 \end{cfa} 126 \input{vtable-layout} 135 127 \caption{Virtual Table Layout} 136 128 \label{f:VirtualTableLayout} … … 171 163 coroutine Example { 172 164 // fields 173 } 165 }; 174 166 \end{cfa} 175 167 … … 329 321 To get full unwinding support all of this has to be done directly with 330 322 assembly and assembler directives. Partiularly the cfi directives 331 \ texttt{.cfi\_lsda} and \texttt{.cfi\_personality}.323 \snake{.cfi_lsda} and \snake{.cfi_personality}. 332 324 333 325 \subsection{Personality Functions} … … 337 329 A personality function can preform different actions depending on how it is 338 330 called. 339 \begin{lstlisting}[language=C,{moredelim=**[is][\color{red}]{@}{@}}] 340 typedef _Unwind_Reason_Code (*@_Unwind_Personality_Fn@) ( 341 _Unwind_Action @action@, 342 _Unwind_Exception_Class @exception_class@, 343 _Unwind_Exception * @exception@, 344 struct _Unwind_Context * @context@ 345 ); 331 \begin{lstlisting} 332 typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) ( 333 _Unwind_Action action, 334 _Unwind_Exception_Class exception_class, 335 _Unwind_Exception * exception, 336 struct _Unwind_Context * context); 346 337 \end{lstlisting} 347 338 The @action@ argument is a bitmask of possible actions: … … 427 418 function and the stop parameter. The stop function has a similar interface as a 428 419 personality function, except it is also passed the stop parameter. 429 \begin{lstlisting} [language=C,{moredelim=**[is][\color{red}]{@}{@}}]430 typedef _Unwind_Reason_Code (* @_Unwind_Stop_Fn@)(431 _Unwind_Action @action@,432 _Unwind_Exception_Class @exception_class@,433 _Unwind_Exception * @exception@,434 struct _Unwind_Context * @context@,435 void * @stop_parameter@);420 \begin{lstlisting} 421 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)( 422 _Unwind_Action action, 423 _Unwind_Exception_Class exception_class, 424 _Unwind_Exception * exception, 425 struct _Unwind_Context * context, 426 void * stop_parameter); 436 427 \end{lstlisting} 437 428 … … 446 437 \begin{sloppypar} 447 438 Its arguments are the same as the paired personality function. The actions 448 @_UA_CLEANUP_PHASE@ and @_UA_FORCE_UNWIND@are always set when it is439 \snake{_UA_CLEANUP_PHASE} and \snake{_UA_FORCE_UNWIND} are always set when it is 449 440 called. Beyond the libunwind standard, both GCC and Clang add an extra action 450 on the last call at the end of the stack: @_UA_END_OF_STACK@.441 on the last call at the end of the stack: \snake{_UA_END_OF_STACK}. 451 442 \end{sloppypar} 452 443 … … 465 456 466 457 The exception context should be retrieved by calling the function 467 @this_exception_context@. For sequential execution, this function is defined as 458 \snake{this_exception_context}. 459 For sequential execution, this function is defined as 468 460 a weak symbol in the \CFA system-library, @libcfa@. When a \CFA program is 469 461 concurrent, it links with @libcfathread@, where this function is defined with a … … 493 485 494 486 \begin{figure} 495 \begin{verbatim} 496 Fixed Header | _Unwind_Exception <- pointer target 497 | 498 | Cforall storage 499 | 500 Variable Body | the exception <- fixed offset 501 V ... 502 \end{verbatim} 487 \input{exception-layout} 503 488 \caption{Exception Layout} 504 489 \label{f:ExceptionLayout} … … 525 510 \begin{figure} 526 511 \centering 527 % Andrew: Figure out what these do and give them better names. 528 \newsavebox{\myboxA} 529 \newsavebox{\myboxB} 530 \begin{lrbox}{\myboxA} 512 \newsavebox{\codeBox} 513 \newsavebox{\stackBox} 514 \begin{lrbox}{\codeBox} 531 515 \begin{lstlisting}[language=CFA,{moredelim=**[is][\color{red}]{@}{@}}] 532 516 unsigned num_exceptions = 0; … … 551 535 \end{lrbox} 552 536 553 \begin{lrbox}{\ myboxB}537 \begin{lrbox}{\stackBox} 554 538 \begin{lstlisting} 539 | try-finally 540 | try-catch (Example) 541 throws() 542 | try-finally 543 | try-catch (Example) 544 throws() 545 | try-finally 546 | try-catch (Example) 547 throws() 548 main() 555 549 \end{lstlisting} 556 550 \end{lrbox} 557 551 558 {\usebox\ myboxA}552 {\usebox\codeBox} 559 553 \hspace{25pt} 560 {\usebox\ myboxB}554 {\usebox\stackBox} 561 555 562 556 \caption{Multiple Exceptions} … … 647 641 { 648 642 Exception1 * name1; 649 if (name1 = (virtual Exception1 *)__exception_inst && check(name1)) { 643 if (name1 = (virtual Exception1 *)__exception_inst 644 && check(name1)) { 650 645 return 1; 651 646 } … … 732 727 { 733 728 Exception1 * name1; 734 if (name1 = (virtual Exception1 *)__exception_inst && check(name1)) { 729 if (name1 = (virtual Exception1 *)__exception_inst 730 && check(name1)) { 735 731 // CATCH BLOCK 1 736 732 return 1; … … 775 771 776 772 \begin{figure} 777 \begin{minipage}[l][][b]{0,2\textwidth} 778 \begin{verbatim} 779 780 781 X <- 782 | 783 V 784 X 785 | 786 V 787 X 788 \end{verbatim} 789 Initial State 790 \end{minipage} 791 \begin{minipage}[l][][b]{0,2\textwidth} 792 \begin{verbatim} 793 794 795 X 796 | 797 V 798 X <- 799 | 800 V 801 X 802 \end{verbatim} 803 Handler Found 804 \end{minipage} 805 \begin{minipage}[l][][b]{0,2\textwidth} 806 \begin{verbatim} 807 X <- 808 / 809 / X 810 | | 811 \ V 812 X 813 | 814 V 815 X 816 \end{verbatim} 817 Try Block Added 818 \end{minipage} 819 \begin{minipage}[l][][b]{0,2\textwidth} 820 \begin{verbatim} 821 822 823 X <- 824 | 825 V 826 X 827 | 828 V 829 X 830 \end{verbatim} 831 Handler Done 832 \end{minipage} 773 \input{resumption-marking} 833 774 \caption{Resumption Marking} 834 775 \label{f:ResumptionMarking} -
doc/theses/andrew_beach_MMath/uw-ethesis.tex
rb984d54 rc65b930 202 202 \makeglossaries 203 203 204 % New commands/options for this document alone: 205 % Code snipits with formating and line-breaks. 206 \newcommand\defaultResumptionHandler{\texttt{default\-Resumption\-Handler}} 207 \newcommand\defaultTerminationHandler{\texttt{default\-Termination\-Handler}} 208 204 209 % listings package configuation: 205 210 \lstMakeShortInline@
Note:
See TracChangeset
for help on using the changeset viewer.