- Timestamp:
- Jan 15, 2019, 4:16:15 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- c802eb88
- Parents:
- 5e49e47 (diff), c9aba81 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- doc
- Files:
-
- 23 added
- 5 edited
- 1 moved
-
papers/concurrency/Paper.tex (modified) (14 diffs)
-
proposals/flags.md (modified) (2 diffs)
-
proposals/vtable.md (added)
-
theses/lynn_tran_SE499/Bibliography.bib (added)
-
theses/lynn_tran_SE499/Chapters/CFA.tex (added)
-
theses/lynn_tran_SE499/Chapters/Conclusion.tex (added)
-
theses/lynn_tran_SE499/Chapters/Demangler.tex (added)
-
theses/lynn_tran_SE499/Chapters/Extensions.tex (added)
-
theses/lynn_tran_SE499/Chapters/GDB.tex (added)
-
theses/lynn_tran_SE499/Chapters/Introduction.tex (added)
-
theses/lynn_tran_SE499/Chapters/uCPP.tex (added)
-
theses/lynn_tran_SE499/LICENSE (added)
-
theses/lynn_tran_SE499/SE499-master.zip (added)
-
theses/lynn_tran_SE499/SE499-master/.gdbinit (added)
-
theses/lynn_tran_SE499/SE499-master/README.md (added)
-
theses/lynn_tran_SE499/SE499-master/test.cc (added)
-
theses/lynn_tran_SE499/SE499-master/utils-gdb.gdb (added)
-
theses/lynn_tran_SE499/SE499-master/utils-gdb.py (added)
-
theses/lynn_tran_SE499/SE499-master/utils.cpp (added)
-
theses/lynn_tran_SE499/Thesis.cls (added)
-
theses/lynn_tran_SE499/lstpatch.sty (added)
-
theses/lynn_tran_SE499/se499-report.tex (added)
-
theses/lynn_tran_SE499/uContext_stack.png (added)
-
theses/lynn_tran_SE499/vector.sty (added)
-
user/user.tex (modified) (41 diffs)
-
working/exception/impl/Makefile (added)
-
working/exception/impl/exception.c (modified) (4 diffs)
-
working/exception/impl/pdc.s (moved) (moved from doc/working/exception/impl/nopic.s ) (1 diff)
-
working/exception/impl/pic.s (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/Paper.tex
r5e49e47 rd0c91a6 686 686 Fib f1, f2; 687 687 for ( int i = 1; i <= 10; i += 1 ) { 688 sout | next( f1 ) | next( f2 ) | endl;688 sout | next( f1 ) | next( f2 ); 689 689 } 690 690 } … … 772 772 sout | " "; // separator 773 773 } 774 sout | endl;774 sout | nl; 775 775 } 776 776 } 777 777 void ?{}( Format & fmt ) { `resume( fmt );` } 778 778 void ^?{}( Format & fmt ) with( fmt ) { 779 if ( g != 0 || b != 0 ) sout | endl;779 if ( g != 0 || b != 0 ) sout | nl; 780 780 } 781 781 void format( Format & fmt ) { … … 855 855 for ( int i = 0; i < N; i += 1 ) { 856 856 int p1 = random( 100 ), p2 = random( 100 ); 857 sout | p1 | " " | p2 | endl;857 sout | p1 | " " | p2; 858 858 int status = delivery( c, p1, p2 ); 859 sout | " $" | money | endl | status | endl;859 sout | " $" | money | nl | status; 860 860 receipt += 1; 861 861 } 862 862 stop( c ); 863 sout | "prod stops" | endl;863 sout | "prod stops"; 864 864 } 865 865 int payment( Prod & prod, int money ) { … … 895 895 int money = 1, receipt; 896 896 for ( ; ! done; ) { 897 sout | p1 | " " | p2 | endl | " $" | money | endl;897 sout | p1 | " " | p2 | nl | " $" | money; 898 898 status += 1; 899 899 receipt = payment( p, money ); 900 sout | " #" | receipt | endl;900 sout | " #" | receipt; 901 901 money += 1; 902 902 } 903 sout | "cons stops" | endl;903 sout | "cons stops"; 904 904 } 905 905 int delivery( Cons & cons, int p1, int p2 ) { … … 1099 1099 1100 1100 void main(foo & this) { 1101 sout | "Hello World!" | endl;1101 sout | "Hello World!"; 1102 1102 } 1103 1103 \end{cfa} … … 1124 1124 1125 1125 void hello(/*unused*/ int) { 1126 sout | "Hello World!" | endl;1126 sout | "Hello World!"; 1127 1127 } 1128 1128 … … 1141 1141 thread World {}; 1142 1142 void main( World & this ) { 1143 sout | "World!" | endl;1143 sout | "World!"; 1144 1144 } 1145 1145 int main() { 1146 1146 World w`[10]`; $\C{// implicit forks after creation}$ 1147 sout | "Hello " | endl; $\C{// "Hello " and 10 "World!" printed concurrently}$1147 sout | "Hello "; $\C{// "Hello " and 10 "World!" printed concurrently}$ 1148 1148 } $\C{// implicit joins before destruction}$ 1149 1149 \end{cfa} … … 1193 1193 total += subtotals[r]; $\C{// total subtotal}$ 1194 1194 } 1195 sout | total | endl;1195 sout | total; 1196 1196 } 1197 1197 \end{cfa} … … 2192 2192 BENCH( 2193 2193 for ( size_t i = 0; i < N; i += 1 ) { @resume( c );@ } ) 2194 sout | result`ns | endl;2194 sout | result`ns; 2195 2195 } 2196 2196 \end{cfa} … … 2205 2205 BENCH( 2206 2206 for ( size_t i = 0; i < N; i += 1 ) { @yield();@ } ) 2207 sout | result`ns | endl;2207 sout | result`ns; 2208 2208 } 2209 2209 \end{cfa} … … 2244 2244 int main() { 2245 2245 BENCH( for( size_t i = 0; i < N; i += 1 ) { @do_call( m1/*, m2, m3, m4*/ );@ } ) 2246 sout | result`ns | endl;2246 sout | result`ns; 2247 2247 } 2248 2248 \end{cfa} … … 2305 2305 BENCH( for ( size_t i = 0; i < N; i += 1 ) { @wait( c );@ } ); 2306 2306 go = 0; // stop other thread 2307 sout | result`ns | endl;2307 sout | result`ns; 2308 2308 } 2309 2309 int main() { … … 2356 2356 BENCH( for ( size_t i = 0; i < N; i += 1 ) { @waitfor( do_call, m );@ } ) 2357 2357 go = 0; // stop other thread 2358 sout | result`ns | endl;2358 sout | result`ns; 2359 2359 } 2360 2360 int main() { … … 2391 2391 int main() { 2392 2392 BENCH( for ( size_t i = 0; i < N; i += 1 ) { @MyThread m;@ } ) 2393 sout | result`ns | endl;2393 sout | result`ns; 2394 2394 } 2395 2395 \end{cfa} -
doc/proposals/flags.md
r5e49e47 rd0c91a6 60 60 ``` 61 61 FunFlags f = some_val(); 62 if ( f ) { sout | "f has some flag(s) set" | endl; }63 if ( f & FOO ) { sout | "f has FOO set" | endl; }62 if ( f ) { sout | "f has some flag(s) set"; } 63 if ( f & FOO ) { sout | "f has FOO set"; } 64 64 f |= FOO; // set FOO 65 65 f -= FOO; // unset FOO … … 88 88 ``` 89 89 FunFlags f = some_val(); 90 if ( f.FOO ) { sout | "f has FOO set" | endl; }90 if ( f.FOO ) { sout | "f has FOO set"; } 91 91 f.FOO = true; // set FOO 92 92 f.FOO = false; // unset FOO -
doc/user/user.tex
r5e49e47 rd0c91a6 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Wed Nov 7 17:00:49201814 %% Update Count : 3 39913 %% Last Modified On : Tue Dec 11 23:19:26 2018 14 %% Update Count : 3400 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 178 178 int main( void ) { 179 179 int x = 0, y = 1, z = 2; 180 ®sout | x | y | z | endl;®§\indexc{sout}§180 ®sout | x | y | z;®§\indexc{sout}§ 181 181 } 182 182 \end{cfa} … … 513 513 Floating exponentiation\index{exponentiation!floating} is performed using \Index{logarithm}s\index{exponentiation!logarithm}, so the base cannot be negative. 514 514 \begin{cfa} 515 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi) | endl;515 sout | 2 ®\® 8u | 4 ®\® 3u | -4 ®\® 3u | 4 ®\® -3 | -4 ®\® -3 | 4.0 ®\® 2.1 | (1.0f+2.0fi) ®\® (3.0f+2.0fi); 516 516 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 517 517 \end{cfa} … … 591 591 & 592 592 \begin{cfa} 593 sout | endl;594 sout | endl;595 sout | endl;596 sout | "zero" | endl;597 sout | endl;598 sout | endl;599 sout | endl;600 sout | endl;601 sout | endl;602 sout | endl;603 sout | endl;604 sout | endl;605 sout | endl;606 sout | endl;607 sout | endl;608 sout | endl;609 sout | endl | endl;610 611 sout | endl;612 sout | endl;613 sout | endl | endl;614 615 sout | endl;593 sout | nl; 594 sout | nl; 595 sout | nl; 596 sout | "zero" | nl; 597 sout | nl; 598 sout | nl; 599 sout | nl; 600 sout | nl; 601 sout | nl; 602 sout | nl; 603 sout | nl; 604 sout | nl; 605 sout | nl; 606 sout | nl; 607 sout | nl; 608 sout | nl; 609 sout | nl | nl; 610 611 sout | nl; 612 sout | nl; 613 sout | nl | nl; 614 615 sout | nl; 616 616 \end{cfa} 617 617 & … … 2459 2459 int bar( int p ) { 2460 2460 ®i® += 1; §\C{// dependent on local variable}§ 2461 sout | ®i® | endl;2461 sout | ®i®; 2462 2462 } 2463 2463 return bar; §\C{// undefined because of local dependence}§ … … 2465 2465 int main() { 2466 2466 * [int]( int ) fp = foo(); §\C{// int (* fp)( int )}§ 2467 sout | fp( 3 ) | endl;2467 sout | fp( 3 ); 2468 2468 } 2469 2469 \end{cfa} … … 3231 3231 \begin{cfa} 3232 3232 int x = 1, y = 2, z = 3; 3233 sout | x ®|® y ®|® z | endl;3233 sout | x ®|® y ®|® z; 3234 3234 \end{cfa} 3235 3235 & … … 3252 3252 \begin{cfa} 3253 3253 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ]; 3254 sout | t1 | t2 | endl;§\C{// print tuples}§3254 sout | t1 | t2; §\C{// print tuples}§ 3255 3255 \end{cfa} 3256 3256 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3264 3264 & 3265 3265 \begin{cfa} 3266 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;3266 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); 3267 3267 \end{cfa} 3268 3268 \\ … … 3290 3290 A separator does not appear at the start or end of a line. 3291 3291 \begin{cfa}[belowskip=0pt] 3292 sout | 1 | 2 | 3 | endl;3292 sout | 1 | 2 | 3; 3293 3293 \end{cfa} 3294 3294 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3299 3299 A separator does not appear before or after a character literal or variable. 3300 3300 \begin{cfa} 3301 sout | '1' | '2' | '3' | endl;3301 sout | '1' | '2' | '3'; 3302 3302 123 3303 3303 \end{cfa} … … 3306 3306 A separator does not appear before or after a null (empty) C string. 3307 3307 \begin{cfa} 3308 sout | 1 | "" | 2 | "" | 3 | endl;3308 sout | 1 | "" | 2 | "" | 3; 3309 3309 123 3310 3310 \end{cfa} … … 3316 3316 \begin{cfa}[mathescape=off] 3317 3317 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" 3318 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;3318 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10; 3319 3319 \end{cfa} 3320 3320 %$ … … 3330 3330 \begin{cfa}[belowskip=0pt] 3331 3331 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x" 3332 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;3332 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x"; 3333 3333 \end{cfa} 3334 3334 \begin{cfa}[basicstyle=\tt,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3340 3340 A seperator does not appear before or after a C string begining/ending with the \Index*{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,showspaces=true]@`'": \t\v\f\r\n@ 3341 3341 \begin{cfa}[belowskip=0pt] 3342 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;3342 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx"; 3343 3343 \end{cfa} 3344 3344 \begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt] … … 3349 3349 If a space is desired before or after one of the special string start/end characters, simply insert a space. 3350 3350 \begin{cfa}[belowskip=0pt] 3351 sout | "x (§\color{red}\texttt{\textvisiblespace}§" | 1 | "§\color{red}\texttt{\textvisiblespace}§) x" | 2 | "§\color{red}\texttt{\textvisiblespace}§, x" | 3 | "§\color{red}\texttt{\textvisiblespace}§:x:§\color{red}\texttt{\textvisiblespace}§" | 4 | endl;3351 sout | "x (§\color{red}\texttt{\textvisiblespace}§" | 1 | "§\color{red}\texttt{\textvisiblespace}§) x" | 2 | "§\color{red}\texttt{\textvisiblespace}§, x" | 3 | "§\color{red}\texttt{\textvisiblespace}§:x:§\color{red}\texttt{\textvisiblespace}§" | 4; 3352 3352 \end{cfa} 3353 3353 \begin{cfa}[basicstyle=\tt,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt] … … 3366 3366 \begin{cfa}[mathescape=off,belowskip=0pt] 3367 3367 sepSet( sout, ", $" ); §\C{// set separator from " " to ", \$"}§ 3368 sout | 1 | 2 | 3 | " \"" | ®sep® | "\"" | endl;3368 sout | 1 | 2 | 3 | " \"" | ®sep® | "\""; 3369 3369 \end{cfa} 3370 3370 %$ … … 3375 3375 \begin{cfa}[belowskip=0pt] 3376 3376 sepSet( sout, " " ); §\C{// reset separator to " "}§ 3377 sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\"" | endl;3377 sout | 1 | 2 | 3 | " \"" | ®sepGet( sout )® | "\""; 3378 3378 \end{cfa} 3379 3379 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3385 3385 strcpy( store, sepGet( sout ) ); §\C{// copy current separator}§ 3386 3386 sepSet( sout, "_" ); §\C{// change separator to underscore}§ 3387 sout | 1 | 2 | 3 | endl;3387 sout | 1 | 2 | 3; 3388 3388 \end{cfa} 3389 3389 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3392 3392 \begin{cfa}[belowskip=0pt] 3393 3393 sepSet( sout, store ); §\C{// change separator back to original}§ 3394 sout | 1 | 2 | 3 | endl;3394 sout | 1 | 2 | 3; 3395 3395 \end{cfa} 3396 3396 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3403 3403 \begin{cfa}[belowskip=0pt] 3404 3404 sepSetTuple( sout, " " ); §\C{// set tuple separator from ", " to " "}§ 3405 sout | t1 | t2 | " \"" | ®sepTuple® | "\"" | endl;3405 sout | t1 | t2 | " \"" | ®sepTuple® | "\""; 3406 3406 \end{cfa} 3407 3407 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3410 3410 \begin{cfa}[belowskip=0pt] 3411 3411 sepSetTuple( sout, ", " ); §\C{// reset tuple separator to ", "}§ 3412 sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\"" | endl;3412 sout | t1 | t2 | " \"" | ®sepGetTuple( sout )® | "\""; 3413 3413 \end{cfa} 3414 3414 \begin{cfa}[showspaces=true,aboveskip=0pt] … … 3420 3420 Manipulators \Indexc{sepDisable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} \emph{globally} toggle printing the separator, \ie the seperator is adjusted with respect to all subsequent printed items. 3421 3421 \begin{cfa}[belowskip=0pt] 3422 sout | sepDisable | 1 | 2 | 3 | endl;§\C{// globally turn off implicit separator}§3422 sout | sepDisable | 1 | 2 | 3; §\C{// globally turn off implicit separator}§ 3423 3423 \end{cfa} 3424 3424 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3426 3426 \end{cfa} 3427 3427 \begin{cfa}[belowskip=0pt] 3428 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// globally turn on implicit separator}§3428 sout | sepEnable | 1 | 2 | 3; §\C{// globally turn on implicit separator}§ 3429 3429 \end{cfa} 3430 3430 \begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3435 3435 Manipulators \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} and \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} \emph{locally} toggle printing the separator, \ie the seperator is adjusted only with respect to the next printed item. 3436 3436 \begin{cfa}[belowskip=0pt] 3437 sout | 1 | sepOff | 2 | 3 | endl; §\C{// locally turn off implicit separator}§3437 sout | 1 | sepOff | 2 | 3; §\C{// locally turn off implicit separator}§ 3438 3438 \end{cfa} 3439 3439 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3441 3441 \end{cfa} 3442 3442 \begin{cfa}[belowskip=0pt] 3443 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; §\C{// locally turn on implicit separator}§3443 sout | sepDisable | 1 | sepOn | 2 | 3; §\C{// locally turn on implicit separator}§ 3444 3444 \end{cfa} 3445 3445 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3448 3448 The tuple separator also responses to being turned on and off. 3449 3449 \begin{cfa}[belowskip=0pt] 3450 sout | t1 | sepOff | t2 | endl; §\C{// locally turn on/off implicit separator}§3450 sout | t1 | sepOff | t2; §\C{// locally turn on/off implicit separator}§ 3451 3451 \end{cfa} 3452 3452 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3456 3456 use ©sep© to accomplish this functionality. 3457 3457 \begin{cfa}[belowskip=0pt] 3458 sout | sepOn | 1 | 2 | 3 | sepOn | endl; §\C{// sepOn does nothing at start/end of line}§3458 sout | sepOn | 1 | 2 | 3 | sepOn; §\C{// sepOn does nothing at start/end of line}§ 3459 3459 \end{cfa} 3460 3460 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3462 3462 \end{cfa} 3463 3463 \begin{cfa}[belowskip=0pt] 3464 sout | sep | 1 | 2 | 3 | sep | endl; §\C{// use sep to print separator at start/end of line}§3464 sout | sep | 1 | 2 | 3 | sep ; §\C{// use sep to print separator at start/end of line}§ 3465 3465 \end{cfa} 3466 3466 \begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt] … … 3475 3475 int main( void ) { 3476 3476 int x = 1, y = 2, z = 3; 3477 sout | x | y | z | endl;3477 sout | x | y | z; 3478 3478 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ]; 3479 sout | t1 | t2 | endl; // print tuples3480 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;3481 sout | 1 | 2 | 3 | endl;3482 sout | '1' | '2' | '3' | endl;3483 sout | 1 | "" | 2 | "" | 3 | endl;3479 sout | t1 | t2; // print tuples 3480 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); 3481 sout | 1 | 2 | 3; 3482 sout | '1' | '2' | '3'; 3483 sout | 1 | "" | 2 | "" | 3; 3484 3484 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" 3485 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;3485 | 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10; 3486 3486 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x" 3487 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;3488 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;3489 sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;3487 | 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x"; 3488 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx"; 3489 sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; 3490 3490 3491 3491 sepSet( sout, ", $" ); // set separator from " " to ", $" 3492 sout | 1 | 2 | 3 | " \"" | sep | "\"" | endl;3492 sout | 1 | 2 | 3 | " \"" | sep | "\""; 3493 3493 sepSet( sout, " " ); // reset separator to " " 3494 sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;3494 sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\""; 3495 3495 3496 3496 char store[sepSize]; 3497 3497 strcpy( store, sepGet( sout ) ); 3498 3498 sepSet( sout, "_" ); 3499 sout | 1 | 2 | 3 | endl;3499 sout | 1 | 2 | 3; 3500 3500 sepSet( sout, store ); 3501 sout | 1 | 2 | 3 | endl;3501 sout | 1 | 2 | 3; 3502 3502 3503 3503 sepSetTuple( sout, " " ); // set tuple separator from ", " to " " 3504 sout | t1 | t2 | " \"" | sepTuple | "\"" | endl;3504 sout | t1 | t2 | " \"" | sepTuple | "\""; 3505 3505 sepSetTuple( sout, ", " ); // reset tuple separator to ", " 3506 sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;3507 3508 sout | sepDisable | 1 | 2 | 3 | endl; // globally turn off implicit separator3509 sout | sepEnable | 1 | 2 | 3 | endl; // globally turn on implicit separator3510 3511 sout | 1 | sepOff | 2 | 3 | endl; // locally turn on implicit separator3512 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; // globally turn off implicit separator3506 sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\""; 3507 3508 sout | sepDisable | 1 | 2 | 3; // globally turn off implicit separator 3509 sout | sepEnable | 1 | 2 | 3; // globally turn on implicit separator 3510 3511 sout | 1 | sepOff | 2 | 3; // locally turn on implicit separator 3512 sout | sepDisable | 1 | sepOn | 2 | 3; // globally turn off implicit separator 3513 3513 sout | sepEnable; 3514 sout | t1 | sepOff | t2 | endl; // locally turn on/off implicit separator3515 3516 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // sepOn does nothing at start/end of line3517 sout | sep | 1 | 2 | 3 | sep | endl; // use sep to print separator at start/end of line3514 sout | t1 | sepOff | t2; // locally turn on/off implicit separator 3515 3516 sout | sepOn | 1 | 2 | 3 | sepOn ; // sepOn does nothing at start/end of line 3517 sout | sep | 1 | 2 | 3 | sep ; // use sep to print separator at start/end of line 3518 3518 } 3519 3519 … … 4180 4180 Fibonacci f1, f2; 4181 4181 for ( int i = 1; i <= 10; i += 1 ) { 4182 sout | next( &f1 ) | ' ' | next( &f2 ) | endl;4182 sout | next( &f1 ) | ' ' | next( &f2 ); 4183 4183 } // for 4184 4184 } … … 4246 4246 MyThread f[4]; 4247 4247 } 4248 sout | global.value | endl;4248 sout | global.value; 4249 4249 } 4250 4250 \end{cfa} … … 4324 4324 void main( First * this ) { 4325 4325 for ( int i = 0; i < 10; i += 1 ) { 4326 sout | "First : Suspend No." | i + 1 | endl;4326 sout | "First : Suspend No." | i + 1; 4327 4327 yield(); 4328 4328 } … … 4333 4333 wait( this->lock ); 4334 4334 for ( int i = 0; i < 10; i += 1 ) { 4335 sout | "Second : Suspend No." | i + 1 | endl;4335 sout | "Second : Suspend No." | i + 1; 4336 4336 yield(); 4337 4337 } … … 4340 4340 int main( void ) { 4341 4341 signal_once lock; 4342 sout | "User main begin" | endl;4342 sout | "User main begin"; 4343 4343 { 4344 4344 processor p; … … 4348 4348 } 4349 4349 } 4350 sout | "User main end" | endl;4350 sout | "User main end"; 4351 4351 } 4352 4352 \end{cfa} … … 5045 5045 void ?{}( Line * l ) { 5046 5046 l->lnth = 0.0; 5047 sout | "default" | endl;5047 sout | "default"; 5048 5048 } 5049 5049 … … 5052 5052 void ?{}( Line * l, float lnth ) { 5053 5053 l->lnth = lnth; 5054 sout | "lnth" | l->lnth | endl;5054 sout | "lnth" | l->lnth; 5055 5055 5056 5056 } … … 5058 5058 // destructor 5059 5059 void ^?() { 5060 sout | "destroyed" | endl;5060 sout | "destroyed"; 5061 5061 l.lnth = 0.0; 5062 5062 } … … 5804 5804 In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character. 5805 5805 \begin{cfa} 5806 sout | 'x' | " " | (int)'x' | endl;5806 sout | 'x' | " " | (int)'x'; 5807 5807 x 120 5808 5808 \end{cfa} … … 7034 7034 #include <gmp>§\indexc{gmp}§ 7035 7035 int main( void ) { 7036 sout | "Factorial Numbers" | endl;7036 sout | "Factorial Numbers"; 7037 7037 Int fact = 1; 7038 7038 7039 sout | 0 | fact | endl;7039 sout | 0 | fact; 7040 7040 for ( unsigned int i = 1; i <= 40; i += 1 ) { 7041 7041 fact *= i; 7042 sout | i | fact | endl;7042 sout | i | fact; 7043 7043 } 7044 7044 } -
doc/working/exception/impl/exception.c
r5e49e47 rd0c91a6 243 243 244 244 // Get a function pointer from the relative offset and call it 245 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 245 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 246 246 247 247 _Unwind_Reason_Code (*matcher)() = … … 320 320 // on how the assembly works. 321 321 // Setup the personality routine 322 #if defined(__PIC__) 323 asm volatile (".cfi_personality 0x9b,CFA.ref.__gcfa_personality_v0"); 324 // Setup the exception table 325 asm volatile (".cfi_lsda 0x1b, .LLSDACFA2"); 326 #else 322 327 asm volatile (".cfi_personality 0x3,__gcfa_personality_v0"); 323 328 // Setup the exception table 324 329 asm volatile (".cfi_lsda 0x3, .LLSDACFA2"); 330 #endif 325 331 326 332 // Label which defines the start of the area for which the handler is setup … … 356 362 // Some more works need to be done if we want to have a single 357 363 // call to the try routine 364 #if defined(__PIC__) 365 asm ( 366 //HEADER 367 ".LFECFA1:\n" 368 " .globl __gcfa_personality_v0\n" 369 " .section .gcc_except_table,\"a\",@progbits\n" 370 ".LLSDACFA2:\n" //TABLE header 371 " .byte 0xff\n" 372 " .byte 0xff\n" 373 " .byte 0x1\n" 374 " .uleb128 .LLSDACSECFA2-.LLSDACSBCFA2\n" // BODY length 375 // Body uses language specific data and therefore could be modified arbitrarily 376 ".LLSDACSBCFA2:\n" // BODY start 377 " .uleb128 .TRYSTART-__try_terminate\n" // Handled area start (relative to start of function) 378 " .uleb128 .TRYEND-.TRYSTART\n" // Handled area length 379 " .uleb128 .CATCH-__try_terminate\n" // Handler landing pad adress (relative to start of function) 380 " .uleb128 1\n" // Action code, gcc seems to use always 0 381 ".LLSDACSECFA2:\n" // BODY end 382 " .text\n" // TABLE footer 383 " .size __try_terminate, .-__try_terminate\n" 384 ); 385 386 // Somehow this piece of helps with the resolution of debug symbols. 387 __attribute__((unused)) static const int dummy = 0; 388 asm ( 389 " .hidden CFA.ref.__gcfa_personality_v0\n" // Declare an new hidden symbol 390 " .weak CFA.ref.__gcfa_personality_v0\n" 391 " .section .data.rel.local.CFA.ref.__gcfa_personality_v0,\"awG\",@progbits,CFA.ref.__gcfa_personality_v0,comdat\n" // No clue what this does specifically 392 " .align 8\n" 393 " .type CFA.ref.__gcfa_personality_v0, @object\n" // Type of our hidden symbol (it's not actually the function itself) 394 " .size CFA.ref.__gcfa_personality_v0, 8\n" // Size of our hidden symbol 395 "CFA.ref.__gcfa_personality_v0:\n" 396 " .quad __gcfa_personality_v0\n" 397 ); 398 #else 358 399 asm ( 359 400 //HEADER … … 375 416 " .text\n" // TABLE footer 376 417 " .size __try_terminate, .-__try_terminate\n" 377 " .ident \"GCC: (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901\"\n"378 // " .section .note.GNU-stack,\"x\",@progbits\n"379 418 ); 419 #endif -
doc/working/exception/impl/pdc.s
r5e49e47 rd0c91a6 101 101 .text 102 102 .size foo, .-foo 103 .ident "GCC: (Ubuntu 7. 3.0-21ubuntu1~16.04) 7.3.0"103 .ident "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0" 104 104 .section .note.GNU-stack,"",@progbits -
doc/working/exception/impl/pic.s
r5e49e47 rd0c91a6 1 1 .file "test.c" 2 2 .text 3 .Ltext0: 3 4 .globl clean 4 5 .type clean, @function 5 6 clean: 6 7 .LFB0: 8 .file 1 "test.c" 9 .loc 1 1 0 7 10 .cfi_startproc 8 11 pushq %rbp … … 12 15 .cfi_def_cfa_register 6 13 16 movq %rdi, -8(%rbp) 17 .loc 1 1 0 14 18 nop 15 19 popq %rbp … … 23 27 foo: 24 28 .LFB1: 29 .loc 1 4 0 25 30 .cfi_startproc 26 31 .cfi_personality 0x9b,DW.ref.__gcc_personality_v0 … … 39 44 .cfi_offset 3, -40 40 45 movl %edi, -52(%rbp) 46 .loc 1 4 0 41 47 movq %fs:40, %rax 42 48 movq %rax, -40(%rbp) 43 49 xorl %eax, %eax 50 .loc 1 6 0 44 51 movl -52(%rbp), %eax 45 52 movl %eax, %edi … … 50 57 movl $0, %r12d 51 58 .L7: 59 .loc 1 5 0 52 60 leaq -44(%rbp), %rax 53 61 movq %rax, %rdi … … 56 64 cmpl $1, %r12d 57 65 je .L4 66 .loc 1 6 0 58 67 movl %r13d, %eax 68 .loc 1 7 0 59 69 movq -40(%rbp), %rdx 60 70 xorq %fs:40, %rdx … … 64 74 movq %rax, %rbx 65 75 movl $1, %r12d 76 .loc 1 5 0 66 77 jmp .L7 67 78 .L4: … … 71 82 .LEHE1: 72 83 .L10: 84 .loc 1 7 0 73 85 call __stack_chk_fail@PLT 74 86 .L8: … … 101 113 .text 102 114 .size foo, .-foo 115 .Letext0: 116 .section .debug_info,"",@progbits 117 .Ldebug_info0: 118 .long 0x9c 119 .value 0x4 120 .long .Ldebug_abbrev0 121 .byte 0x8 122 .uleb128 0x1 123 .long .LASF0 124 .byte 0xc 125 .long .LASF1 126 .long .LASF2 127 .quad .Ltext0 128 .quad .Letext0-.Ltext0 129 .long .Ldebug_line0 130 .uleb128 0x2 131 .string "foo" 132 .byte 0x1 133 .byte 0x4 134 .long 0x68 135 .quad .LFB1 136 .quad .LFE1-.LFB1 137 .uleb128 0x1 138 .byte 0x9c 139 .long 0x68 140 .uleb128 0x3 141 .string "x" 142 .byte 0x1 143 .byte 0x4 144 .long 0x68 145 .uleb128 0x3 146 .byte 0x91 147 .sleb128 -68 148 .uleb128 0x4 149 .string "i" 150 .byte 0x1 151 .byte 0x5 152 .long 0x68 153 .uleb128 0x2 154 .byte 0x91 155 .sleb128 -60 156 .byte 0 157 .uleb128 0x5 158 .byte 0x4 159 .byte 0x5 160 .string "int" 161 .uleb128 0x6 162 .long .LASF3 163 .byte 0x1 164 .byte 0x1 165 .quad .LFB0 166 .quad .LFE0-.LFB0 167 .uleb128 0x1 168 .byte 0x9c 169 .long 0x99 170 .uleb128 0x3 171 .string "p" 172 .byte 0x1 173 .byte 0x1 174 .long 0x99 175 .uleb128 0x2 176 .byte 0x91 177 .sleb128 -24 178 .byte 0 179 .uleb128 0x7 180 .byte 0x8 181 .long 0x68 182 .byte 0 183 .section .debug_abbrev,"",@progbits 184 .Ldebug_abbrev0: 185 .uleb128 0x1 186 .uleb128 0x11 187 .byte 0x1 188 .uleb128 0x25 189 .uleb128 0xe 190 .uleb128 0x13 191 .uleb128 0xb 192 .uleb128 0x3 193 .uleb128 0xe 194 .uleb128 0x1b 195 .uleb128 0xe 196 .uleb128 0x11 197 .uleb128 0x1 198 .uleb128 0x12 199 .uleb128 0x7 200 .uleb128 0x10 201 .uleb128 0x17 202 .byte 0 203 .byte 0 204 .uleb128 0x2 205 .uleb128 0x2e 206 .byte 0x1 207 .uleb128 0x3f 208 .uleb128 0x19 209 .uleb128 0x3 210 .uleb128 0x8 211 .uleb128 0x3a 212 .uleb128 0xb 213 .uleb128 0x3b 214 .uleb128 0xb 215 .uleb128 0x27 216 .uleb128 0x19 217 .uleb128 0x49 218 .uleb128 0x13 219 .uleb128 0x11 220 .uleb128 0x1 221 .uleb128 0x12 222 .uleb128 0x7 223 .uleb128 0x40 224 .uleb128 0x18 225 .uleb128 0x2116 226 .uleb128 0x19 227 .uleb128 0x1 228 .uleb128 0x13 229 .byte 0 230 .byte 0 231 .uleb128 0x3 232 .uleb128 0x5 233 .byte 0 234 .uleb128 0x3 235 .uleb128 0x8 236 .uleb128 0x3a 237 .uleb128 0xb 238 .uleb128 0x3b 239 .uleb128 0xb 240 .uleb128 0x49 241 .uleb128 0x13 242 .uleb128 0x2 243 .uleb128 0x18 244 .byte 0 245 .byte 0 246 .uleb128 0x4 247 .uleb128 0x34 248 .byte 0 249 .uleb128 0x3 250 .uleb128 0x8 251 .uleb128 0x3a 252 .uleb128 0xb 253 .uleb128 0x3b 254 .uleb128 0xb 255 .uleb128 0x49 256 .uleb128 0x13 257 .uleb128 0x2 258 .uleb128 0x18 259 .byte 0 260 .byte 0 261 .uleb128 0x5 262 .uleb128 0x24 263 .byte 0 264 .uleb128 0xb 265 .uleb128 0xb 266 .uleb128 0x3e 267 .uleb128 0xb 268 .uleb128 0x3 269 .uleb128 0x8 270 .byte 0 271 .byte 0 272 .uleb128 0x6 273 .uleb128 0x2e 274 .byte 0x1 275 .uleb128 0x3f 276 .uleb128 0x19 277 .uleb128 0x3 278 .uleb128 0xe 279 .uleb128 0x3a 280 .uleb128 0xb 281 .uleb128 0x3b 282 .uleb128 0xb 283 .uleb128 0x27 284 .uleb128 0x19 285 .uleb128 0x11 286 .uleb128 0x1 287 .uleb128 0x12 288 .uleb128 0x7 289 .uleb128 0x40 290 .uleb128 0x18 291 .uleb128 0x2117 292 .uleb128 0x19 293 .uleb128 0x1 294 .uleb128 0x13 295 .byte 0 296 .byte 0 297 .uleb128 0x7 298 .uleb128 0xf 299 .byte 0 300 .uleb128 0xb 301 .uleb128 0xb 302 .uleb128 0x49 303 .uleb128 0x13 304 .byte 0 305 .byte 0 306 .byte 0 307 .section .debug_aranges,"",@progbits 308 .long 0x2c 309 .value 0x2 310 .long .Ldebug_info0 311 .byte 0x8 312 .byte 0 313 .value 0 314 .value 0 315 .quad .Ltext0 316 .quad .Letext0-.Ltext0 317 .quad 0 318 .quad 0 319 .section .debug_line,"",@progbits 320 .Ldebug_line0: 321 .section .debug_str,"MS",@progbits,1 322 .LASF0: 323 .string "GNU C11 7.4.0 -mtune=generic -march=x86-64 -g -fexceptions -fPIC -fstack-protector-strong" 324 .LASF2: 325 .string "/home/tdelisle/workspace/cforall/main/doc/working/exception/impl" 326 .LASF1: 327 .string "test.c" 328 .LASF3: 329 .string "clean" 103 330 .hidden DW.ref.__gcc_personality_v0 104 331 .weak DW.ref.__gcc_personality_v0 105 .section .data. DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat332 .section .data.rel.local.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat 106 333 .align 8 107 334 .type DW.ref.__gcc_personality_v0, @object … … 109 336 DW.ref.__gcc_personality_v0: 110 337 .quad __gcc_personality_v0 111 .ident "GCC: (Ubuntu 7. 3.0-21ubuntu1~16.04) 7.3.0"338 .ident "GCC: (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0" 112 339 .section .note.GNU-stack,"",@progbits
Note:
See TracChangeset
for help on using the changeset viewer.