Changeset 812ba3d for doc/theses/andrew_beach_MMath

Ignore:
Timestamp:
Sep 7, 2021, 9:59:12 AM (3 years ago)
Branches:
Children:
2bfee8e
Parents:
49b3389
Message:

Some clean-up to make Peter's changes to the exception benchmarks fit in better. And make test.sh a bit more robust.

Location:
doc/theses/andrew_beach_MMath/code
Files:
5 edited

Unmodified
Removed
• doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa

 r49b3389 #include #include #include                                                                    // strto #include void nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) { if (frames) { nounwind_fixup(frames - 1, raised_rtn); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations // "Always" false, but prevents recursion elimination. if (-1 == frames) printf("~"); } else { int fixup = 17; } // Closures at the top level are allowed to be true closures. void raised(int & fixup) { fixup = total_frames + 42;                                              // use local scope => lexical link if ( total_frames == 42 ) printf( "42" ); fixup = total_frames + 42; if (total_frames == 42) printf("42"); }
• doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa

 r49b3389 #include #include #include                                                                    // strto #include exception fixup_exception { if (frames) { nounwind_empty(frames - 1); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations // "Always" false, but prevents recursion elimination. if (-1 == frames) printf("~"); } else { int fixup = 17; throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup throwResume (fixup_exception){&fixup_vt, fixup}; } }
• doc/theses/andrew_beach_MMath/code/fixup-other-f.cfa

 r49b3389 #include #include #include                                                                    // strto #include unsigned int frames;                                                                    // use global because of gcc thunk problem // Using a global value to allow hoisting (and avoid thunks). unsigned int frames; void nounwind_fixup(unsigned int dummy, void (*raised_rtn)(int &), void (*not_raised_rtn)(int &)) { void not_raised(int & fixup) { fixup = frames + 42;                                                    // use local scope => lexical link fixup = frames + 42; } frames -= 1; nounwind_fixup(42, raised_rtn, not_raised); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations // Always false, but prevents recursion elimination. if (-1 == frames) printf("~"); } else { int fixup = dummy; frames = total_frames; // Closures at the top level are allowed to be true closures. void raised(int & fixup) { fixup = total_frames + 42;                                              // use local scope => lexical link fixup = total_frames + 42; } void not_raised(int & fixup) { fixup = total_frames + 42;                                              // use local scope => lexical link fixup = total_frames + 42; }
• doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa

 r49b3389 #include #include #include                                                                    // strto #include exception fixup_exception { }; unsigned int frames;                                                                    // use global because of gcc thunk problem // Using a global value to allow hoisting (and avoid thunks). unsigned int frames; void nounwind_other(unsigned int dummy) { try { nounwind_other(42); if ( frames == -1 ) printf( "42" );                     // prevent recursion optimizations // Always false, but prevents recursion elimination. if (-1 == frames) printf("~"); } catchResume (not_raised_exception * ex) { ex->fixup = frames + 42;                                        // use local scope => lexical link ex->fixup = frames + 42; } } else { int fixup = dummy; throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup throwResume (fixup_exception){&fixup_vt, fixup}; } }
• doc/theses/andrew_beach_MMath/code/test.sh

 r49b3389 # test.sh -v LANGUAGE TEST FILE #   View the result from TEST in LANGUAGE stored in FILE. readonly DIR=\$(dirname "\$(readlink -f "\$0")") cd \$DIR readonly MIL=000000
Note: See TracChangeset for help on using the changeset viewer.