Changeset 54651005
- Timestamp:
- Jul 20, 2021, 3:31:20 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 86fc350
- Parents:
- 815c6ae
- Location:
- doc/theses/andrew_beach_MMath/code
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/cond-catch.cfa
r815c6ae r54651005 19 19 throw_exception(); 20 20 } catch (empty_exception * exc ; should_catch) { 21 // ...21 asm volatile ("# catch block (conditional)"); 22 22 } 23 23 } … … 37 37 cond_catch(); 38 38 } catch (empty_exception * exc) { 39 // ...39 asm volatile ("# catch block (unconditional)"); 40 40 } 41 41 } -
doc/theses/andrew_beach_MMath/code/cond-catch.cpp
r815c6ae r54651005 22 22 throw; 23 23 } 24 asm volatile ("# catch block (conditional)"); 24 25 } 25 26 } … … 39 40 cond_catch(); 40 41 } catch (EmptyException &) { 41 // ...42 asm volatile ("# catch block (unconditional)"); 42 43 } 43 44 } -
doc/theses/andrew_beach_MMath/code/cond-fixup.cfa
r815c6ae r54651005 19 19 throw_exception(); 20 20 } catchResume (empty_exception * exc ; should_catch) { 21 // ...21 asm volatile ("# fixup block (conditional)"); 22 22 } 23 23 } … … 37 37 cond_catch(); 38 38 } catchResume (empty_exception * exc) { 39 // ...39 asm volatile ("# fixup block (unconditional)"); 40 40 } 41 41 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cfa
r815c6ae r54651005 7 7 EHM_EXCEPTION(not_raised_exception)(); 8 8 9 EHM_VIRTUAL_TABLE(not_raised_exception, not_vt); 10 9 11 int main(int argc, char * argv[]) { 10 12 unsigned int times = 1; 11 unsigned int total_frames = 1;13 bool should_throw = false; 12 14 if (1 < argc) { 13 15 times = strtol(argv[1], 0p, 10); 14 }15 if (2 < argc) {16 total_frames = strtol(argv[2], 0p, 10);17 16 } 18 17 … … 20 19 for (unsigned int count = 0 ; count < times ; ++count) { 21 20 try { 22 // ... 21 asm volatile ("# try block" : "=rm" (should_throw)); 22 if (should_throw) { 23 throw (not_raised_exception){¬_vt}; 24 } 23 25 } catch (not_raised_exception *) { 24 // ...26 asm volatile ("# catch block"); 25 27 } 26 28 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cpp
r815c6ae r54651005 11 11 int main(int argc, char * argv[]) { 12 12 unsigned int times = 1; 13 bool should_throw = false; 13 14 if (1 < argc) { 14 15 times = strtol(argv[1], nullptr, 10); … … 18 19 for (unsigned int count = 0 ; count < times ; ++count) { 19 20 try { 20 // ... 21 asm volatile ("# try block" : "=rm" (should_throw)); 22 if (should_throw) { 23 throw NotRaisedException(); 24 } 21 25 } catch (NotRaisedException &) { 22 // ...26 asm volatile ("# catch block"); 23 27 } 24 28 } -
doc/theses/andrew_beach_MMath/code/cross-finally.cfa
r815c6ae r54651005 5 5 #include <stdlib.hfa> 6 6 7 EHM_EXCEPTION(not_raised_exception)(); 8 9 EHM_VIRTUAL_TABLE(not_raised_exception, not_vt); 10 7 11 int main(int argc, char * argv[]) { 8 12 unsigned int times = 1; 9 unsigned int total_frames = 1;13 bool should_throw = false; 10 14 if (1 < argc) { 11 15 times = strtol(argv[1], 0p, 10); 12 }13 if (2 < argc) {14 total_frames = strtol(argv[2], 0p, 10);15 16 } 16 17 17 18 Time start_time = timeHiRes(); 18 19 for (unsigned int count = 0 ; count < times ; ++count) { 19 try { 20 // ... 20 try { 21 asm volatile ("# try block" : "=rm" (should_throw)); 22 if (should_throw) { 23 throw (not_raised_exception){¬_vt}; 24 } 21 25 } finally { 22 // ...26 asm volatile ("# finally block"); 23 27 } 24 28 } -
doc/theses/andrew_beach_MMath/code/cross-resume.cfa
r815c6ae r54651005 20 20 for (unsigned int count = 0 ; count < times ; ++count) { 21 21 try { 22 // ...22 asm volatile (""); 23 23 } catchResume (not_raised_exception *) { 24 // ...24 asm volatile (""); 25 25 } 26 26 } -
doc/theses/andrew_beach_MMath/code/resume-detor.cfa
r815c6ae r54651005 12 12 13 13 void ^?{}(WithDestructor & this) { 14 // ... 14 asm volatile ("# destructor body"); 15 15 } 16 16 17 17 void unwind_destructor(unsigned int frames) { 18 18 if (frames) { 19 19 20 21 22 23 24 20 WithDestructor object; 21 unwind_destructor(frames - 1); 22 } else { 23 throwResume (empty_exception){&empty_vt}; 24 } 25 25 } 26 26 … … 36 36 37 37 Time start_time = timeHiRes(); 38 39 40 41 42 // ... 43 44 38 for (int count = 0 ; count < times ; ++count) { 39 try { 40 unwind_destructor(total_frames); 41 } catchResume (empty_exception *) { 42 asm volatile ("# fixup block"); 43 } 44 } 45 45 Time end_time = timeHiRes(); 46 46 sout | "Run-Time (ns): " | (end_time - start_time)`ns; -
doc/theses/andrew_beach_MMath/code/resume-empty.cfa
r815c6ae r54651005 32 32 unwind_empty(total_frames); 33 33 } catchResume (empty_exception *) { 34 // ...34 asm volatile ("# fixup block"); 35 35 } 36 36 } -
doc/theses/andrew_beach_MMath/code/resume-finally.cfa
r815c6ae r54651005 14 14 unwind_finally(frames - 1); 15 15 } finally { 16 // ...16 asm volatile ("# finally block"); 17 17 } 18 18 } else { … … 36 36 unwind_finally(total_frames); 37 37 } catchResume (empty_exception *) { 38 // ...38 asm volatile ("# fixup block"); 39 39 } 40 40 } -
doc/theses/andrew_beach_MMath/code/resume-other.cfa
r815c6ae r54651005 16 16 unwind_other(frames - 1); 17 17 } catchResume (not_raised_exception *) { 18 // ...18 asm volatile ("# fixup block (stack)"); 19 19 } 20 20 } else { … … 38 38 unwind_other(total_frames); 39 39 } catchResume (empty_exception *) { 40 // ...40 asm volatile ("# fixup block (base)"); 41 41 } 42 42 } -
doc/theses/andrew_beach_MMath/code/throw-detor.cfa
r815c6ae r54651005 12 12 13 13 void ^?{}(WithDestructor & this) { 14 // ...14 asm volatile ("# destructor body"); 15 15 } 16 16 … … 39 39 unwind_destructor(total_frames); 40 40 } catch (empty_exception *) { 41 // ...41 asm volatile ("# catch block"); 42 42 } 43 43 } -
doc/theses/andrew_beach_MMath/code/throw-detor.cpp
r815c6ae r54651005 10 10 11 11 struct WithDestructor { 12 ~WithDestructor() {} 12 ~WithDestructor() { 13 asm volatile ("# destructor body"); 14 } 13 15 }; 14 16 … … 37 39 unwind_destructor(total_frames); 38 40 } catch (EmptyException &) { 39 // ...41 asm volatile ("# catch block"); 40 42 } 41 43 } -
doc/theses/andrew_beach_MMath/code/throw-empty.cfa
r815c6ae r54651005 32 32 unwind_empty(total_frames); 33 33 } catch (empty_exception *) { 34 // ...34 asm volatile ("# catch block"); 35 35 } 36 36 } -
doc/theses/andrew_beach_MMath/code/throw-empty.cpp
r815c6ae r54651005 32 32 unwind_empty(total_frames); 33 33 } catch (EmptyException &) { 34 // ...34 asm volatile ("# catch block"); 35 35 } 36 36 } -
doc/theses/andrew_beach_MMath/code/throw-finally.cfa
r815c6ae r54651005 14 14 unwind_finally(frames - 1); 15 15 } finally { 16 // ...16 asm volatile ("# finally block"); 17 17 } 18 18 } else { … … 36 36 unwind_finally(total_frames); 37 37 } catch (empty_exception *) { 38 // ...38 asm volatile ("# catch block"); 39 39 } 40 40 } -
doc/theses/andrew_beach_MMath/code/throw-other.cfa
r815c6ae r54651005 16 16 unwind_other(frames - 1); 17 17 } catch (not_raised_exception *) { 18 // ...18 asm volatile ("# catch block (stack)"); 19 19 } 20 20 } else { … … 38 38 unwind_other(total_frames); 39 39 } catch (empty_exception *) { 40 // ...40 asm volatile ("# catch block (base)"); 41 41 } 42 42 } -
doc/theses/andrew_beach_MMath/code/throw-other.cpp
r815c6ae r54651005 16 16 unwind_other(frames - 1); 17 17 } catch (NotRaisedException &) { 18 // ...18 asm volatile ("# catch block (stack)"); 19 19 } 20 20 } else { … … 38 38 unwind_other(total_frames); 39 39 } catch (EmptyException &) { 40 // ...40 asm volatile ("# catch block (base)"); 41 41 } 42 42 }
Note: See TracChangeset
for help on using the changeset viewer.