Changeset 0a55a53
- Timestamp:
- Aug 30, 2021, 10:03:54 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
- Children:
- 16f9aca, 6cf21ed8, bbe3719
- Parents:
- 13afd0c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/implement.tex
r13afd0c r0a55a53 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 never, the type id must53 to be make it external in each translation unit. Hovever, 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" willchange. This is limited to185 change slightly as references to the ``this" 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 the is asimple219 code transformation early on in compilationallows most of that work to be218 Most of these tools are already inside the compiler. Using simple 219 code transformations 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 declarationthe @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 pending the field335 Creating an exception type is just a matter of prepending 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 polymorphicthen 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 whichadapts the exception's copy constructor375 The first is a copy function that 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 , whichreturns a C-string with the type's name,378 Second is the msg function that 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 erate compilation,407 With separate 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 ularly the cfi directives481 in assembly and assembler directives; particularly 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 ate C functions.896 a \CFA try statement with catch clauses into the appropriate C functions. 897 897 \todo{Explain the Resumption Transformation figure.} 898 898
Note: See TracChangeset
for help on using the changeset viewer.