Changeset ee6dbae


Ignore:
Timestamp:
Jul 11, 2019, 1:34:37 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
302d84c2, 7870799
Parents:
d6a8aef (diff), 1d760934 (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:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/Paper.tex

    rd6a8aef ree6dbae  
    22
    33\articletype{RESEARCH ARTICLE}%
     4
     5% Referees
     6% Doug Lea, dl@cs.oswego.edu, SUNY Oswego
     7% Herb Sutter, hsutter@microsoft.com, Microsoft Corp
     8% Gor Nishanov, gorn@microsoft.com, Microsoft Corp
     9% James Noble, kjx@ecs.vuw.ac.nz, Victoria University of Wellington, School of Engineering and Computer Science
    410
    511\received{XXXXX}
     
    312318As a result, languages like Java, Scala, Objective-C~\cite{obj-c-book}, \CCeleven~\cite{C11}, and C\#~\cite{Csharp} adopt the 1:1 kernel-threading model, with a variety of presentation mechanisms.
    313319From 2000 onwards, languages like Go~\cite{Go}, Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, D~\cite{D}, and \uC~\cite{uC++,uC++book} have championed the M:N user-threading model, and many user-threading libraries have appeared~\cite{Qthreads,MPC,Marcel}, including putting green threads back into Java~\cite{Quasar}.
    314 The main argument for user-level threading is that they are lighter weight than kernel threads (locking and context switching do not cross the kernel boundary), so there is less restriction on programming styles that encourage large numbers of threads performing medium work units to facilitate load balancing by the runtime~\cite{Verch12}.
     320The main argument for user-level threading is that it is lighter weight than kernel threading (locking and context switching do not cross the kernel boundary), so there is less restriction on programming styles that encourage large numbers of threads performing medium work units to facilitate load balancing by the runtime~\cite{Verch12}.
    315321As well, user-threading facilitates a simpler concurrency approach using thread objects that leverage sequential patterns versus events with call-backs~\cite{Adya02,vonBehren03}.
    316322Finally, performant user-threading implementations (both time and space) meet or exceed direct kernel-threading implementations, while achieving the programming advantages of high concurrency levels and safety.
     
    669675In contrast, the execution state is large, with one @resume@ and seven @suspend@s.
    670676Hence, the key benefits of the generator are correctness, safety, and maintenance because the execution states are transcribed directly into the programming language rather than using a table-driven approach.
    671 Because FSMs can be complex and frequently occur in important domains, direct support of the generator is crucial in a system programming language.
     677Because FSMs can be complex and frequently occur in important domains, direct generator support is important in a system programming language.
    672678
    673679\begin{figure}
     
    796802This semantics is basically a tail-call optimization, which compilers already perform.
    797803The example shows the assembly code to undo the generator's entry code before the direct jump.
    798 This assembly code depends on what entry code is generated, specifically if there are local variables, and the level of optimization.
     804This assembly code depends on what entry code is generated, specifically if there are local variables and the level of optimization.
    799805To provide this new calling convention requires a mechanism built into the compiler, which is beyond the scope of \CFA at this time.
    800806Nevertheless, it is possible to hand generate any symmetric generators for proof of concept and performance testing.
  • libcfa/prelude/builtins.c

    rd6a8aef ree6dbae  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 26 23:10:36 2019
    13 // Update Count     : 95
     12// Last Modified On : Tue Jun 25 18:06:52 2019
     13// Update Count     : 97
    1414//
    1515
     
    4949void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
    5050
    51 // increment/decrement unification
     51// implicit increment, decrement if += defined, and implicit not if != defined
    5252
    5353static inline {
     
    6363        forall( dtype DT | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?-=?( DT &, one_t ); } )
    6464        DT & ?--( DT & x ) { DT tmp = x; x -= 1; return tmp; }
     65
     66        forall( dtype DT | { int ?!=?( const DT &, zero_t ); } )
     67        int !?( const DT & x ) { return !( x != 0 ); }
    6568} // distribution
    6669
  • libcfa/src/bits/containers.hfa

    rd6a8aef ree6dbae  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 16:38:50 2017
    11 // Last Modified By : --
    12 // Last Modified On : --
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jun 26 08:52:20 2019
     13// Update Count     : 4
    1414
    1515#pragma once
     
    115115                }
    116116                return top;
     117        }
     118
     119        forall(dtype T | is_node(T))
     120        static inline int ?!=?( const __stack(T) & this, __attribute__((unused)) zero_t zero ) {
     121                return this.top != 0;
    117122        }
    118123#endif
     
    186191
    187192        forall(dtype T | is_node(T))
    188         static inline bool ?!=?( __queue(T) & this, __attribute__((unused)) zero_t zero ) {
     193        static inline int ?!=?( const __queue(T) & this, __attribute__((unused)) zero_t zero ) {
    189194                return this.head != 0;
    190195        }
     
    268273
    269274        forall(dtype T | sized(T))
    270         static inline bool ?!=?( __dllist(T) & this, __attribute__((unused)) zero_t zero ) {
     275        static inline int ?!=?( const __dllist(T) & this, __attribute__((unused)) zero_t zero ) {
    271276                return this.head != 0;
    272277        }
  • libcfa/src/stdlib.cfa

    rd6a8aef ree6dbae  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 12 08:03:59 2018
    13 // Update Count     : 458
     12// Last Modified On : Mon Jun 24 17:34:44 2019
     13// Update Count     : 462
    1414//
    1515
     
    6565forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )
    6666T * anew( size_t dim, Params p ) {
    67         T *arr = alloc( dim );
     67        T * arr = alloc( dim );
    6868        for ( unsigned int i = 0; i < dim; i += 1 ) {
    6969                (arr[i]){ p };                                                                  // run constructor
  • src/Parser/LinkageSpec.h

    rd6a8aef ree6dbae  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:24:28 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Spt 13 15:59:00 2018
    13 // Update Count     : 17
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jul 10 16:02:34 2019
     13// Update Count     : 18
    1414//
    1515
     
    3535                constexpr Spec( unsigned int val ) : val( val ) {}
    3636                constexpr Spec( Spec const & other ) : val( other.val ) {}
     37                constexpr Spec & operator=( const Spec & ) = default;
    3738                // Operators may go here.
    3839                // Supports == and !=
  • src/ResolvExpr/ResolveAssertions.cc

    rd6a8aef ree6dbae  
    99// Author           : Aaron B. Moss
    1010// Created On       : Fri Oct 05 13:46:00 2018
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Fri Oct 05 13:46:00 2018
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jul 10 16:10:37 2019
     13// Update Count     : 2
    1414//
    1515
     
    368368                std::string resKey = SymTab::Mangler::mangleType( resType );
    369369                delete resType;
    370                 return std::move( resKey );
     370                return resKey;
    371371        }
    372372       
  • src/SynTree/BaseSyntaxNode.h

    rd6a8aef ree6dbae  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Feb 14 07:44:20 2017
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 17 13:44:00
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jul 10 16:13:49 2019
     13// Update Count     : 4
    1414//
    1515
     
    2525class BaseSyntaxNode {
    2626  public:
    27   static Stats::Counters::SimpleCounter* new_nodes;
     27        static Stats::Counters::SimpleCounter* new_nodes;
    2828
    2929        CodeLocation location;
    3030
    31   BaseSyntaxNode() { ++*new_nodes; }
    32   BaseSyntaxNode( const BaseSyntaxNode& o ) : location(o.location) { ++*new_nodes; }
    33 
     31        BaseSyntaxNode() { ++*new_nodes; }
     32        BaseSyntaxNode( const BaseSyntaxNode & o ) : location(o.location) { ++*new_nodes; }
     33        BaseSyntaxNode & operator=( const BaseSyntaxNode & ) = default;
     34       
    3435        virtual ~BaseSyntaxNode() {}
    3536
     
    3738        virtual void accept( Visitor & v ) = 0;
    3839        virtual BaseSyntaxNode * acceptMutator( Mutator & m ) = 0;
    39   /// Notes:
    40   /// * each node is responsible for indenting its children.
    41   /// * Expressions should not finish with a newline, since the expression's parent has better information.
     40        /// Notes:
     41        /// * each node is responsible for indenting its children.
     42        /// * Expressions should not finish with a newline, since the expression's parent has better information.
    4243        virtual void print( std::ostream & os, Indenter indent = {} ) const = 0;
    4344};
  • src/SynTree/Constant.h

    rd6a8aef ree6dbae  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Spt 28 14:48:00 2018
    13 // Update Count     : 18
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jul 10 15:57:38 2019
     13// Update Count     : 19
    1414//
    1515
     
    3030        Constant( Type * type, std::string rep, std::optional<unsigned long long> i );
    3131        Constant( const Constant & other );
     32        Constant & operator=( const Constant & ) = default;
    3233        virtual ~Constant();
    3334
  • tests/.expect/completeTypeError.txt

    rd6a8aef ree6dbae  
    2727    void
    2828  )
    29   Environment:( _82_4_DT ) -> instance of struct A with body 0 (no widening)
     29  Environment:( _83_4_DT ) -> instance of struct A with body 0 (no widening)
    3030
    3131
     
    5050    void
    5151  )
    52   Environment:( _82_4_DT ) -> instance of struct B with body 1 (no widening)
     52  Environment:( _83_4_DT ) -> instance of struct B with body 1 (no widening)
    5353
    5454
     
    127127          void
    128128        )
    129         Environment:( _101_0_T ) -> instance of type T (not function type) (no widening)
     129        Environment:( _102_0_T ) -> instance of type T (not function type) (no widening)
    130130
    131131      Could not satisfy assertion:
    132132?=?: pointer to function
    133133        ... with parameters
    134           reference to instance of type _101_0_T (not function type)
    135           instance of type _101_0_T (not function type)
     134          reference to instance of type _102_0_T (not function type)
     135          instance of type _102_0_T (not function type)
    136136        ... returning
    137           _retval__operator_assign: instance of type _101_0_T (not function type)
     137          _retval__operator_assign: instance of type _102_0_T (not function type)
    138138          ... with attributes:
    139139            Attribute with name: unused
Note: See TracChangeset for help on using the changeset viewer.