Changeset b041f11


Ignore:
Timestamp:
Aug 30, 2021, 9:43:40 PM (5 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
jacob/cs343-translation, master
Children:
13afd0c
Parents:
f93d7fc
Message:

Andrew MMath: Saved and reverting updates on the new syntax.

Location:
doc/theses/andrew_beach_MMath
Files:
2 edited

Legend:

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

    rf93d7fc rb041f11  
    152152% A type's descendants are its children and its children's descendants.
    153153
    154 For the purposes of illustration, a proposed -- but unimplemented syntax --
    155 will be used. Each virtual type is represented by a trait with an annotation
     154For the purposes of illistration, a proposed -- but unimplemented syntax --
     155will be used. Each virtual type is repersented by a trait with an annotation
    156156that makes it a virtual type. This annotation is empty for a root type, which
    157157creates a new tree:
     
    192192As @child_type@ is a child of @root_type@ it has the virtual members of
    193193@root_type@ (@to_string@ and @size@) as well as the one it declared
    194 (@irrelevant_function@).
     194(@irrelivant_function@).
    195195
    196196It is important to note that these are virtual members, and may contain   
     
    282282
    283283Fields are filled in the same way as a structure as well. However an extra
    284 field is added that contains the pointer to the virtual table.
    285 It must be explicitly initialized by the user when the exception is
     284field is added, this field contains the pointer to the virtual table.
     285It must be explicitly initialised by the user when the exception is
    286286constructed.
    287287
     
    310310
    311311%\subsection{Exception Details}
    312 This is the only interface needed when raising and handling exceptions.
    313 However it is actually a short hand for a more complex
     312If one is only raising and handling exceptions, that is the only interface
     313that is needed. However it is actually a short hand for a more complex
    314314trait based interface.
    315315
    316 The language views exceptions through a series of traits.
    317 If a type satisfies them, then it can be used as an exception. The following
     316The language views exceptions through a series of traits,
     317if a type satisfies them, then it can be used as an exception. The following
    318318is the base trait all exceptions need to match.
    319319\begin{cfa}
     
    322322};
    323323\end{cfa}
    324 The trait is defined over two types: the exception type and the virtual table
     324The trait is defined over two types, the exception type and the virtual table
    325325type. Each exception type should have a single virtual table type.
    326326There are no actual assertions in this trait because the trait system
     
    347347};
    348348\end{cfa}
    349 Both traits ensure a pair of types is an exception type, its virtual table
     349Both traits ensure a pair of types are an exception type, its virtual table
    350350type
    351351and defines one of the two default handlers. The default handlers are used
     
    393393
    394394The differences between the two operations include how propagation is
    395 performed, where execution after an exception is handler
     395performed, where excecution after an exception is handler
    396396and which default handler is run.
    397397
  • doc/theses/andrew_beach_MMath/implement.tex

    rf93d7fc rb041f11  
    5151The problem is that a type id may appear in multiple TUs that compose a
    5252program (see \autoref{ss:VirtualTable}); so the initial solution would seem
    53 to be make it external in each translation unit. However, the type id must
     53to be make it external in each translation unit. Honever, the type id must
    5454have a declaration in (exactly) one of the TUs to create the storage.
    5555No other declaration related to the virtual type has this property, so doing
     
    183183The second section are all the virtual members of the parent, in the same
    184184order as they appear in the parent's virtual table. Note that the type may
    185 change slightly as references to the ``this" change. This is limited to
     185change slightly as references to the ``this" will change. This is limited to
    186186inside pointers/references and via function pointers so that the size (and
    187187hence the offsets) are the same.
     
    216216type's alignment, is set using an @alignof@ expression.
    217217
    218 Most of these tools are already inside the compiler. Using a simple
    219 code transformation early on in compilation, allows most of the work to be
     218Most of these tools are already inside the compiler. Using the is a simple
     219code transformation early on in compilation allows most of that work to be
    220220handed off to the existing tools. \autoref{f:VirtualTableTransformation}
    221221shows an example transformation, this example shows an exception virtual table.
    222 It also shows the transformation on the full declaration.
    223 For a forward declaration, the @extern@ keyword is preserved and the
     222It also shows the transformation on the full declaration,
     223for a forward declaration the @extern@ keyword is preserved and the
    224224initializer is not added.
    225225
     
    333333the exceptions themselves and the virtual system interactions.
    334334
    335 Creating an exception type is just a matter of prepending the field 
     335Creating an exception type is just a matter of preppending the field 
    336336with the virtual table pointer to the list of the fields
    337337(see \autoref{f:ExceptionTypeTransformation}).
     
    364364the types of the virtual table and the type id,
    365365are generated when the virtual type (the exception) is first found.
    366 The type id (the instance) is generated with the exception, if it is
     366The type id (the instance) is generated with the exception if it is
    367367a monomorphic type.
    368 However, if the exception is polymorphic, then a different type id has to
    369 be generated for every instance. In this case, generation is delayed
     368However if the exception is polymorphic then a different type id has to
     369be generated for every instance. In this case generation is delayed
    370370until a virtual table is created.
    371371% There are actually some problems with this, which is why it is not used
    372372% for monomorphic types.
    373 When a virtual table is created and initialized, two functions are created
     373When a virtual table is created and initialized two functions are created
    374374to fill in the list of virtual members.
    375 The first is a copy function that adapts the exception's copy constructor
     375The first is a copy function which adapts the exception's copy constructor
    376376to work with pointers, avoiding some issues with the current copy constructor
    377377interface.
    378 Second is the msg function that returns a C-string with the type's name,
     378Second is the msg function, which returns a C-string with the type's name,
    379379including any polymorphic parameters.
    380380
     
    405405Unwinding across multiple stack frames is more complex because that
    406406information is no longer contained within the current function.
    407 With separate compilation,
     407With seperate compilation,
    408408a function does not know its callers nor their frame layout.
    409409Even using the return address, that information is encoded in terms of
     
    479479
    480480To get full unwinding support, all of these features must be handled directly
    481 in assembly and assembler directives; particularly the cfi directives
     481in assembly and assembler directives; partiularly the cfi directives
    482482\snake{.cfi_lsda} and \snake{.cfi_personality}.
    483483
     
    894894
    895895\autoref{f:ResumptionTransformation} shows the pattern used to transform
    896 a \CFA try statement with catch clauses into the appropriate C functions.
     896a \CFA try statement with catch clauses into the approprate C functions.
    897897\todo{Explain the Resumption Transformation figure.}
    898898
Note: See TracChangeset for help on using the changeset viewer.