Changeset 0a55a53


Ignore:
Timestamp:
Aug 30, 2021, 10:03:54 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
Children:
16f9aca, 6cf21ed8, bbe3719
Parents:
13afd0c
Message:

Andrew MMath: Implement chapter updated from Peter's focused review.

File:
1 edited

Legend:

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

    r13afd0c r0a55a53  
    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. Honever, the type id must
     53to be make it external in each translation unit. Hovever, 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" will change. This is limited to
     185change slightly as references to the ``this" 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 the is a simple
    219 code transformation early on in compilation allows most of that work to be
     218Most of these tools are already inside the compiler. Using simple
     219code transformations 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 preppending the field 
     335Creating an exception type is just a matter of prepending 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 which adapts the exception's copy constructor
     375The first is a copy function that 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, which returns a C-string with the type's name,
     378Second is the msg function that 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 seperate compilation,
     407With separate 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; partiularly the cfi directives
     481in assembly and assembler directives; particularly 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 approprate C functions.
     896a \CFA try statement with catch clauses into the appropriate C functions.
    897897\todo{Explain the Resumption Transformation figure.}
    898898
Note: See TracChangeset for help on using the changeset viewer.