Changeset b041f11 for doc/theses/andrew_beach_MMath
- Timestamp:
- Aug 30, 2021, 9:43:40 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
- Children:
- 13afd0c
- Parents:
- f93d7fc
- Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/features.tex
rf93d7fc rb041f11 152 152 % A type's descendants are its children and its children's descendants. 153 153 154 For the purposes of ill ustration, a proposed -- but unimplemented syntax --155 will be used. Each virtual type is rep resented by a trait with an annotation154 For the purposes of illistration, a proposed -- but unimplemented syntax -- 155 will be used. Each virtual type is repersented by a trait with an annotation 156 156 that makes it a virtual type. This annotation is empty for a root type, which 157 157 creates a new tree: … … 192 192 As @child_type@ is a child of @root_type@ it has the virtual members of 193 193 @root_type@ (@to_string@ and @size@) as well as the one it declared 194 (@irrel evant_function@).194 (@irrelivant_function@). 195 195 196 196 It is important to note that these are virtual members, and may contain … … 282 282 283 283 Fields are filled in the same way as a structure as well. However an extra 284 field is added thatcontains the pointer to the virtual table.285 It must be explicitly initiali zed by the user when the exception is284 field is added, this field contains the pointer to the virtual table. 285 It must be explicitly initialised by the user when the exception is 286 286 constructed. 287 287 … … 310 310 311 311 %\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 complex312 If one is only raising and handling exceptions, that is the only interface 313 that is needed. However it is actually a short hand for a more complex 314 314 trait based interface. 315 315 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 following316 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 318 318 is the base trait all exceptions need to match. 319 319 \begin{cfa} … … 322 322 }; 323 323 \end{cfa} 324 The trait is defined over two types :the exception type and the virtual table324 The trait is defined over two types, the exception type and the virtual table 325 325 type. Each exception type should have a single virtual table type. 326 326 There are no actual assertions in this trait because the trait system … … 347 347 }; 348 348 \end{cfa} 349 Both traits ensure a pair of types isan exception type, its virtual table349 Both traits ensure a pair of types are an exception type, its virtual table 350 350 type 351 351 and defines one of the two default handlers. The default handlers are used … … 393 393 394 394 The differences between the two operations include how propagation is 395 performed, where ex ecution after an exception is handler395 performed, where excecution after an exception is handler 396 396 and which default handler is run. 397 397 -
doc/theses/andrew_beach_MMath/implement.tex
rf93d7fc rb041f11 51 51 The problem is that a type id may appear in multiple TUs that compose a 52 52 program (see \autoref{ss:VirtualTable}); so the initial solution would seem 53 to be make it external in each translation unit. Ho wever, the type id must53 to be make it external in each translation unit. Honever, the type id must 54 54 have a declaration in (exactly) one of the TUs to create the storage. 55 55 No other declaration related to the virtual type has this property, so doing … … 183 183 The second section are all the virtual members of the parent, in the same 184 184 order 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 to185 change slightly as references to the ``this" will change. This is limited to 186 186 inside pointers/references and via function pointers so that the size (and 187 187 hence the offsets) are the same. … … 216 216 type's alignment, is set using an @alignof@ expression. 217 217 218 Most of these tools are already inside the compiler. Using a simple219 code transformation early on in compilation , allows most of thework to be218 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 220 220 handed off to the existing tools. \autoref{f:VirtualTableTransformation} 221 221 shows 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 the222 It also shows the transformation on the full declaration, 223 for a forward declaration the @extern@ keyword is preserved and the 224 224 initializer is not added. 225 225 … … 333 333 the exceptions themselves and the virtual system interactions. 334 334 335 Creating an exception type is just a matter of prep ending the field335 Creating an exception type is just a matter of preppending the field 336 336 with the virtual table pointer to the list of the fields 337 337 (see \autoref{f:ExceptionTypeTransformation}). … … 364 364 the types of the virtual table and the type id, 365 365 are generated when the virtual type (the exception) is first found. 366 The type id (the instance) is generated with the exception ,if it is366 The type id (the instance) is generated with the exception if it is 367 367 a monomorphic type. 368 However , if the exception is polymorphic,then a different type id has to369 be generated for every instance. In this case ,generation is delayed368 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 370 370 until a virtual table is created. 371 371 % There are actually some problems with this, which is why it is not used 372 372 % for monomorphic types. 373 When a virtual table is created and initialized ,two functions are created373 When a virtual table is created and initialized two functions are created 374 374 to fill in the list of virtual members. 375 The first is a copy function thatadapts the exception's copy constructor375 The first is a copy function which adapts the exception's copy constructor 376 376 to work with pointers, avoiding some issues with the current copy constructor 377 377 interface. 378 Second is the msg function thatreturns a C-string with the type's name,378 Second is the msg function, which returns a C-string with the type's name, 379 379 including any polymorphic parameters. 380 380 … … 405 405 Unwinding across multiple stack frames is more complex because that 406 406 information is no longer contained within the current function. 407 With sep arate compilation,407 With seperate compilation, 408 408 a function does not know its callers nor their frame layout. 409 409 Even using the return address, that information is encoded in terms of … … 479 479 480 480 To get full unwinding support, all of these features must be handled directly 481 in assembly and assembler directives; parti cularly the cfi directives481 in assembly and assembler directives; partiularly the cfi directives 482 482 \snake{.cfi_lsda} and \snake{.cfi_personality}. 483 483 … … 894 894 895 895 \autoref{f:ResumptionTransformation} shows the pattern used to transform 896 a \CFA try statement with catch clauses into the appropr iate C functions.896 a \CFA try statement with catch clauses into the approprate C functions. 897 897 \todo{Explain the Resumption Transformation figure.} 898 898
Note: See TracChangeset
for help on using the changeset viewer.