Changes in / [164d036:9def87a]
- Files:
-
- 1 deleted
- 9 edited
-
Jenkinsfile (modified) (1 diff)
-
src/ResolvExpr/CommonType.cc (modified) (2 diffs)
-
src/ResolvExpr/Unify.cc (modified) (1 diff)
-
src/ResolvExpr/Unify.h (modified) (1 diff)
-
src/libcfa/concurrency/CtxSwitch-i686.S (deleted)
-
src/libcfa/concurrency/CtxSwitch-x86_64.S (modified) (1 diff)
-
src/libcfa/concurrency/invoke.c (modified) (3 diffs)
-
src/libcfa/concurrency/invoke.h (modified) (1 diff)
-
src/libcfa/concurrency/threads.c (modified) (5 diffs)
-
src/libcfa/prelude.cf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r164d036 r9def87a 168 168 architectureFlag = '' 169 169 if (buildArchitecture == '64-bit') { 170 architectureFlag = '--host=x86_64 CXXFLAGS="-m64 -O2" CFAFLAGS="-m64"'170 architectureFlag = '--host=x86_64 CXXFLAGS="-m64" CFAFLAGS="-m64"' 171 171 } else if (buildArchitecture == '32-bit'){ 172 architectureFlag = '--host=i386 CXXFLAGS="-m32 -O2" CFAFLAGS="-m32"'172 architectureFlag = '--host=i386 CXXFLAGS="-m32" CFAFLAGS="-m32"' 173 173 } else { 174 174 architectureFlag = 'ERROR' -
src/ResolvExpr/CommonType.cc
r164d036 r9def87a 42 42 virtual void visit( OneType *oneType ); 43 43 44 void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer );45 44 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 46 45 … … 146 145 } 147 146 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 161 147 void CommonType::visit( PointerType *pointerType ) { 162 148 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 163 149 if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) { 164 getCommonWithVoidPointer( otherPointer, pointerType ); 150 result = otherPointer->clone(); 151 result->get_qualifiers() += pointerType->get_qualifiers(); 165 152 } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) { 166 getCommonWithVoidPointer( pointerType, otherPointer ); 153 result = pointerType->clone(); 154 result->get_qualifiers() += otherPointer->get_qualifiers(); 167 155 } else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst ) 168 156 && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) { -
src/ResolvExpr/Unify.cc
r164d036 r9def87a 31 31 32 32 namespace 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 }; 33 43 34 44 class Unify : public Visitor { -
src/ResolvExpr/Unify.h
r164d036 r9def87a 27 27 28 28 namespace 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 );41 29 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 42 30 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
r164d036 r9def87a 79 79 .text 80 80 .align 2 81 .globl CtxInvokeStub82 CtxInvokeStub:81 .globl coInvokeStub 82 coInvokeStub: 83 83 movq %rbx, %rdi 84 84 jmp *%r12 -
src/libcfa/concurrency/invoke.c
r164d036 r9def87a 15 15 extern void __suspend__F___1(void); 16 16 17 void CtxInvokeCoroutine(17 void invokeCoroutine( 18 18 void (*main)(void *), 19 19 struct coroutine *(*get_coroutine)(void *), … … 34 34 35 35 36 void CtxStart(36 void startCoroutine( 37 37 void (*main)(void *), 38 38 struct coroutine *(*get_coroutine)(void *), … … 73 73 74 74 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->dummyReturn = NULL; 75 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = CtxInvokeStub;75 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->rturn = coInvokeStub; 76 76 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this; 77 77 ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke; -
src/libcfa/concurrency/invoke.h
r164d036 r9def87a 45 45 46 46 // assembler routines that performs the context switch 47 extern void CtxInvokeStub( void );47 extern void coInvokeStub( void ); 48 48 void CtxSwitch( void *from, void *to ) asm ("CtxSwitch"); 49 49 -
src/libcfa/concurrency/threads.c
r164d036 r9def87a 44 44 } 45 45 46 void c orCxtSw(coroutine* src, coroutine* dst);46 void ctxSwitchDirect(coroutine* src, coroutine* dst); 47 47 void create_stack( coStack_t* this, unsigned int storageSize ); // used by all constructors 48 48 49 49 extern "C" { 50 50 forall(dtype T | is_coroutine(T)) 51 void CtxInvokeCoroutine(T* this);51 void invokeCoroutine(T* this); 52 52 53 53 forall(dtype T | is_coroutine(T)) 54 void CtxStart(T* this, void (*invoke)(T*));54 void startCoroutine(T* this, void (*invoke)(T*)); 55 55 } 56 56 … … 100 100 src->name, src, src->last->name, src->last ); 101 101 102 c orCxtSw( src, src->last );102 ctxSwitchDirect( src, src->last ); 103 103 } 104 104 … … 108 108 coroutine* dst = get_coroutine(cor); 109 109 110 if( dst->stack.base == NULL) {110 if( ((intptr_t)dst->stack.base) == 0 ) { 111 111 create_stack(&dst->stack, dst->stack.size); 112 CtxStart(cor, CtxInvokeCoroutine);112 startCoroutine(cor, invokeCoroutine); 113 113 } 114 114 … … 120 120 dst->last = src; // set last resumer 121 121 } // if 122 c orCxtSw( src, dst ); // always done for performance testing122 ctxSwitchDirect( src, dst ); // always done for performance testing 123 123 } 124 124 … … 132 132 } 133 133 134 void c orCxtSw(coroutine* src, coroutine* dst) {134 void ctxSwitchDirect(coroutine* src, coroutine* dst) { 135 135 // THREAD_GETMEM( This )->disableInterrupts(); 136 136 -
src/libcfa/prelude.cf
r164d036 r9def87a 273 273 forall( ftype FT ) signed int ?!=?( FT *, FT * ); 274 274 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 * ); 279 279 280 280 // forall( dtype DT ) signed int ?==?( const volatile DT *, forall( dtype DT2 )const DT2 * );
Note:
See TracChangeset
for help on using the changeset viewer.