Changeset 164d036


Ignore:
Timestamp:
Dec 8, 2016, 5:53:25 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6a16806
Parents:
9def87a (diff), b58a5772 (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:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r9def87a r164d036  
    168168                                architectureFlag = ''
    169169                                if (buildArchitecture == '64-bit') {
    170                                         architectureFlag = '--host=x86_64 CXXFLAGS="-m64" CFAFLAGS="-m64"'
     170                                        architectureFlag = '--host=x86_64 CXXFLAGS="-m64 -O2" CFAFLAGS="-m64"'
    171171                                } else if (buildArchitecture == '32-bit'){
    172                                         architectureFlag = '--host=i386 CXXFLAGS="-m32" CFAFLAGS="-m32"'
     172                                        architectureFlag = '--host=i386 CXXFLAGS="-m32 -O2" CFAFLAGS="-m32"'
    173173                                } else {
    174174                                        architectureFlag = 'ERROR'
  • src/ResolvExpr/CommonType.cc

    r9def87a r164d036  
    4242                virtual void visit( OneType *oneType );
    4343
     44                void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer );
    4445                template< typename RefType > void handleRefType( RefType *inst, Type *other );
    4546
     
    145146        }
    146147
     148        void CommonType::getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ) {
     149                if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) {
     150                        OpenVarSet::const_iterator entry = openVars.find( var->get_name() );
     151                        if ( entry != openVars.end() ) {
     152                                AssertionSet need, have;
     153                                WidenMode widen( widenFirst, widenSecond );
     154                                if ( entry != openVars.end() && ! bindVar(var, voidPointer->get_base(), entry->second, env, need, have, openVars, widen, indexer ) ) return;
     155                        }
     156                }
     157                result = voidPointer->clone();
     158                result->get_qualifiers() += otherPointer->get_qualifiers();
     159        }
     160       
    147161        void CommonType::visit( PointerType *pointerType ) {
    148162                if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
    149163                        if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) {
    150                                 result = otherPointer->clone();
    151                                 result->get_qualifiers() += pointerType->get_qualifiers();
     164                                getCommonWithVoidPointer( otherPointer, pointerType );
    152165                        } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) {
    153                                 result = pointerType->clone();
    154                                 result->get_qualifiers() += otherPointer->get_qualifiers();
     166                                getCommonWithVoidPointer( pointerType, otherPointer );
    155167                        } else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst )
    156168                                           && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) {
  • src/ResolvExpr/Unify.cc

    r9def87a r164d036  
    3131
    3232namespace ResolvExpr {
    33         struct WidenMode {
    34                 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
    35                 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
    36                 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
    37                 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
    38                 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
    39                 operator bool() { return widenFirst && widenSecond; }
    40 
    41                 bool widenFirst : 1, widenSecond : 1;
    42         };
    4333
    4434        class Unify : public Visitor {
  • src/ResolvExpr/Unify.h

    r9def87a r164d036  
    2727
    2828namespace ResolvExpr {
     29        struct WidenMode {
     30                WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
     31                WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
     32                WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
     33                WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
     34                WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
     35                operator bool() { return widenFirst && widenSecond; }
     36
     37                bool widenFirst : 1, widenSecond : 1;
     38        };
     39       
     40        bool bindVar( TypeInstType *typeInst, Type *other, TypeDecl::Kind kind, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
    2941        bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
    3042        bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
  • src/libcfa/concurrency/CtxSwitch-x86_64.S

    r9def87a r164d036  
    7979.text
    8080        .align 2
    81 .globl  coInvokeStub
    82 coInvokeStub:
     81.globl  CtxInvokeStub
     82CtxInvokeStub:
    8383        movq %rbx, %rdi
    8484        jmp *%r12
  • src/libcfa/concurrency/invoke.c

    r9def87a r164d036  
    1515extern void __suspend__F___1(void);
    1616
    17 void invokeCoroutine(
     17void CtxInvokeCoroutine(
    1818      void (*main)(void *),
    1919      struct coroutine *(*get_coroutine)(void *),
     
    3434
    3535
    36 void startCoroutine(
     36void CtxStart(
    3737      void (*main)(void *),
    3838      struct coroutine *(*get_coroutine)(void *),
     
    7373
    7474      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL;
    75       ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = coInvokeStub;
     75      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub;
    7676      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
    7777      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
  • src/libcfa/concurrency/invoke.h

    r9def87a r164d036  
    4545
    4646      // assembler routines that performs the context switch
    47       extern void coInvokeStub( void );
     47      extern void CtxInvokeStub( void );
    4848      void CtxSwitch( void *from, void *to ) asm ("CtxSwitch");
    4949
  • src/libcfa/concurrency/threads.c

    r9def87a r164d036  
    4444}
    4545
    46 void ctxSwitchDirect(coroutine* src, coroutine* dst);
     46void corCxtSw(coroutine* src, coroutine* dst);
    4747void create_stack( coStack_t* this, unsigned int storageSize ); // used by all constructors
    4848
    4949extern "C" {
    5050      forall(dtype T | is_coroutine(T))
    51       void invokeCoroutine(T* this);
     51      void CtxInvokeCoroutine(T* this);
    5252
    5353      forall(dtype T | is_coroutine(T))
    54       void startCoroutine(T* this, void (*invoke)(T*));
     54      void CtxStart(T* this, void (*invoke)(T*));
    5555}
    5656
     
    100100                src->name, src, src->last->name, src->last );
    101101
    102         ctxSwitchDirect( src, src->last );
     102        corCxtSw( src, src->last );
    103103}
    104104
     
    108108        coroutine* dst = get_coroutine(cor);
    109109
    110         if( ((intptr_t)dst->stack.base) == 0 ) {
     110        if( dst->stack.base == NULL ) {
    111111                create_stack(&dst->stack, dst->stack.size);
    112                 startCoroutine(cor, invokeCoroutine);
     112                CtxStart(cor, CtxInvokeCoroutine);
    113113        }
    114114
     
    120120                dst->last = src;                                        // set last resumer
    121121        } // if
    122         ctxSwitchDirect( src, dst );                            // always done for performance testing
     122        corCxtSw( src, dst );                           // always done for performance testing
    123123}
    124124
     
    132132}
    133133
    134 void ctxSwitchDirect(coroutine* src, coroutine* dst) {
     134void corCxtSw(coroutine* src, coroutine* dst) {
    135135        // THREAD_GETMEM( This )->disableInterrupts();
    136136
  • src/libcfa/prelude.cf

    r9def87a r164d036  
    273273forall( ftype FT ) signed int ?!=?( FT *, FT * );
    274274
    275 forall( dtype DT ) signed int ?==?( const volatile DT   *, const volatile void * );
    276 forall( dtype DT ) signed int ?==?( const volatile void *, const volatile DT * );
    277 forall( dtype DT ) signed int ?!=?( const volatile DT   *, const volatile void * );
    278 forall( dtype DT ) signed int ?!=?( const volatile void *, const volatile DT * );
     275// forall( dtype DT ) signed int ?==?( const volatile DT   *, const volatile void * );
     276// forall( dtype DT ) signed int ?==?( const volatile void *, const volatile DT * );
     277// forall( dtype DT ) signed int ?!=?( const volatile DT   *, const volatile void * );
     278// forall( dtype DT ) signed int ?!=?( const volatile void *, const volatile DT * );
    279279
    280280// forall( dtype DT ) signed int ?==?( const volatile DT *, forall( dtype DT2 )const DT2 * );
Note: See TracChangeset for help on using the changeset viewer.