Changeset 4f7b418


Ignore:
Timestamp:
Feb 4, 2020, 11:29:22 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
52142c2, 9f575ea, bdfc032
Parents:
09f357ec (diff), e56eb455 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
5 added
1 deleted
30 edited
6 moved

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    r09f357ec r4f7b418  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jan 20 11:50:13 2020
    14 ## Update Count     : 244
     13## Last Modified On : Sat Jan 25 09:20:44 2020
     14## Update Count     : 255
    1515###############################################################################
    1616
     
    7575.ONESHELL:              # use one shell to execute recipe
    7676.NOTPARALLEL:
    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)
     77.PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv schedint.csv
     78
     79## =========================================================================================================
     80
     81all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
    8282
    8383basic_loop_DURATION = 15000000000
     
    8989ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
    9090ctxswitch_cfa_generator_DURATION = 5000000000
     91ctxswitch_nodejs_await_DURATION = 5000000
    9192ctxswitch_DURATION = 100000000
    9293
    93 mutex_java_DURATION = 10000000
     94#mutex_java_DURATION = 10000000
    9495mutex_DURATION = 50000000
    9596
    96 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
     97schedint_pthread_DURATION = 1000000
     98schedint_java_DURATION = $(schedint_pthread_DURATION)
     99schedint_rust_DURATION = $(schedint_pthread_DURATION)
     100schedint_DURATION = 10000000
     101
     102schedext_DURATION = 10000000
    102103
    103104creation_pthread_DURATION = 250000
    104 creation_rust_DURATION = ${creation_pthread_DURATION}
     105creation_rust_thread_DURATION = ${creation_pthread_DURATION}
     106creation_java_thread_DURATION = ${creation_pthread_DURATION}
    105107creation_cfa_coroutine_DURATION = 100000000
    106108creation_cfa_coroutine_eager_DURATION = 10000000
     
    151153        +make mutex.csv
    152154        -+make mutex.diff.csv
    153         +make signal.csv
    154         -+make signal.diff.csv
     155        +make schedint.csv
     156        -+make schedint.diff.csv
    155157@DOifskipcompile@
    156158        cat compile.csv
     
    163165        cat mutex.csv
    164166        -cat mutex.diff.csv
    165         cat signal.csv
    166         -cat signal.diff.csv
     167        cat schedint.csv
     168        -cat schedint.diff.csv
    167169
    168170compile.csv:
     
    198200        $(srcdir)/fixcsv.sh $@
    199201
    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 >> $@
     202schedint.csv:
     203        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
     204        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
     205        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
     206        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
     207        +make schedext-cfa2.runquiet >> $@
    206208        $(srcdir)/fixcsv.sh $@
    207209
     
    247249        ctxswitch-python_coroutine.run  \
    248250        ctxswitch-nodejs_coroutine.run  \
     251        ctxswitch-nodejs_await.run      \
    249252        ctxswitch-goroutine_thread.run  \
    250253        ctxswitch-rust_thread.run       \
     
    293296        echo "#!/bin/sh" > a.out
    294297        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     298        chmod a+x a.out
     299
     300ctxswitch-nodejs_await$(EXEEXT):
     301        echo "#!/bin/sh" > a.out
     302        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
    295303        chmod a+x a.out
    296304
     
    351359## =========================================================================================================
    352360
    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):
     361schedint$(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
     370schedint-cfa1$(EXEEXT):
     371        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
     372
     373schedint-cfa2$(EXEEXT):
     374        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
     375
     376schedint-cfa4$(EXEEXT):
     377        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
     378
     379schedint-upp$(EXEEXT):
     380        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
     381
     382schedint-rust$(EXEEXT):
     383        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
     384
     385schedint-java$(EXEEXT):
     386        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
     387        echo "#!/bin/sh" > a.out
     388        echo "java JavaThread" >> a.out
     389        chmod a+x a.out
     390
     391schedint-pthread$(EXEEXT):
    363392        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
    364393
    365 signal-upp$(EXEEXT):
    366         $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
    367 
    368 signal-cfa1$(EXEEXT):
    369         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
    370 
    371 signal-cfa2$(EXEEXT):
    372         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
    373 
    374 signal-cfa4$(EXEEXT):
    375         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
    376 
    377 signal-rust$(EXEEXT):
    378         $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
    379 
    380 signal-java$(EXEEXT):
    381         $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    382         echo "#!/bin/sh" > a.out
    383         echo "java JavaThread" >> a.out
    384         chmod a+x a.out
    385 
    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):
     394## =========================================================================================================
     395
     396schedext$(EXEEXT) :             \
     397        schedext-cfa1.run       \
     398        schedext-cfa2.run       \
     399        schedext-cfa4.run       \
     400        schedext-upp.run        \
     401        schedext-goroutine.run
     402
     403schedext-cfa1$(EXEEXT):
     404        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
     405
     406schedext-cfa2$(EXEEXT):
     407        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
     408
     409schedext-cfa4$(EXEEXT):
     410        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     411
     412schedext-upp$(EXEEXT):
    395413        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
    396414
    397 waitfor-cfa1$(EXEEXT):
    398         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
    399 
    400 waitfor-cfa2$(EXEEXT):
    401         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
    402 
    403 waitfor-cfa4$(EXEEXT):
    404         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     415schedext-goroutine$(EXEEXT):
     416        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
     417
    405418
    406419## =========================================================================================================
    407420
    408421creation$(EXEEXT) :                             \
     422        creation-cfa_generator.run              \
    409423        creation-cfa_coroutine.run              \
    410424        creation-cfa_coroutine_eager.run        \
     
    419433        creation-pthread.run
    420434
     435creation-cfa_generator$(EXEEXT):
     436        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
     437
    421438creation-cfa_coroutine$(EXEEXT):
    422439        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
     
    450467        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
    451468
    452 creation-java$(EXEEXT):
     469creation-java_thread$(EXEEXT):
    453470        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    454471        echo "#!/bin/sh" > a.out
  • benchmark/Makefile.in

    r09f357ec r4f7b418  
    426426ctxswitch_rust_thread_DURATION = $(ctxswitch_pthread_DURATION)
    427427ctxswitch_cfa_generator_DURATION = 5000000000
     428ctxswitch_nodejs_await_DURATION = 5000000
    428429ctxswitch_DURATION = 100000000
    429 mutex_java_DURATION = 10000000
     430
     431#mutex_java_DURATION = 10000000
    430432mutex_DURATION = 50000000
    431 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
     433schedint_pthread_DURATION = 1000000
     434schedint_java_DURATION = $(schedint_pthread_DURATION)
     435schedint_rust_DURATION = $(schedint_pthread_DURATION)
     436schedint_DURATION = 10000000
     437schedext_DURATION = 10000000
    436438creation_pthread_DURATION = 250000
    437 creation_rust_DURATION = ${creation_pthread_DURATION}
     439creation_rust_thread_DURATION = ${creation_pthread_DURATION}
     440creation_java_thread_DURATION = ${creation_pthread_DURATION}
    438441creation_cfa_coroutine_DURATION = 100000000
    439442creation_cfa_coroutine_eager_DURATION = 10000000
     
    454457        ctxswitch-cfa_thread2.run ctxswitch-upp_coroutine.run \
    455458        ctxswitch-upp_thread.run ctxswitch-python_coroutine.run \
    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)
     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)
    460463testdir = $(top_srcdir)/tests
    461464all: all-am
     
    784787.ONESHELL:              # use one shell to execute recipe
    785788.NOTPARALLEL:
    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)
     789.PHONY: compile.csv basic.csv ctxswitch.csv mutex.csv schedint.csv
     790
     791all : basic$(EXEEXT) ctxswitch$(EXEEXT) mutex$(EXEEXT) schedint$(EXEEXT) schedext$(EXEEXT) creation$(EXEEXT)
    789792
    790793%.run : %$(EXEEXT) ${REPEAT}
     
    825828        +make mutex.csv
    826829        -+make mutex.diff.csv
    827         +make signal.csv
    828         -+make signal.diff.csv
     830        +make schedint.csv
     831        -+make schedint.diff.csv
    829832@DOifskipcompile@
    830833        cat compile.csv
     
    837840        cat mutex.csv
    838841        -cat mutex.diff.csv
    839         cat signal.csv
    840         -cat signal.diff.csv
     842        cat schedint.csv
     843        -cat schedint.diff.csv
    841844
    842845compile.csv:
     
    872875        $(srcdir)/fixcsv.sh $@
    873876
    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 >> $@
     877schedint.csv:
     878        echo "schedint-1,schedint-2,schedext-1,schedext-2" > $@
     879        +make schedint-cfa1.runquiet >> $@ && echo -n ',' >> $@
     880        +make schedint-cfa2.runquiet >> $@ && echo -n ',' >> $@
     881        +make schedext-cfa1.runquiet >> $@ && echo -n ',' >> $@
     882        +make schedext-cfa2.runquiet >> $@
    880883        $(srcdir)/fixcsv.sh $@
    881884
     
    935938        echo "#!/bin/sh" > a.out
    936939        echo "nodejs $(srcdir)/ctxswitch/node_cor.js" >> a.out
     940        chmod a+x a.out
     941
     942ctxswitch-nodejs_await$(EXEEXT):
     943        echo "#!/bin/sh" > a.out
     944        echo "nodejs $(srcdir)/ctxswitch/node_await.js" >> a.out
    937945        chmod a+x a.out
    938946
     
    989997        chmod a+x a.out
    990998
    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):
     999schedint$(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
     1008schedint-cfa1$(EXEEXT):
     1009        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
     1010
     1011schedint-cfa2$(EXEEXT):
     1012        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
     1013
     1014schedint-cfa4$(EXEEXT):
     1015        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
     1016
     1017schedint-upp$(EXEEXT):
    10041018        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedint/upp.cc
    10051019
    1006 signal-cfa1$(EXEEXT):
    1007         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa1.cfa
    1008 
    1009 signal-cfa2$(EXEEXT):
    1010         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa2.cfa
    1011 
    1012 signal-cfa4$(EXEEXT):
    1013         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedint/cfa4.cfa
    1014 
    1015 signal-rust$(EXEEXT):
     1020schedint-rust$(EXEEXT):
    10161021        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/schedint/rust.rs
    10171022
    1018 signal-java$(EXEEXT):
     1023schedint-java$(EXEEXT):
    10191024        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java
    10201025        echo "#!/bin/sh" > a.out
     
    10221027        chmod a+x a.out
    10231028
    1024 waitfor$(EXEEXT) :              \
    1025         waitfor-cfa1.run        \
    1026         waitfor-cfa2.run        \
    1027         waitfor-cfa4.run        \
    1028         waitfor-upp.run
    1029 
    1030 waitfor-upp$(EXEEXT):
     1029schedint-pthread$(EXEEXT):
     1030        $(BENCH_V_CC)$(COMPILE) $(srcdir)/schedint/pthreads.c
     1031
     1032schedext$(EXEEXT) :             \
     1033        schedext-cfa1.run       \
     1034        schedext-cfa2.run       \
     1035        schedext-cfa4.run       \
     1036        schedext-upp.run        \
     1037        schedext-goroutine.run
     1038
     1039schedext-cfa1$(EXEEXT):
     1040        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
     1041
     1042schedext-cfa2$(EXEEXT):
     1043        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
     1044
     1045schedext-cfa4$(EXEEXT):
     1046        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     1047
     1048schedext-upp$(EXEEXT):
    10311049        $(BENCH_V_UPP)$(UPPCOMPILE) $(srcdir)/schedext/upp.cc
    10321050
    1033 waitfor-cfa1$(EXEEXT):
    1034         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa1.cfa
    1035 
    1036 waitfor-cfa2$(EXEEXT):
    1037         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa2.cfa
    1038 
    1039 waitfor-cfa4$(EXEEXT):
    1040         $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/schedext/cfa4.cfa
     1051schedext-goroutine$(EXEEXT):
     1052        $(BENCH_V_GOC)go build -o a.out $(srcdir)/schedext/goroutine.go
    10411053
    10421054creation$(EXEEXT) :                             \
     1055        creation-cfa_generator.run              \
    10431056        creation-cfa_coroutine.run              \
    10441057        creation-cfa_coroutine_eager.run        \
     
    10531066        creation-pthread.run
    10541067
     1068creation-cfa_generator$(EXEEXT):
     1069        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_gen.cfa
     1070
    10551071creation-cfa_coroutine$(EXEEXT):
    10561072        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/creation/cfa_cor.cfa
     
    10841100        $(BENCH_V_RUSTC)rustc -C opt-level=3 -o a.out $(srcdir)/creation/rust_thrd.rs
    10851101
    1086 creation-java$(EXEEXT):
     1102creation-java_thread$(EXEEXT):
    10871103        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java
    10881104        echo "#!/bin/sh" > a.out
  • benchmark/schedext/cfa1.cfa

    r09f357ec r4f7b418  
    66#include "../bench.h"
    77
    8 volatile int go = 0;
    9 
    108monitor M {} m1;
    119
    1210void __attribute__((noinline)) call( M & mutex p1 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1 );
    1814        }
    19         go = 0;
    2015}
    2116
    2217thread T {};
    2318void main( T & ) {
    24         while ( go == 0 ) { yield(); }
    2519        BENCH(
    26                 while ( go == 1 ) { call( m1 ); },
     20                for ( times ) { call( m1 ); },
    2721                result
    2822        )
  • benchmark/schedext/cfa2.cfa

    r09f357ec r4f7b418  
    44#include <stdio.h>
    55
    6 #include "bench.h"
    7 
    8 volatile int go = 0;
     6#include "../bench.h"
    97
    108monitor M {} m1, m2;
    119
    1210void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1, p2 );
    1814        }
    19         go = 0;
    2015}
    21 
    2216thread T {};
    2317void main( T & ) {
    24         while( go == 0 ) { yield(); }
    2518        BENCH(
    26                 while ( go == 1 ) { call( m1, m2 ); },
     19                for ( times ) {
     20                        call( m1, m2 );
     21                },
    2722                result
    2823        )
  • benchmark/schedext/cfa4.cfa

    r09f357ec r4f7b418  
    44#include <stdio.h>
    55
    6 #include "bench.h"
    7 
    8 volatile int go = 0;
     6#include "../bench.h"
    97
    108monitor M {} m1, m2, m3, m4;
    119
    1210void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1, p2, p3, p4 );
    1814        }
    19         go = 0;
    2015}
    21 
    2216thread T {};
    2317void main( T & ) {
    24         while( go == 0 ) { yield(); }
    2518        BENCH(
    26                 while( go == 1 ) { call( m1, m2, m3, m4 ); },
     19                for ( times ) {
     20                        call( m1, m2, m3, m4 );
     21                },
    2722                result
    2823        )
  • benchmark/schedext/upp.cc

    r09f357ec r4f7b418  
    33#include "bench.h"
    44
    5 volatile int go = 0;
    6 
    75_Monitor M {
    86public:
    97        void __attribute__((noinline)) call() {}
    10 
    11         int __attribute__((noinline)) wait() {
    12                 go = 1;
     8        void __attribute__((noinline)) wait() {
    139                for ( size_t i = 0; i < times; i++ ) {
    1410                        _Accept(call);
    1511                }
    16                 go = 0;
    17                 return 0;
    1812        }
    1913} m;
     
    2115_Task T {
    2216        void main() {
    23                 while ( go == 0 ) { yield(); }
    2417                BENCH(
    25                         while ( go == 1 ) { m.call(); },
     18                        for ( size_t i = 0; i < times; i++ ) {
     19                                m.call();
     20                        },
    2621                        result
    2722                )
     
    3328        BENCH_START()
    3429        T t;
    35         return m.wait();
     30        m.wait();
    3631}
    3732
  • benchmark/schedint/JavaThread.java

    r09f357ec r4f7b418  
    6363                synchronized(m) {
    6464                        s.start();
    65                         while( !Monitor.go ) {
     65                        while( ! Monitor.go ) { // waiter must start first
    6666                                Thread.yield();
    6767                        }
  • benchmark/schedint/cfa1.cfa

    r09f357ec r4f7b418  
    77
    88volatile int go = 0;
     9
    910condition c;
    1011monitor M {} m1;
     
    1314        signal( c );
    1415}
    15 
    1616void __attribute__((noinline)) wait( M & mutex p1 ) {
    1717        go = 1;
     
    1919                wait( c );
    2020        }
    21         go = 0;
    2221}
    2322
    2423thread T {};
    2524void main( T & ) {
    26         while ( go == 0 ) { yield(); }
     25        while ( go == 0 ) { yield(); } // waiter must start first
    2726        BENCH(
    28                 while ( go == 1 ) { call( m1 ); },
     27                for ( times ) { call( m1 ); },
    2928                result
    3029        )
  • benchmark/schedint/cfa2.cfa

    r09f357ec r4f7b418  
    77
    88volatile int go = 0;
     9
    910condition c;
    1011monitor M {} m1, m2;
     
    1314        signal( c );
    1415}
    15 
    1616void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
    1717        go = 1;
     
    1919                wait( c );
    2020        }
    21         go = 0;
    2221}
    2322
    2423thread T {};
    2524void main( T & ) {
    26         while ( go == 0 ) { yield(); }
     25        while ( go == 0 ) { yield(); } // waiter must start first
    2726        BENCH(
    28                 while ( go == 1 ) { call( m1, m2 ); },
     27                for ( times ) { call( m1, m2 ); },
    2928                result
    3029        )
  • benchmark/schedint/cfa4.cfa

    r09f357ec r4f7b418  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    88volatile int go = 0;
     9
    910condition c;
    1011monitor M {} m1, m2, m3, m4;
     
    1314        signal( c );
    1415}
    15 
    1616void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    1717        go = 1;
     
    1919                wait( c );
    2020        }
    21         go = 0;
    2221}
    2322
    2423thread T {};
    2524void main( T & ) {
    26         while ( go == 0 ) { yield(); }
     25        while ( go == 0 ) { yield(); } // waiter must start first
    2726        BENCH(
    28                 while ( go == 1 ) { call( m1, m2, m3, m4 ); },
     27                for ( times ) { call( m1, m2, m3, m4 ); },
    2928                result
    3029        )
  • benchmark/schedint/pthreads.c

    r09f357ec r4f7b418  
    66volatile int go = 0;
    77
     8pthread_mutex_t m;
    89pthread_cond_t c;
    9 pthread_mutex_t m;
    1010
    1111void __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 );
    1515}
    1616
    17 int __attribute__((noinline)) wait() {
     17void __attribute__((noinline)) wait() {
    1818        pthread_mutex_lock(&m);
    1919        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
     27void * thread_main( __attribute__((unused)) void * arg ) {
     28        while ( go == 0 ) { sched_yield(); } // waiter must start first
     29        // barging for lock acquire => may not execute N times
    2030        BENCH(
    21                 for (size_t i = 0; i < times; i++) {
    22                         pthread_cond_wait(&c, &m);
    23                 },
     31                while ( go == 1 ) { call(); },
    2432                result
    2533        )
    2634        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(); }
    3535        return NULL;
    3636}
     
    3939        BENCH_START()
    4040        pthread_t thread;
    41         if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
     41        if ( pthread_create( &thread, NULL, thread_main, NULL ) < 0 ) {
    4242                perror( "failure" );
    4343                return 1;
    4444        }
    4545        wait();
    46         if (pthread_join( thread, NULL) < 0) {
     46        if ( pthread_join( thread, NULL ) < 0 ) {
    4747                perror( "failure" );
    4848                return 1;
  • benchmark/schedint/rust.rs

    r09f357ec r4f7b418  
    1818
    1919        let th = thread::spawn( move || {
    20                 while *m2.lock().unwrap() == 0 {
     20                while *m2.lock().unwrap() == 0 { // waiter must start first
    2121                        thread::yield_now();
    2222                }
  • benchmark/schedint/upp.cc

    r09f357ec r4f7b418  
    1111                cond.signal();
    1212        }
     13        void __attribute__((noinline)) wait() {
     14                go = 1;
     15                for ( size_t i = 0; i < times; i++ ) {
     16                        cond.wait();
     17                }
     18        }
     19} m;
    1320
    14         int __attribute__((noinline)) wait() {
    15                 go = 1;
     21_Task T {
     22        void main() {
     23                while ( go == 0 ) { yield(); } // waiter must start first
    1624                BENCH(
    17                         for (size_t i = 0; i < times; i++) {
    18                                 cond.wait();
     25                        for ( size_t i = 0; i < times; i++ ) {
     26                                m.call();
    1927                        },
    2028                        result
    2129                )
    2230                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 
    3531        }
    3632};
     
    3935        BENCH_START()
    4036        T t;
    41         return m.wait();
     37        m.wait();
    4238}
    4339
  • driver/cfa.cc

    r09f357ec r4f7b418  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Sep 10 17:00:15 2019
    13 // Update Count     : 420
     12// Last Modified On : Fri Jan 31 16:48:03 2020
     13// Update Count     : 421
    1414//
    1515
     
    187187                        } else if ( arg == "-XCFA" ) {                          // CFA pass through
    188188                                i += 1;
     189                                if ( i == argc ) continue;                              // next argument available ?
    189190                                Putenv( argv, argv[i] );
    190191
  • libcfa/src/bits/defs.hfa

    r09f357ec r4f7b418  
    1010// Created On       : Thu Nov  9 13:24:10 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  8 16:22:41 2018
    13 // Update Count     : 8
     12// Last Modified On : Tue Jan 28 22:38:27 2020
     13// Update Count     : 9
    1414//
    1515
     
    3434
    3535#ifdef __cforall
    36 void abort ( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
     36void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
     37void abort( bool signalAbort, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
    3738extern "C" {
    3839#endif
  • libcfa/src/bits/signal.hfa

    r09f357ec r4f7b418  
    4040        sigaddset( &act.sa_mask, SIGALRM );             // disabled during signal handler
    4141        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 delivery
     47        sigaddset( &act.sa_mask, SIGTERM );
     48        sigaddset( &act.sa_mask, SIGINT );
    4249        act.sa_flags = flags;
    4350
    44         if ( sigaction( sig, &act, NULL ) == -1 ) {
     51        if ( sigaction( sig, &act, 0p ) == -1 ) {
    4552                __cfaabi_dbg_print_buffer_decl(
    4653                        " __cfaabi_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n",
     
    4855                );
    4956                _exit( EXIT_FAILURE );
    50         }
     57        } // if
    5158}
    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

    r09f357ec r4f7b418  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  5 16:25:52 2019
    13 // Update Count     : 52
     12// Last Modified On : Thu Jan 30 22:55:50 2020
     13// Update Count     : 56
    1414//
    1515
     
    844844                sigemptyset( &mask );
    845845                sigaddset( &mask, SIGALRM );            // block SIGALRM signals
    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
     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
    848849        }
    849850        else {
  • libcfa/src/interpose.cfa

    r09f357ec r4f7b418  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 13 13:45:21 2019
    13 // Update Count     : 121
     12// Last Modified On : Thu Jan 30 17:47:32 2020
     13// Update Count     : 156
    1414//
    1515
     
    9595        void __cfaabi_interpose_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
    9696        void __cfaabi_interpose_startup( void ) {
    97                 const char *version = NULL;
     97                const char *version = 0p;
    9898
    9999                preload_libgcc();
     
    105105#pragma GCC diagnostic pop
    106106
     107                // As a precaution (and necessity), errors that result in termination are delivered on a separate stack because
     108                // task stacks might be very small (4K) and the signal delivery corrupts memory to the point that a clean
     109                // 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 abort
     111                // print a stack trace that uses substantial stack space.
     112
     113                #define MINSTKSZ SIGSTKSZ * 8
     114                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                } // if
     123
    107124                // Failure handler
    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 );
     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
    115133        }
    116134}
     
    123141void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
    124142void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
     143void abort( bool signalAbort, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
    125144
    126145extern "C" {
    127146        void abort( void ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) {
    128                 abort( NULL );
     147                abort( false, NULL ); // FIX ME: 0p does not work
    129148        }
    130149
     
    132151                va_list argp;
    133152                va_start( argp, fmt );
    134                 abort( fmt, argp );
     153                abort( false, fmt, argp );
    135154                va_end( argp );
    136155        }
     
    141160}
    142161
    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__ )) {}
     162void * kernel_abort( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 0p; }
     163void 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.
    145165int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; }
    146166
    147167enum { abort_text_size = 1024 };
    148168static char abort_text[ abort_text_size ];
    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() {
     169
     170static void __cfaabi_backtrace( int start ) {
    185171        enum {
    186172                Frames = 50,                                                                    // maximum number of stack frames
    187                 Start = 8,                                                                              // skip first N stack frames
    188173        };
     174        int last = kernel_abort_lastframe();                            // skip last N stack frames
    189175
    190176        void * array[Frames];
     
    192178        char ** messages = backtrace_symbols( array, size );
    193179
    194         // find executable name
    195         *index( messages[0], '(' ) = '\0';
     180        *index( messages[0], '(' ) = '\0';                                      // find executable name
    196181        __cfaabi_bits_print_nolock( STDERR_FILENO, "Stack back trace for: %s\n", messages[0]);
    197182
    198         for ( int i = Start; i < size - abort_lastframe && messages != 0p; i += 1 ) {
     183        for ( unsigned int i = start; i < size - last && messages != 0p; i += 1 ) {
    199184                char * name = 0p, * offset_begin = 0p, * offset_end = 0p;
    200185
    201                 for ( char * p = messages[i]; *p; ++p ) {
     186                for ( char * p = messages[i]; *p; ++p ) {               // find parantheses and +offset
    202187                        //__cfaabi_bits_print_nolock( "X %s\n", p);
    203                         // find parantheses and +offset
    204188                        if ( *p == '(' ) {
    205189                                name = p;
     
    212196                }
    213197
    214                 // if line contains symbol print it
    215                 int frameNo = i - Start;
     198                // if line contains symbol, print it
     199                int frameNo = i - start;
    216200                if ( name && offset_begin && offset_end && name < offset_begin ) {
    217                         // delimit strings
    218                         *name++ = '\0';
     201                        *name++ = '\0';                                                         // delimit strings
    219202                        *offset_begin++ = '\0';
    220203                        *offset_end++ = '\0';
     
    228211}
    229212
     213void 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
     221void abort( bool signalAbort, const char fmt[], ... ) {
     222        void * kernel_data = kernel_abort();                            // must be done here to lock down kernel
     223        int len;
     224
     225        signal( SIGABRT, SIG_DFL );                                                     // prevent final "real" abort from recursing to handler
     226
     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 text
     239                        __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 handler
     247}
     248
     249void abort( const char fmt[], ... ) {
     250        va_list args;
     251        va_start( args, fmt );
     252        abort( false, fmt, args );
     253        va_end( args );
     254}
     255
    230256void sigHandler_segv( __CFA_SIGPARMS__ ) {
    231                 if ( sfp->si_addr == NULL ) {
    232                         abort( "Null pointer (0p) dereference.\n" );
     257                if ( sfp->si_addr == 0p ) {
     258                        abort( true, "Null pointer (0p) dereference.\n" );
    233259                } else {
    234                         abort( "%s at memory location %p.\n"
     260                        abort( true, "%s at memory location %p.\n"
    235261                                   "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",
    236262                                   (sig == SIGSEGV ? "Segment fault" : "Bus error"), sfp->si_addr );
     
    239265
    240266void sigHandler_ill( __CFA_SIGPARMS__ ) {
    241         abort( "Executing illegal instruction at location %p.\n"
     267        abort( true, "Executing illegal instruction at location %p.\n"
    242268                        "Possible cause is stack corruption.\n",
    243269                        sfp->si_addr );
     
    255281          default: msg = "unknown";
    256282        } // choose
    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 );
     283        abort( true, "Computation error %s at location %p.\n", msg, sfp->si_addr );
    267284}
    268285
    269286void sigHandler_term( __CFA_SIGPARMS__ ) {
    270         abort( "Application stopped by %s signal.", sig == SIGINT ? "an interrupt (SIGINT)" : "a terminate (SIGTERM)" );
     287        abort( true, "Application interrupted by signal: %s.\n", strsignal( sig ) );
    271288}
    272289
  • libcfa/src/stdhdr/bfdlink.h

    r09f357ec r4f7b418  
    1010// Created On       : Tue Jul 18 07:26:04 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 22 13:49:30 2018
    13 // Update Count     : 4
     12// Last Modified On : Sat Feb  1 07:15:29 2020
     13// Update Count     : 5
    1414//
    1515
    1616// include file uses the CFA keyword "with".
    1717#if ! defined( with )                                                                   // nesting ?
    18 #define with `with`                                                                             // make keyword an identifier
     18#define with ``with``                                                                   // make keyword an identifier
    1919#define __CFA_BFDLINK_H__
    2020#endif
  • libcfa/src/stdhdr/hwloc.h

    r09f357ec r4f7b418  
    1010// Created On       : Tue Jul 18 07:45:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 22 13:49:58 2018
    13 // Update Count     : 4
     12// Last Modified On : Sat Feb  1 07:15:39 2020
     13// Update Count     : 5
    1414//
    1515
    1616// include file uses the CFA keyword "thread".
    1717#if ! defined( thread )                                                                 // nesting ?
    18 #define thread `thread`                                                                 // make keyword an identifier
     18#define thread ``thread``                                                               // make keyword an identifier
    1919#define __CFA_HWLOC_H__
    2020#endif
  • libcfa/src/stdhdr/krb5.h

    r09f357ec r4f7b418  
    1010// Created On       : Tue Jul 18 07:55:44 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 22 13:50:24 2018
    13 // Update Count     : 4
     12// Last Modified On : Sat Feb  1 07:15:47 2020
     13// Update Count     : 5
    1414//
    1515
    1616// include file uses the CFA keyword "enable".
    1717#if ! defined( enable )                                                                 // nesting ?
    18 #define enable `enable`                                                                 // make keyword an identifier
     18#define enable ``enable``                                                               // make keyword an identifier
    1919#define __CFA_KRB5_H__
    2020#endif
  • libcfa/src/stdhdr/math.h

    r09f357ec r4f7b418  
    1010// Created On       : Mon Jul  4 23:25:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 22 18:16:07 2018
    13 // Update Count     : 13
     12// Last Modified On : Sat Feb  1 07:15:58 2020
     13// Update Count     : 14
    1414//
    1515
    1616extern "C" {
    1717#if ! defined( exception )                                                              // nesting ?
    18 #define exception `exception`                                                   // make keyword an identifier
     18#define exception ``exception``                                                 // make keyword an identifier
    1919#define __CFA_MATH_H__
    2020#endif
  • libcfa/src/stdhdr/sys/ucontext.h

    r09f357ec r4f7b418  
    1010// Created On       : Thu Feb  8 23:48:16 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  8 23:50:44 2018
    13 // Update Count     : 4
     12// Last Modified On : Sat Feb  1 07:16:05 2020
     13// Update Count     : 5
    1414//
    1515
    1616#if ! defined( ftype )                                                                  // nesting ?
    17 #define ftype `ftype`                                                                   // make keyword an identifier
     17#define ftype ``ftype``                                                                 // make keyword an identifier
    1818#define __CFA_UCONTEXT_H__
    1919#endif
  • src/ControlStruct/LabelFixer.cc

    r09f357ec r4f7b418  
    4545        void LabelFixer::postvisit( FunctionDecl * functionDecl ) {
    4646                PassVisitor<MultiLevelExitMutator> mlem( resolveJumps(), generator );
    47                 functionDecl->acceptMutator( mlem );
     47                // We start in the body so we can stop when we hit another FunctionDecl.
     48                maybeMutate( functionDecl->statements, mlem );
    4849        }
    4950
  • src/ControlStruct/MLEMutator.cc

    r09f357ec r4f7b418  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Jan 21 10:33:00 2020
    13 // Update Count     : 222
     12// Last Modified On : Wed Jan 22 11:50:00 2020
     13// Update Count     : 223
    1414//
    1515
     
    6060                }
    6161        } // namespace
     62
     63        void MultiLevelExitMutator::premutate( FunctionDecl * ) {
     64                visit_children = false;
     65        }
    6266
    6367        // break labels have to come after the statement they break out of, so mutate a statement, then if they inform us
     
    352356                });
    353357                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                }
    354366        }
    355367
  • src/ControlStruct/MLEMutator.h

    r09f357ec r4f7b418  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Jan 21 10:33:00 2020
    13 // Update Count     : 47
     12// Last Modified On : Wed Jan 22 11:50:00 2020
     13// Update Count     : 48
    1414//
    1515
     
    3838                ~MultiLevelExitMutator();
    3939
     40                void premutate( FunctionDecl * );
     41
    4042                void premutate( CompoundStmt *cmpndStmt );
    4143                Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException );
     
    4951                void premutate( SwitchStmt *switchStmt );
    5052                Statement * postmutate( SwitchStmt *switchStmt );
     53                void premutate( ReturnStmt *returnStmt );
    5154                void premutate( TryStmt *tryStmt );
    5255                Statement * postmutate( TryStmt *tryStmt );
     
    113116                Label breakLabel;
    114117                LabelGenerator *generator;
     118                bool inFinally = false;
    115119
    116120                template< typename LoopClass >
  • src/Parser/lex.ll

    r09f357ec r4f7b418  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sun Aug  4 20:53:47 2019
    13  * Update Count     : 719
     12 * Last Modified On : Sat Feb  1 07:16:44 2020
     13 * Update Count     : 724
    1414 */
    1515
     
    330330                                /* identifier */
    331331{identifier}    { IDENTIFIER_RETURN(); }
    332 "`"{identifier}"`" {                                                                    // CFA
    333         yytext[yyleng - 1] = '\0'; yytext += 1;                         // SKULLDUGGERY: remove backquotes (ok to shorten?)
     332"``"{identifier}"``" {                                                                  // CFA
     333        yytext[yyleng - 2] = '\0'; yytext += 2;                         // SKULLDUGGERY: remove backquotes (ok to shorten?)
    334334        IDENTIFIER_RETURN();
    335335}
  • src/Parser/parser.yy

    r09f357ec r4f7b418  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 17 14:54:55 2020
    13 // Update Count     : 4426
     12// Last Modified On : Sat Feb  1 10:04:40 2020
     13// Update Count     : 4440
    1414//
    1515
     
    579579        | '(' compound_statement ')'                                            // GCC, lambda expression
    580580                { $$ = 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 ) ); }
    591581        | type_name '.' identifier                                                      // CFA, nested type
    592582                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     
    642632        | postfix_expression '(' argument_expression_list ')'
    643633                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
     634        | postfix_expression '`' identifier                                     // CFA, postfix call
     635                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     636        | constant '`' identifier                                                       // CFA, postfix call
     637                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     638        | string_literal '`' identifier                                         // CFA, postfix call
     639                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    644640        | postfix_expression '.' identifier
    645641                { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); }
     
    666662        | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal
    667663                { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); }
    668         | '^' primary_expression '{' argument_expression_list '}' // CFA
     664        | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call
    669665                {
    670666                        Token fn;
  • tests/exceptions/finally-error.cfa

    r09f357ec r4f7b418  
    142142}
    143143
     144// Checked in the same place, make sure it does't break.
     145void break_in_function() {
     146        while (true) {
     147                void inner() {
     148                        break;
     149                }
     150        }
     151}
     152
    144153void main() {
    145154        // Should not compile.
  • tests/expression.cfa

    r09f357ec r4f7b418  
     1struct S { int i; };
     2void ?{}( S & s, int i ) { s.i = i; }
     3int ?`mary( int );
     4int ?`mary( S );
     5[int] ?`mary( [int, int] );
     6int & ?`jane( int & );
     7int jack( int );
     8
    19int main() {
    2     struct s { int i; } x, *p = &x;
    3     int i = 3;
     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;
    415
    516    // operators
    617
    7     ! i;
     18    !i;
    819    ~i;
    920    +i;
    1021    -i;
    11     *p;
    12     ++p;
    13     --p;
    14     p++;
    15     p--;
     22    *ps;
     23    ++ps;
     24    --ps;
     25    ps++;
     26    ps--;
    1627
    17     i+i;
    18     i-i;
    19     i*i;
     28    i + j;
     29    i - j;
     30    i * j;
    2031
    21     i/i;
    22     i%i;
    23     i^i;
    24     i&i;
    25     i|i;
    26     i<i;
    27     i>i;
    28     i=i;
     32    i / j;
     33    i % j;
     34    i ^ j;
     35    i & j;
     36    i | j;
     37    i < j;
     38    i > j;
     39    i = j;
    2940
    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;
     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;
    4950
    50     i?i:i;
     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;
    5185} // main
  • tests/quotedKeyword.cfa

    r09f357ec r4f7b418  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:45:53 2018
    13 // Update Count     : 23
     12// Last Modified On : Sat Feb  1 00:02:22 2020
     13// Update Count     : 24
    1414//
    1515
     
    1717
    1818struct {
    19         int `otype`;
    20         int `struct`;
     19        int ``otype``;
     20        int ``struct``;
    2121} st = { 10, 10 };
    2222
    23 typedef int `forall`;
    24 `forall` xxx = 10;
     23typedef int ``forall``;
     24``forall`` xxx = 10;
    2525
    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`;
     26int ``_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``;
    3636
    3737int 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``;
    4444}
    4545
Note: See TracChangeset for help on using the changeset viewer.