Changes in / [4f7b418:09f357ec]
- Files:
-
- 7 added
- 11 deleted
- 30 edited
-
benchmark/Makefile.am (modified) (12 diffs)
-
benchmark/Makefile.in (modified) (11 diffs)
-
benchmark/creation/cfa_gen.cfa (deleted)
-
benchmark/ctxswitch/node_await.js (deleted)
-
benchmark/exclude (deleted)
-
benchmark/schedext/cfa1.cfa (modified) (1 diff)
-
benchmark/schedext/cfa2.cfa (modified) (1 diff)
-
benchmark/schedext/cfa4.cfa (modified) (1 diff)
-
benchmark/schedext/goroutine.go (deleted)
-
benchmark/schedext/upp.cc (modified) (3 diffs)
-
benchmark/schedint/JavaThread.java (modified) (1 diff)
-
benchmark/schedint/cfa1.cfa (modified) (3 diffs)
-
benchmark/schedint/cfa2.cfa (modified) (3 diffs)
-
benchmark/schedint/cfa4.cfa (modified) (3 diffs)
-
benchmark/schedint/pthreads.c (modified) (2 diffs)
-
benchmark/schedint/rust.rs (modified) (1 diff)
-
benchmark/schedint/upp.cc (modified) (2 diffs)
-
driver/cfa.cc (modified) (2 diffs)
-
libcfa/src/bits/defs.hfa (modified) (2 diffs)
-
libcfa/src/bits/signal.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (2 diffs)
-
libcfa/src/interpose.cfa (modified) (11 diffs)
-
libcfa/src/stdhdr/bfdlink.h (modified) (1 diff)
-
libcfa/src/stdhdr/hwloc.h (modified) (1 diff)
-
libcfa/src/stdhdr/krb5.h (modified) (1 diff)
-
libcfa/src/stdhdr/math.h (modified) (1 diff)
-
libcfa/src/stdhdr/sys/ucontext.h (modified) (1 diff)
-
src/ControlStruct/LabelFixer.cc (modified) (1 diff)
-
src/ControlStruct/MLEMutator.cc (modified) (3 diffs)
-
src/ControlStruct/MLEMutator.h (modified) (4 diffs)
-
src/Parser/lex.ll (modified) (2 diffs)
-
src/Parser/parser.yy (modified) (4 diffs)
-
tests/.expect/except-finally-error.txt (added)
-
tests/except-0.cfa (added)
-
tests/except-1.cfa (added)
-
tests/except-2.cfa (added)
-
tests/except-3.cfa (added)
-
tests/except-finally-error.cfa (added)
-
tests/except-mac.hfa (added)
-
tests/exceptions/.expect/finally-error.txt (deleted)
-
tests/exceptions/except-0.cfa (deleted)
-
tests/exceptions/except-1.cfa (deleted)
-
tests/exceptions/except-2.cfa (deleted)
-
tests/exceptions/except-3.cfa (deleted)
-
tests/exceptions/except-mac.hfa (deleted)
-
tests/exceptions/finally-error.cfa (deleted)
-
tests/expression.cfa (modified) (1 diff)
-
tests/quotedKeyword.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
r4f7b418 r09f357ec 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Jan 25 09:20:44202014 ## Update Count : 2 5513 ## Last Modified On : Mon Jan 20 11:50:13 2020 14 ## Update Count : 244 15 15 ############################################################################### 16 16 … … 75 75 .ONESHELL: # use one shell to execute recipe 76 76 .NOTPARALLEL: 77 .PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv s chedint.csv78 79 ## ========================================================================================================= 80 81 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) s chedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)77 .PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv signal.csv 78 79 ## ========================================================================================================= 80 81 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 82 82 83 83 basic_loop_DURATION = 15000000000 … … 89 89 ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION) 90 90 ctxswitch_cfa_generator_DURATION = 5000000000 91 ctxswitch_nodejs_await_DURATION = 500000092 91 ctxswitch_DURATION = 100000000 93 92 94 #mutex_java_DURATION = 1000000093 mutex_java_DURATION = 10000000 95 94 mutex_DURATION = 50000000 96 95 97 s chedint_pthread_DURATION = 100000098 s chedint_java_DURATION = $(schedint_pthread_DURATION)99 s chedint_rust_DURATION = $(schedint_pthread_DURATION)100 s chedint_DURATION = 10000000101 102 schedext_DURATION = 1000000096 signal_pthread_DURATION = 1000000 97 signal_java_DURATION = $(signal_pthread_DURATION) 98 signal_rust_DURATION = $(signal_pthread_DURATION) 99 signal_DURATION = 10000000 100 101 waitfor_DURATION = 10000000 103 102 104 103 creation_pthread_DURATION = 250000 105 creation_rust_thread_DURATION = ${creation_pthread_DURATION} 106 creation_java_thread_DURATION = ${creation_pthread_DURATION} 104 creation_rust_DURATION = ${creation_pthread_DURATION} 107 105 creation_cfa_coroutine_DURATION = 100000000 108 106 creation_cfa_coroutine_eager_DURATION = 10000000 … … 153 151 +make mutex.csv 154 152 -+make mutex.diff.csv 155 +make s chedint.csv156 -+make s chedint.diff.csv153 +make signal.csv 154 -+make signal.diff.csv 157 155 @DOifskipcompile@ 158 156 cat compile.csv … … 165 163 cat mutex.csv 166 164 -cat mutex.diff.csv 167 cat s chedint.csv168 -cat s chedint.diff.csv165 cat signal.csv 166 -cat signal.diff.csv 169 167 170 168 compile.csv: … … 200 198 $(srcdir)/fixcsv.sh $@ 201 199 202 s chedint.csv:203 echo "s chedint-1,schedint-2,schedext-1,schedext-2" > $@204 +make s chedint-cfa1.runquiet >> $@ && echo -n ',' >> $@205 +make s chedint-cfa2.runquiet >> $@ && echo -n ',' >> $@206 +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@207 +make schedext-cfa2.runquiet >> $@200 signal.csv: 201 echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@ 202 +make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@ 203 +make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@ 204 +make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@ 205 +make waitfor-cfa2.runquiet >> $@ 208 206 $(srcdir)/fixcsv.sh $@ 209 207 … … 249 247 ctxswitch-python_coroutine.run \ 250 248 ctxswitch-nodejs_coroutine.run \ 251 ctxswitch-nodejs_await.run \252 249 ctxswitch-goroutine_thread.run \ 253 250 ctxswitch-rust_thread.run \ … … 296 293 echo "#!/bin/sh" > a.out 297 294 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 298 chmod a+x a.out299 300 ctxswitch-nodejs_await$(EXEEXT):301 echo "#!/bin/sh" > a.out302 echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out303 295 chmod a+x a.out 304 296 … … 359 351 ## ========================================================================================================= 360 352 361 schedint$(EXEEXT) : \ 362 schedint-cfa1.run \ 363 schedint-cfa2.run \ 364 schedint-cfa4.run \ 365 schedint-upp.run \ 366 schedint-rust.run \ 367 schedint-java.run \ 368 schedint-pthread.run 369 370 schedint-cfa1$(EXEEXT): 353 signal$(EXEEXT) : \ 354 signal-cfa1.run \ 355 signal-cfa2.run \ 356 signal-cfa4.run \ 357 signal-upp.run \ 358 signal-rust.run \ 359 signal-java.run \ 360 signal-pthread.run 361 362 signal-pthread$(EXEEXT): 363 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 364 365 signal-upp$(EXEEXT): 366 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 367 368 signal-cfa1$(EXEEXT): 371 369 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa 372 370 373 s chedint-cfa2$(EXEEXT):371 signal-cfa2$(EXEEXT): 374 372 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa 375 373 376 s chedint-cfa4$(EXEEXT):374 signal-cfa4$(EXEEXT): 377 375 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa 378 376 379 schedint-upp$(EXEEXT): 380 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 381 382 schedint-rust$(EXEEXT): 377 signal-rust$(EXEEXT): 383 378 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs 384 379 385 s chedint-java$(EXEEXT):380 signal-java$(EXEEXT): 386 381 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 387 382 echo "#!/bin/sh" > a.out … … 389 384 chmod a+x a.out 390 385 391 schedint-pthread$(EXEEXT): 392 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 393 394 ## ========================================================================================================= 395 396 schedext$(EXEEXT) : \ 397 schedext-cfa1.run \ 398 schedext-cfa2.run \ 399 schedext-cfa4.run \ 400 schedext-upp.run \ 401 schedext-goroutine.run 402 403 schedext-cfa1$(EXEEXT): 386 ## ========================================================================================================= 387 388 waitfor$(EXEEXT) : \ 389 waitfor-cfa1.run \ 390 waitfor-cfa2.run \ 391 waitfor-cfa4.run \ 392 waitfor-upp.run 393 394 waitfor-upp$(EXEEXT): 395 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc 396 397 waitfor-cfa1$(EXEEXT): 404 398 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa 405 399 406 schedext-cfa2$(EXEEXT):400 waitfor-cfa2$(EXEEXT): 407 401 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa 408 402 409 schedext-cfa4$(EXEEXT):403 waitfor-cfa4$(EXEEXT): 410 404 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa 411 405 412 schedext-upp$(EXEEXT):413 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc414 415 schedext-goroutine$(EXEEXT):416 $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go417 418 419 406 ## ========================================================================================================= 420 407 421 408 creation$(EXEEXT) : \ 422 creation-cfa_generator.run \423 409 creation-cfa_coroutine.run \ 424 410 creation-cfa_coroutine_eager.run \ … … 433 419 creation-pthread.run 434 420 435 creation-cfa_generator$(EXEEXT):436 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa437 438 421 creation-cfa_coroutine$(EXEEXT): 439 422 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa … … 467 450 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs 468 451 469 creation-java _thread$(EXEEXT):452 creation-java$(EXEEXT): 470 453 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 471 454 echo "#!/bin/sh" > a.out -
benchmark/Makefile.in
r4f7b418 r09f357ec 426 426 ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION) 427 427 ctxswitch_cfa_generator_DURATION = 5000000000 428 ctxswitch_nodejs_await_DURATION = 5000000429 428 ctxswitch_DURATION = 100000000 430 431 #mutex_java_DURATION = 10000000 429 mutex_java_DURATION = 10000000 432 430 mutex_DURATION = 50000000 433 s chedint_pthread_DURATION = 1000000434 s chedint_java_DURATION = $(schedint_pthread_DURATION)435 s chedint_rust_DURATION = $(schedint_pthread_DURATION)436 s chedint_DURATION = 10000000437 schedext_DURATION = 10000000431 signal_pthread_DURATION = 1000000 432 signal_java_DURATION = $(signal_pthread_DURATION) 433 signal_rust_DURATION = $(signal_pthread_DURATION) 434 signal_DURATION = 10000000 435 waitfor_DURATION = 10000000 438 436 creation_pthread_DURATION = 250000 439 creation_rust_thread_DURATION = ${creation_pthread_DURATION} 440 creation_java_thread_DURATION = ${creation_pthread_DURATION} 437 creation_rust_DURATION = ${creation_pthread_DURATION} 441 438 creation_cfa_coroutine_DURATION = 100000000 442 439 creation_cfa_coroutine_eager_DURATION = 10000000 … … 457 454 ctxswitch-cfa_thread2.run ctxswitch-upp_coroutine.run \ 458 455 ctxswitch-upp_thread.run ctxswitch-python_coroutine.run \ 459 ctxswitch-nodejs_coroutine.run ctxswitch- nodejs_await.run \460 ctxswitch- goroutine_thread.run ctxswitch-rust_thread.run \461 ctxswitch- nodejs_coroutine.run ctxswitch-java_thread.run \462 ctxswitch-pthread.run$(am__append_1)456 ctxswitch-nodejs_coroutine.run ctxswitch-goroutine_thread.run \ 457 ctxswitch-rust_thread.run ctxswitch-nodejs_coroutine.run \ 458 ctxswitch-java_thread.run ctxswitch-pthread.run \ 459 $(am__append_1) 463 460 testdir = $(top_srcdir)/tests 464 461 all: all-am … … 787 784 .ONESHELL: # use one shell to execute recipe 788 785 .NOTPARALLEL: 789 .PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv s chedint.csv790 791 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) s chedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)786 .PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv signal.csv 787 788 all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 792 789 793 790 %.run : %$(EXEEXT) ${REPEAT} … … 828 825 +make mutex.csv 829 826 -+make mutex.diff.csv 830 +make s chedint.csv831 -+make s chedint.diff.csv827 +make signal.csv 828 -+make signal.diff.csv 832 829 @DOifskipcompile@ 833 830 cat compile.csv … … 840 837 cat mutex.csv 841 838 -cat mutex.diff.csv 842 cat s chedint.csv843 -cat s chedint.diff.csv839 cat signal.csv 840 -cat signal.diff.csv 844 841 845 842 compile.csv: … … 875 872 $(srcdir)/fixcsv.sh $@ 876 873 877 s chedint.csv:878 echo "s chedint-1,schedint-2,schedext-1,schedext-2" > $@879 +make s chedint-cfa1.runquiet >> $@ && echo -n ',' >> $@880 +make s chedint-cfa2.runquiet >> $@ && echo -n ',' >> $@881 +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@882 +make schedext-cfa2.runquiet >> $@874 signal.csv: 875 echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@ 876 +make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@ 877 +make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@ 878 +make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@ 879 +make waitfor-cfa2.runquiet >> $@ 883 880 $(srcdir)/fixcsv.sh $@ 884 881 … … 938 935 echo "#!/bin/sh" > a.out 939 936 echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out 940 chmod a+x a.out941 942 ctxswitch-nodejs_await$(EXEEXT):943 echo "#!/bin/sh" > a.out944 echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out945 937 chmod a+x a.out 946 938 … … 997 989 chmod a+x a.out 998 990 999 schedint$(EXEEXT) : \ 1000 schedint-cfa1.run \ 1001 schedint-cfa2.run \ 1002 schedint-cfa4.run \ 1003 schedint-upp.run \ 1004 schedint-rust.run \ 1005 schedint-java.run \ 1006 schedint-pthread.run 1007 1008 schedint-cfa1$(EXEEXT): 991 signal$(EXEEXT) : \ 992 signal-cfa1.run \ 993 signal-cfa2.run \ 994 signal-cfa4.run \ 995 signal-upp.run \ 996 signal-rust.run \ 997 signal-java.run \ 998 signal-pthread.run 999 1000 signal-pthread$(EXEEXT): 1001 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 1002 1003 signal-upp$(EXEEXT): 1004 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 1005 1006 signal-cfa1$(EXEEXT): 1009 1007 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa 1010 1008 1011 s chedint-cfa2$(EXEEXT):1009 signal-cfa2$(EXEEXT): 1012 1010 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa 1013 1011 1014 s chedint-cfa4$(EXEEXT):1012 signal-cfa4$(EXEEXT): 1015 1013 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa 1016 1014 1017 schedint-upp$(EXEEXT): 1018 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc 1019 1020 schedint-rust$(EXEEXT): 1015 signal-rust$(EXEEXT): 1021 1016 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs 1022 1017 1023 s chedint-java$(EXEEXT):1018 signal-java$(EXEEXT): 1024 1019 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java 1025 1020 echo "#!/bin/sh" > a.out … … 1027 1022 chmod a+x a.out 1028 1023 1029 schedint-pthread$(EXEEXT): 1030 $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c 1031 1032 schedext$(EXEEXT) : \ 1033 schedext-cfa1.run \ 1034 schedext-cfa2.run \ 1035 schedext-cfa4.run \ 1036 schedext-upp.run \ 1037 schedext-goroutine.run 1038 1039 schedext-cfa1$(EXEEXT): 1024 waitfor$(EXEEXT) : \ 1025 waitfor-cfa1.run \ 1026 waitfor-cfa2.run \ 1027 waitfor-cfa4.run \ 1028 waitfor-upp.run 1029 1030 waitfor-upp$(EXEEXT): 1031 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc 1032 1033 waitfor-cfa1$(EXEEXT): 1040 1034 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa 1041 1035 1042 schedext-cfa2$(EXEEXT):1036 waitfor-cfa2$(EXEEXT): 1043 1037 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa 1044 1038 1045 schedext-cfa4$(EXEEXT):1039 waitfor-cfa4$(EXEEXT): 1046 1040 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa 1047 1041 1048 schedext-upp$(EXEEXT):1049 $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc1050 1051 schedext-goroutine$(EXEEXT):1052 $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go1053 1054 1042 creation$(EXEEXT) : \ 1055 creation-cfa_generator.run \1056 1043 creation-cfa_coroutine.run \ 1057 1044 creation-cfa_coroutine_eager.run \ … … 1066 1053 creation-pthread.run 1067 1054 1068 creation-cfa_generator$(EXEEXT):1069 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa1070 1071 1055 creation-cfa_coroutine$(EXEEXT): 1072 1056 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa … … 1100 1084 $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs 1101 1085 1102 creation-java _thread$(EXEEXT):1086 creation-java$(EXEEXT): 1103 1087 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java 1104 1088 echo "#!/bin/sh" > a.out -
benchmark/schedext/cfa1.cfa
r4f7b418 r09f357ec 6 6 #include "../bench.h" 7 7 8 volatile int go = 0; 9 8 10 monitor M {} m1; 9 11 10 12 void __attribute__((noinline)) call( M & mutex p1 ) {} 13 11 14 void __attribute__((noinline)) wait( M & mutex p1 ) { 15 go = 1; 12 16 for ( times ) { 13 17 waitfor( call : p1 ); 14 18 } 19 go = 0; 15 20 } 16 21 17 22 thread T {}; 18 23 void main( T & ) { 24 while ( go == 0 ) { yield(); } 19 25 BENCH( 20 for ( times) { call( m1 ); },26 while ( go == 1 ) { call( m1 ); }, 21 27 result 22 28 ) -
benchmark/schedext/cfa2.cfa
r4f7b418 r09f357ec 4 4 #include <stdio.h> 5 5 6 #include "../bench.h" 6 #include "bench.h" 7 8 volatile int go = 0; 7 9 8 10 monitor M {} m1, m2; 9 11 10 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 13 11 14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 15 go = 1; 12 16 for ( times ) { 13 17 waitfor( call : p1, p2 ); 14 18 } 19 go = 0; 15 20 } 21 16 22 thread T {}; 17 23 void main( T & ) { 24 while( go == 0 ) { yield(); } 18 25 BENCH( 19 for ( times ) { 20 call( m1, m2 ); 21 }, 26 while ( go == 1 ) { call( m1, m2 ); }, 22 27 result 23 28 ) -
benchmark/schedext/cfa4.cfa
r4f7b418 r09f357ec 4 4 #include <stdio.h> 5 5 6 #include "../bench.h" 6 #include "bench.h" 7 8 volatile int go = 0; 7 9 8 10 monitor M {} m1, m2, m3, m4; 9 11 10 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} 13 11 14 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 15 go = 1; 12 16 for ( times ) { 13 17 waitfor( call : p1, p2, p3, p4 ); 14 18 } 19 go = 0; 15 20 } 21 16 22 thread T {}; 17 23 void main( T & ) { 24 while( go == 0 ) { yield(); } 18 25 BENCH( 19 for ( times ) { 20 call( m1, m2, m3, m4 ); 21 }, 26 while( go == 1 ) { call( m1, m2, m3, m4 ); }, 22 27 result 23 28 ) -
benchmark/schedext/upp.cc
r4f7b418 r09f357ec 3 3 #include "bench.h" 4 4 5 volatile int go = 0; 6 5 7 _Monitor M { 6 8 public: 7 9 void __attribute__((noinline)) call() {} 8 void __attribute__((noinline)) wait() { 10 11 int __attribute__((noinline)) wait() { 12 go = 1; 9 13 for ( size_t i = 0; i < times; i++ ) { 10 14 _Accept(call); 11 15 } 16 go = 0; 17 return 0; 12 18 } 13 19 } m; … … 15 21 _Task T { 16 22 void main() { 23 while ( go == 0 ) { yield(); } 17 24 BENCH( 18 for ( size_t i = 0; i < times; i++ ) { 19 m.call(); 20 }, 25 while ( go == 1 ) { m.call(); }, 21 26 result 22 27 ) … … 28 33 BENCH_START() 29 34 T t; 30 m.wait();35 return m.wait(); 31 36 } 32 37 -
benchmark/schedint/JavaThread.java
r4f7b418 r09f357ec 63 63 synchronized(m) { 64 64 s.start(); 65 while( ! Monitor.go ) { // waiter must start first65 while( !Monitor.go ) { 66 66 Thread.yield(); 67 67 } -
benchmark/schedint/cfa1.cfa
r4f7b418 r09f357ec 7 7 8 8 volatile int go = 0; 9 10 9 condition c; 11 10 monitor M {} m1; … … 14 13 signal( c ); 15 14 } 15 16 16 void __attribute__((noinline)) wait( M & mutex p1 ) { 17 17 go = 1; … … 19 19 wait( c ); 20 20 } 21 go = 0; 21 22 } 22 23 23 24 thread T {}; 24 25 void main( T & ) { 25 while ( go == 0 ) { yield(); } // waiter must start first26 while ( go == 0 ) { yield(); } 26 27 BENCH( 27 for ( times) { call( m1 ); },28 while ( go == 1 ) { call( m1 ); }, 28 29 result 29 30 ) -
benchmark/schedint/cfa2.cfa
r4f7b418 r09f357ec 7 7 8 8 volatile int go = 0; 9 10 9 condition c; 11 10 monitor M {} m1, m2; … … 14 13 signal( c ); 15 14 } 15 16 16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 17 17 go = 1; … … 19 19 wait( c ); 20 20 } 21 go = 0; 21 22 } 22 23 23 24 thread T {}; 24 25 void main( T & ) { 25 while ( go == 0 ) { yield(); } // waiter must start first26 while ( go == 0 ) { yield(); } 26 27 BENCH( 27 for ( times) { call( m1, m2 ); },28 while ( go == 1 ) { call( m1, m2 ); }, 28 29 result 29 30 ) -
benchmark/schedint/cfa4.cfa
r4f7b418 r09f357ec 4 4 #include <stdio.h> 5 5 6 #include " ../bench.h"6 #include "bench.h" 7 7 8 8 volatile int go = 0; 9 10 9 condition c; 11 10 monitor M {} m1, m2, m3, m4; … … 14 13 signal( c ); 15 14 } 15 16 16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 17 17 go = 1; … … 19 19 wait( c ); 20 20 } 21 go = 0; 21 22 } 22 23 23 24 thread T {}; 24 25 void main( T & ) { 25 while ( go == 0 ) { yield(); } // waiter must start first26 while ( go == 0 ) { yield(); } 26 27 BENCH( 27 for ( times) { call( m1, m2, m3, m4 ); },28 while ( go == 1 ) { call( m1, m2, m3, m4 ); }, 28 29 result 29 30 ) -
benchmark/schedint/pthreads.c
r4f7b418 r09f357ec 6 6 volatile int go = 0; 7 7 8 pthread_cond_t c; 8 9 pthread_mutex_t m; 9 pthread_cond_t c;10 10 11 11 void __attribute__((noinline)) call() { 12 pthread_mutex_lock( &m);13 pthread_cond_signal( &c);14 pthread_mutex_unlock( &m);12 pthread_mutex_lock(&m); 13 pthread_cond_signal(&c); 14 pthread_mutex_unlock(&m); 15 15 } 16 16 17 void__attribute__((noinline)) wait() {17 int __attribute__((noinline)) wait() { 18 18 pthread_mutex_lock(&m); 19 19 go = 1; 20 for ( size_t i = 0; i < times; i++ ) {21 pthread_cond_wait( &c, &m );22 }23 go = 0;24 pthread_mutex_unlock( &m );25 }26 27 void * thread_main( __attribute__((unused)) void * arg ) {28 while ( go == 0 ) { sched_yield(); } // waiter must start first29 // barging for lock acquire => may not execute N times30 20 BENCH( 31 while ( go == 1 ) { call(); }, 21 for (size_t i = 0; i < times; i++) { 22 pthread_cond_wait(&c, &m); 23 }, 32 24 result 33 25 ) 34 26 printf( "%g\n", result ); 27 go = 0; 28 pthread_mutex_unlock(&m); 29 return 0; 30 } 31 32 void* thread_main(__attribute__((unused)) void * arg ) { 33 while(go == 0) { sched_yield(); } 34 while(go == 1) { call(); } 35 35 return NULL; 36 36 } … … 39 39 BENCH_START() 40 40 pthread_t thread; 41 if ( pthread_create( &thread, NULL, thread_main, NULL ) < 0) {41 if (pthread_create(&thread, NULL, thread_main, NULL) < 0) { 42 42 perror( "failure" ); 43 43 return 1; 44 44 } 45 45 wait(); 46 if ( pthread_join( thread, NULL ) < 0) {46 if (pthread_join( thread, NULL) < 0) { 47 47 perror( "failure" ); 48 48 return 1; -
benchmark/schedint/rust.rs
r4f7b418 r09f357ec 18 18 19 19 let th = thread::spawn( move || { 20 while *m2.lock().unwrap() == 0 { // waiter must start first20 while *m2.lock().unwrap() == 0 { 21 21 thread::yield_now(); 22 22 } -
benchmark/schedint/upp.cc
r4f7b418 r09f357ec 11 11 cond.signal(); 12 12 } 13 void __attribute__((noinline)) wait() { 13 14 int __attribute__((noinline)) wait() { 14 15 go = 1; 15 for ( size_t i = 0; i < times; i++ ) {16 cond.wait();17 }18 }19 } m;20 21 _Task T {22 void main() {23 while ( go == 0 ) { yield(); } // waiter must start first24 16 BENCH( 25 for ( size_t i = 0; i < times; i++) {26 m.call();17 for (size_t i = 0; i < times; i++) { 18 cond.wait(); 27 19 }, 28 20 result 29 21 ) 30 22 printf( "%g\n", result ); 23 go = 0; 24 return 0; 25 } 26 }; 27 28 M m; 29 30 _Task T { 31 void main() { 32 while(go == 0) { yield(); } 33 while(go == 1) { m.call(); } 34 31 35 } 32 36 }; … … 35 39 BENCH_START() 36 40 T t; 37 m.wait();41 return m.wait(); 38 42 } 39 43 -
driver/cfa.cc
r4f7b418 r09f357ec 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 31 16:48:03 202013 // Update Count : 42 112 // Last Modified On : Tue Sep 10 17:00:15 2019 13 // Update Count : 420 14 14 // 15 15 … … 187 187 } else if ( arg == "-XCFA" ) { // CFA pass through 188 188 i += 1; 189 if ( i == argc ) continue; // next argument available ?190 189 Putenv( argv, argv[i] ); 191 190 -
libcfa/src/bits/defs.hfa
r4f7b418 r09f357ec 10 10 // Created On : Thu Nov 9 13:24:10 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jan 28 22:38:27 202013 // Update Count : 912 // Last Modified On : Thu Feb 8 16:22:41 2018 13 // Update Count : 8 14 14 // 15 15 … … 34 34 35 35 #ifdef __cforall 36 void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 37 void abort( bool signalAbort, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); 36 void abort ( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 38 37 extern "C" { 39 38 #endif -
libcfa/src/bits/signal.hfa
r4f7b418 r09f357ec 40 40 sigaddset( &act.sa_mask, SIGALRM ); // disabled during signal handler 41 41 sigaddset( &act.sa_mask, SIGUSR1 ); 42 sigaddset( &act.sa_mask, SIGSEGV );43 sigaddset( &act.sa_mask, SIGBUS );44 sigaddset( &act.sa_mask, SIGILL );45 sigaddset( &act.sa_mask, SIGFPE );46 sigaddset( &act.sa_mask, SIGHUP ); // revert to default on second delivery47 sigaddset( &act.sa_mask, SIGTERM );48 sigaddset( &act.sa_mask, SIGINT );49 42 act.sa_flags = flags; 50 43 51 if ( sigaction( sig, &act, 0p) == -1 ) {44 if ( sigaction( sig, &act, NULL ) == -1 ) { 52 45 __cfaabi_dbg_print_buffer_decl( 53 46 " __cfaabi_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n", … … 55 48 ); 56 49 _exit( EXIT_FAILURE ); 57 } // if50 } 58 51 } 52 53 // Sigaction wrapper : restore default handler 54 static void __cfaabi_sigdefault( int sig ) { 55 struct sigaction act; 56 57 act.sa_handler = SIG_DFL; 58 act.sa_flags = 0; 59 sigemptyset( &act.sa_mask ); 60 61 if ( sigaction( sig, &act, NULL ) == -1 ) { 62 __cfaabi_dbg_print_buffer_decl( 63 " __cfaabi_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n", 64 sig, errno, strerror( errno ) 65 ); 66 _exit( EXIT_FAILURE ); 67 } 68 } -
libcfa/src/concurrency/kernel.cfa
r4f7b418 r09f357ec 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 30 22:55:50 202013 // Update Count : 5 612 // Last Modified On : Thu Dec 5 16:25:52 2019 13 // Update Count : 52 14 14 // 15 15 … … 844 844 sigemptyset( &mask ); 845 845 sigaddset( &mask, SIGALRM ); // block SIGALRM signals 846 sigaddset( &mask, SIGUSR1 ); // block SIGALRM signals 847 sigsuspend( &mask ); // block the processor to prevent further damage during abort 848 _exit( EXIT_FAILURE ); // if processor unblocks before it is killed, terminate it 846 sigsuspend( &mask ); // block the processor to prevent further damage during abort 847 _exit( EXIT_FAILURE ); // if processor unblocks before it is killed, terminate it 849 848 } 850 849 else { -
libcfa/src/interpose.cfa
r4f7b418 r09f357ec 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 30 17:47:32 202013 // Update Count : 1 5612 // Last Modified On : Fri Dec 13 13:45:21 2019 13 // Update Count : 121 14 14 // 15 15 … … 95 95 void __cfaabi_interpose_startup(void) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) )); 96 96 void __cfaabi_interpose_startup( void ) { 97 const char *version = 0p;97 const char *version = NULL; 98 98 99 99 preload_libgcc(); … … 105 105 #pragma GCC diagnostic pop 106 106 107 // As a precaution (and necessity), errors that result in termination are delivered on a separate stack because108 // task stacks might be very small (4K) and the signal delivery corrupts memory to the point that a clean109 // shutdown is impossible. Also, when a stack overflow encounters the non-accessible sentinel page (debug only)110 // and generates a segment fault, the signal cannot be delivered on the sentinel page. Finally, calls to abort111 // print a stack trace that uses substantial stack space.112 113 #define MINSTKSZ SIGSTKSZ * 8114 static char stack[MINSTKSZ] __attribute__(( aligned (16) ));115 static stack_t ss;116 117 ss.ss_sp = stack;118 ss.ss_size = MINSTKSZ;119 ss.ss_flags = 0;120 if ( sigaltstack( &ss, 0p ) == -1 ) {121 abort( "__cfaabi_interpose_startup : internal error, sigaltstack error(%d) %s.", errno, strerror( errno ) );122 } // if123 124 107 // Failure handler 125 __cfaabi_sigaction( SIGSEGV, sigHandler_segv, SA_SIGINFO | SA_ONSTACK ); 126 __cfaabi_sigaction( SIGBUS , sigHandler_segv, SA_SIGINFO | SA_ONSTACK ); 127 __cfaabi_sigaction( SIGILL , sigHandler_ill , SA_SIGINFO | SA_ONSTACK ); 128 __cfaabi_sigaction( SIGFPE , sigHandler_fpe , SA_SIGINFO | SA_ONSTACK ); 129 __cfaabi_sigaction( SIGTERM, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // one shot handler, return to default 130 __cfaabi_sigaction( SIGINT , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); 131 __cfaabi_sigaction( SIGABRT, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); 132 __cfaabi_sigaction( SIGHUP , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // terminal hangup 108 __cfaabi_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO ); 109 __cfaabi_sigaction( SIGBUS , sigHandler_segv , SA_SIGINFO ); 110 __cfaabi_sigaction( SIGILL , sigHandler_ill , SA_SIGINFO ); 111 __cfaabi_sigaction( SIGFPE , sigHandler_fpe , SA_SIGINFO ); 112 __cfaabi_sigaction( SIGABRT, sigHandler_abrt, SA_SIGINFO | SA_RESETHAND); 113 __cfaabi_sigaction( SIGTERM, sigHandler_term , SA_SIGINFO ); 114 __cfaabi_sigaction( SIGINT , sigHandler_term , SA_SIGINFO ); 133 115 } 134 116 } … … 141 123 void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); 142 124 void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 143 void abort( bool signalAbort, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));144 125 145 126 extern "C" { 146 127 void abort( void ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) { 147 abort( false, NULL ); // FIX ME: 0p does not work128 abort( NULL ); 148 129 } 149 130 … … 151 132 va_list argp; 152 133 va_start( argp, fmt ); 153 abort( f alse, fmt, argp );134 abort( fmt, argp ); 154 135 va_end( argp ); 155 136 } … … 160 141 } 161 142 162 void * kernel_abort( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 0p; } 163 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {} 164 // See concurrency/kernel.cfa for strong definition used in multi-processor mode. 143 void * kernel_abort ( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return NULL; } 144 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {} 165 145 int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; } 166 146 167 147 enum { abort_text_size = 1024 }; 168 148 static char abort_text[ abort_text_size ]; 169 170 static void __cfaabi_backtrace( int start ) { 149 static int abort_lastframe; 150 151 void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )) { 152 va_list args; 153 va_start( args, fmt ); 154 vfprintf( stderr, fmt, args ); 155 va_end( args ); 156 __cabi_libc.exit( status ); 157 } 158 159 void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) { 160 void * kernel_data = kernel_abort(); // must be done here to lock down kernel 161 int len; 162 163 abort_lastframe = kernel_abort_lastframe(); 164 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld) ", (long int)getpid() ); // use UNIX pid (versus getPid) 165 __cfaabi_dbg_write( abort_text, len ); 166 167 if ( fmt ) { 168 va_list args; 169 va_start( args, fmt ); 170 171 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 172 va_end( args ); 173 __cfaabi_dbg_write( abort_text, len ); 174 175 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text 176 __cfaabi_dbg_write( "\n", 1 ); 177 } 178 } 179 180 kernel_abort_msg( kernel_data, abort_text, abort_text_size ); 181 __cabi_libc.abort(); 182 } 183 184 static void __cfaabi_backtrace() { 171 185 enum { 172 186 Frames = 50, // maximum number of stack frames 187 Start = 8, // skip first N stack frames 173 188 }; 174 int last = kernel_abort_lastframe(); // skip last N stack frames175 189 176 190 void * array[Frames]; … … 178 192 char ** messages = backtrace_symbols( array, size ); 179 193 180 *index( messages[0], '(' ) = '\0'; // find executable name 194 // find executable name 195 *index( messages[0], '(' ) = '\0'; 181 196 __cfaabi_bits_print_nolock( STDERR_FILENO, "Stack back trace for: %s\n", messages[0]); 182 197 183 for ( unsigned int i = start; i < size - last&& messages != 0p; i += 1 ) {198 for ( int i = Start; i < size - abort_lastframe && messages != 0p; i += 1 ) { 184 199 char * name = 0p, * offset_begin = 0p, * offset_end = 0p; 185 200 186 for ( char * p = messages[i]; *p; ++p ) { // find parantheses and +offset201 for ( char * p = messages[i]; *p; ++p ) { 187 202 //__cfaabi_bits_print_nolock( "X %s\n", p); 203 // find parantheses and +offset 188 204 if ( *p == '(' ) { 189 205 name = p; … … 196 212 } 197 213 198 // if line contains symbol ,print it199 int frameNo = i - start;214 // if line contains symbol print it 215 int frameNo = i - Start; 200 216 if ( name && offset_begin && offset_end && name < offset_begin ) { 201 *name++ = '\0'; // delimit strings 217 // delimit strings 218 *name++ = '\0'; 202 219 *offset_begin++ = '\0'; 203 220 *offset_end++ = '\0'; … … 211 228 } 212 229 213 void exit( int status, const char fmt[], ... ) {214 va_list args;215 va_start( args, fmt );216 vfprintf( stderr, fmt, args );217 va_end( args );218 __cabi_libc.exit( status );219 }220 221 void abort( bool signalAbort, const char fmt[], ... ) {222 void * kernel_data = kernel_abort(); // must be done here to lock down kernel223 int len;224 225 signal( SIGABRT, SIG_DFL ); // prevent final "real" abort from recursing to handler226 227 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld) ", (long int)getpid() ); // use UNIX pid (versus getPid)228 __cfaabi_bits_write( STDERR_FILENO, abort_text, len );229 230 if ( fmt ) {231 va_list args;232 va_start( args, fmt );233 234 len = vsnprintf( abort_text, abort_text_size, fmt, args );235 va_end( args );236 __cfaabi_bits_write( STDERR_FILENO, abort_text, len );237 238 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text239 __cfaabi_dbg_write( "\n", 1 );240 }241 }242 243 kernel_abort_msg( kernel_data, abort_text, abort_text_size );244 __cfaabi_backtrace( signalAbort ? 4 : 3 );245 246 __cabi_libc.abort(); // print stack trace in handler247 }248 249 void abort( const char fmt[], ... ) {250 va_list args;251 va_start( args, fmt );252 abort( false, fmt, args );253 va_end( args );254 }255 256 230 void sigHandler_segv( __CFA_SIGPARMS__ ) { 257 if ( sfp->si_addr == 0p) {258 abort( true,"Null pointer (0p) dereference.\n" );231 if ( sfp->si_addr == NULL ) { 232 abort( "Null pointer (0p) dereference.\n" ); 259 233 } else { 260 abort( true,"%s at memory location %p.\n"234 abort( "%s at memory location %p.\n" 261 235 "Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript.\n", 262 236 (sig == SIGSEGV ? "Segment fault" : "Bus error"), sfp->si_addr ); … … 265 239 266 240 void sigHandler_ill( __CFA_SIGPARMS__ ) { 267 abort( true,"Executing illegal instruction at location %p.\n"241 abort( "Executing illegal instruction at location %p.\n" 268 242 "Possible cause is stack corruption.\n", 269 243 sfp->si_addr ); … … 281 255 default: msg = "unknown"; 282 256 } // choose 283 abort( true, "Computation error %s at location %p.\n", msg, sfp->si_addr ); 257 abort( "Computation error %s at location %p.\n", msg, sfp->si_addr ); 258 } 259 260 void sigHandler_abrt( __CFA_SIGPARMS__ ) { 261 __cfaabi_backtrace(); 262 263 // reset default signal handler 264 __cfaabi_sigdefault( SIGABRT ); 265 266 raise( SIGABRT ); 284 267 } 285 268 286 269 void sigHandler_term( __CFA_SIGPARMS__ ) { 287 abort( true, "Application interrupted by signal: %s.\n", strsignal( sig ));270 abort( "Application stopped by %s signal.", sig == SIGINT ? "an interrupt (SIGINT)" : "a terminate (SIGTERM)" ); 288 271 } 289 272 -
libcfa/src/stdhdr/bfdlink.h
r4f7b418 r09f357ec 10 10 // Created On : Tue Jul 18 07:26:04 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Feb 1 07:15:29 202013 // Update Count : 512 // Last Modified On : Sun Jul 22 13:49:30 2018 13 // Update Count : 4 14 14 // 15 15 16 16 // include file uses the CFA keyword "with". 17 17 #if ! defined( with ) // nesting ? 18 #define with ` `with``// make keyword an identifier18 #define with `with` // make keyword an identifier 19 19 #define __CFA_BFDLINK_H__ 20 20 #endif -
libcfa/src/stdhdr/hwloc.h
r4f7b418 r09f357ec 10 10 // Created On : Tue Jul 18 07:45:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Feb 1 07:15:39 202013 // Update Count : 512 // Last Modified On : Sun Jul 22 13:49:58 2018 13 // Update Count : 4 14 14 // 15 15 16 16 // include file uses the CFA keyword "thread". 17 17 #if ! defined( thread ) // nesting ? 18 #define thread ` `thread``// make keyword an identifier18 #define thread `thread` // make keyword an identifier 19 19 #define __CFA_HWLOC_H__ 20 20 #endif -
libcfa/src/stdhdr/krb5.h
r4f7b418 r09f357ec 10 10 // Created On : Tue Jul 18 07:55:44 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Feb 1 07:15:47 202013 // Update Count : 512 // Last Modified On : Sun Jul 22 13:50:24 2018 13 // Update Count : 4 14 14 // 15 15 16 16 // include file uses the CFA keyword "enable". 17 17 #if ! defined( enable ) // nesting ? 18 #define enable ` `enable``// make keyword an identifier18 #define enable `enable` // make keyword an identifier 19 19 #define __CFA_KRB5_H__ 20 20 #endif -
libcfa/src/stdhdr/math.h
r4f7b418 r09f357ec 10 10 // Created On : Mon Jul 4 23:25:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 07:15:58 202013 // Update Count : 1 412 // Last Modified On : Thu Feb 22 18:16:07 2018 13 // Update Count : 13 14 14 // 15 15 16 16 extern "C" { 17 17 #if ! defined( exception ) // nesting ? 18 #define exception ` `exception`` // make keyword an identifier18 #define exception `exception` // make keyword an identifier 19 19 #define __CFA_MATH_H__ 20 20 #endif -
libcfa/src/stdhdr/sys/ucontext.h
r4f7b418 r09f357ec 10 10 // Created On : Thu Feb 8 23:48:16 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 07:16:05 202013 // Update Count : 512 // Last Modified On : Thu Feb 8 23:50:44 2018 13 // Update Count : 4 14 14 // 15 15 16 16 #if ! defined( ftype ) // nesting ? 17 #define ftype ` `ftype`` // make keyword an identifier17 #define ftype `ftype` // make keyword an identifier 18 18 #define __CFA_UCONTEXT_H__ 19 19 #endif -
src/ControlStruct/LabelFixer.cc
r4f7b418 r09f357ec 45 45 void LabelFixer::postvisit( FunctionDecl * functionDecl ) { 46 46 PassVisitor<MultiLevelExitMutator> mlem( resolveJumps(), generator ); 47 // We start in the body so we can stop when we hit another FunctionDecl. 48 maybeMutate( functionDecl->statements, mlem ); 47 functionDecl->acceptMutator( mlem ); 49 48 } 50 49 -
src/ControlStruct/MLEMutator.cc
r4f7b418 r09f357ec 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jan 22 11:50:00 202013 // Update Count : 22 312 // Last Modified On : Tue Jan 21 10:33:00 2020 13 // Update Count : 222 14 14 // 15 15 … … 60 60 } 61 61 } // namespace 62 63 void MultiLevelExitMutator::premutate( FunctionDecl * ) {64 visit_children = false;65 }66 62 67 63 // break labels have to come after the statement they break out of, so mutate a statement, then if they inform us … … 356 352 }); 357 353 enclosingControlStructures = std::list<Entry>(); 358 GuardValue( inFinally );359 inFinally = true;360 }361 362 void MultiLevelExitMutator::premutate( ReturnStmt *returnStmt ) {363 if ( inFinally ) {364 SemanticError( returnStmt->location, "'return' may not appear in a finally clause" );365 }366 354 } 367 355 -
src/ControlStruct/MLEMutator.h
r4f7b418 r09f357ec 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jan 22 11:50:00 202013 // Update Count : 4 812 // Last Modified On : Tue Jan 21 10:33:00 2020 13 // Update Count : 47 14 14 // 15 15 … … 38 38 ~MultiLevelExitMutator(); 39 39 40 void premutate( FunctionDecl * );41 42 40 void premutate( CompoundStmt *cmpndStmt ); 43 41 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ); … … 51 49 void premutate( SwitchStmt *switchStmt ); 52 50 Statement * postmutate( SwitchStmt *switchStmt ); 53 void premutate( ReturnStmt *returnStmt );54 51 void premutate( TryStmt *tryStmt ); 55 52 Statement * postmutate( TryStmt *tryStmt ); … … 116 113 Label breakLabel; 117 114 LabelGenerator *generator; 118 bool inFinally = false;119 115 120 116 template< typename LoopClass > -
src/Parser/lex.ll
r4f7b418 r09f357ec 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : S at Feb 1 07:16:44 202013 * Update Count : 7 2412 * Last Modified On : Sun Aug 4 20:53:47 2019 13 * Update Count : 719 14 14 */ 15 15 … … 330 330 /* identifier */ 331 331 {identifier} { IDENTIFIER_RETURN(); } 332 "` `"{identifier}"``" { // CFA333 yytext[yyleng - 2] = '\0'; yytext += 2; // SKULLDUGGERY: remove backquotes (ok to shorten?)332 "`"{identifier}"`" { // CFA 333 yytext[yyleng - 1] = '\0'; yytext += 1; // SKULLDUGGERY: remove backquotes (ok to shorten?) 334 334 IDENTIFIER_RETURN(); 335 335 } -
src/Parser/parser.yy
r4f7b418 r09f357ec 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 10:04:40202013 // Update Count : 44 4012 // Last Modified On : Fri Jan 17 14:54:55 2020 13 // Update Count : 4426 14 14 // 15 15 … … 579 579 | '(' compound_statement ')' // GCC, lambda expression 580 580 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 581 | constant '`' IDENTIFIER // CFA, postfix call 582 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 583 | string_literal '`' IDENTIFIER // CFA, postfix call 584 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 585 | IDENTIFIER '`' IDENTIFIER // CFA, postfix call 586 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); } 587 | tuple '`' IDENTIFIER // CFA, postfix call 588 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 589 | '(' comma_expression ')' '`' IDENTIFIER // CFA, postfix call 590 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); } 581 591 | type_name '.' identifier // CFA, nested type 582 592 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } … … 632 642 | postfix_expression '(' argument_expression_list ')' 633 643 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 634 | postfix_expression '`' identifier // CFA, postfix call635 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }636 | constant '`' identifier // CFA, postfix call637 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }638 | string_literal '`' identifier // CFA, postfix call639 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }640 644 | postfix_expression '.' identifier 641 645 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } … … 662 666 | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal 663 667 { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); } 664 | '^' primary_expression '{' argument_expression_list '}' // CFA , destructor call668 | '^' primary_expression '{' argument_expression_list '}' // CFA 665 669 { 666 670 Token fn; -
tests/expression.cfa
r4f7b418 r09f357ec 1 struct S { int i; };2 void ?{}( S & s, int i ) { s.i = i; }3 int ?`mary( int );4 int ?`mary( S );5 [int] ?`mary( [int, int] );6 int & ?`jane( int & );7 int jack( int );8 9 1 int main() { 10 int a[3] = { 0, 0, 0 }; 11 S s = { 3 }, * ps = &s; 12 [int] t = { 3 }; 13 * [int] pt = &t; 14 int i = 1, j = 2; 2 struct s { int i; } x, *p = &x; 3 int i = 3; 15 4 16 5 // operators 17 6 18 ! i;7 ! i; 19 8 ~i; 20 9 +i; 21 10 -i; 22 *p s;23 ++p s;24 --p s;25 p s++;26 p s--;11 *p; 12 ++p; 13 --p; 14 p++; 15 p--; 27 16 28 i + j;29 i - j;30 i * j;17 i+i; 18 i-i; 19 i*i; 31 20 32 i / j;33 i % j;34 i ^ j;35 i & j;36 i | j;37 i < j;38 i > j;39 i = j;21 i/i; 22 i%i; 23 i^i; 24 i&i; 25 i|i; 26 i<i; 27 i>i; 28 i=i; 40 29 41 i == j; 42 i != j; 43 i << j; 44 i >> j; 45 i <= j; 46 i >= j; 47 i && j; 48 i || j; 49 ps->i; 30 i==i; 31 i!=i; 32 i<<i; 33 i>>i; 34 i<=i; 35 i>=i; 36 i&&i; 37 i||i; 38 p->i; 39 i*=i; 40 i/=i; 41 i%=i; 42 i+=i; 43 i-=i; 44 i&=i; 45 i|=i; 46 i^=i; 47 i<<=i; 48 i>>=i; 50 49 51 i *= j; 52 i /= j; 53 i %= j; 54 i += j; 55 i -= j; 56 i &= j; 57 i |= j; 58 i ^= j; 59 i <<= j; 60 i >>= j; 61 62 i ? i : j; 63 64 // postfix function call 65 66 (3 + 4)`mary; 67 ({3 + 4;})`mary; 68 [3, 4]`mary; 69 3`mary; 70 a[0]`mary; 71 a[0]`mary`mary; 72 s{0}`mary; 73 a[3]`jane++; 74 jack(3)`mary; 75 s.i`mary; 76 t.0`mary; 77 s.[i]`mary; 78 ps->i`mary; 79 pt->0`mary; 80 ps->[i]`mary; 81 i++`mary; 82 i--`mary; 83 (S){2}`mary; 84 (S)@{2}`mary; 50 i?i:i; 85 51 } // main -
tests/quotedKeyword.cfa
r4f7b418 r09f357ec 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 00:02:22 202013 // Update Count : 2 412 // Last Modified On : Tue Dec 4 21:45:53 2018 13 // Update Count : 23 14 14 // 15 15 … … 17 17 18 18 struct { 19 int ` `otype``;20 int ` `struct``;19 int `otype`; 20 int `struct`; 21 21 } st = { 10, 10 }; 22 22 23 typedef int ` `forall``;24 ` `forall`` xxx = 10;23 typedef int `forall`; 24 `forall` xxx = 10; 25 25 26 int ` `_Alignas``, ``_Alignof``, ``__alignof``, ``__alignof__``, ``asm``, ``__asm``, ``__asm__``, ``_At``, ``_Atomic``, ``__attribute``,27 ` `__attribute__``, ``auto``, ``_Bool``, ``break``, ``case``, ``catch``, ``catchResume``, ``char``, ``choose``, ``_Complex``, ``__complex``,28 ` `__complex__``, ``const``, ``__const``, ``__const__``, ``continue``, ``default``, ``disable``, ``do``, ``double``, ``dtype``, ``else``,29 ` `enable``, ``enum``, ``__extension__``, ``extern``, ``fallthru``, ``finally``, ``float``, ``__float128``, ``for``, ``forall``, ``fortran``,30 ` `ftype``, ``_Generic``, ``goto``, ``if``, ``_Imaginary``, ``__imag``, ``__imag__``, ``inline``, ``__inline``, ``__inline__``, ``int``,31 ` `__int128``, ``__label__``, ``long``, ``lvalue``, ``_Noreturn``, ``__builtin_offsetof``, ``otype``, ``register``, ``restrict``,32 ` `__restrict``, ``__restrict__``, ``return``, ``short``, ``signed``, ``__signed``, ``__signed__``, ``sizeof``, ``static``,33 ` `_Static_assert``, ``struct``, ``switch``, ``_Thread_local``, ``throw``, ``throwResume``, ``trait``, ``try``, ``typedef``,34 ` `typeof``, ``__typeof``, ``__typeof__``, ``union``, ``unsigned``, ``__builtin_va_list``, ``void``, ``volatile``, ``__volatile``,35 ` `__volatile__``, ``while``;26 int `_Alignas`, `_Alignof`, `__alignof`, `__alignof__`, `asm`, `__asm`, `__asm__`, `_At`, `_Atomic`, `__attribute`, 27 `__attribute__`, `auto`, `_Bool`, `break`, `case`, `catch`, `catchResume`, `char`, `choose`, `_Complex`, `__complex`, 28 `__complex__`, `const`, `__const`, `__const__`, `continue`, `default`, `disable`, `do`, `double`, `dtype`, `else`, 29 `enable`, `enum`, `__extension__`, `extern`, `fallthru`, `finally`, `float`, `__float128`, `for`, `forall`, `fortran`, 30 `ftype`, `_Generic`, `goto`, `if`, `_Imaginary`, `__imag`, `__imag__`, `inline`, `__inline`, `__inline__`, `int`, 31 `__int128`, `__label__`, `long`, `lvalue`, `_Noreturn`, `__builtin_offsetof`, `otype`, `register`, `restrict`, 32 `__restrict`, `__restrict__`, `return`, `short`, `signed`, `__signed`, `__signed__`, `sizeof`, `static`, 33 `_Static_assert`, `struct`, `switch`, `_Thread_local`, `throw`, `throwResume`, `trait`, `try`, `typedef`, 34 `typeof`, `__typeof`, `__typeof__`, `union`, `unsigned`, `__builtin_va_list`, `void`, `volatile`, `__volatile`, 35 `__volatile__`, `while`; 36 36 37 37 int main() { 38 int ` `if`` = 0;39 ` `catch`` = 1;40 st.` `otype`` = 2;41 st.` `struct`` = 3;42 ` `throw`` = 4;43 sout | ` `catch`` + st.``otype`` + st.``struct`` + ``throw``;38 int `if` = 0; 39 `catch` = 1; 40 st.`otype` = 2; 41 st.`struct` = 3; 42 `throw` = 4; 43 sout | `catch` + st.`otype` + st.`struct` + `throw`; 44 44 } 45 45
Note:
See TracChangeset
for help on using the changeset viewer.