Changes in / [140eb16:4d8fbf4]
- Files:
-
- 6 added
- 12 edited
-
benchmark/Makefile.am (modified) (3 diffs)
-
benchmark/bench.h (modified) (1 diff)
-
benchmark/mutexStmt/JavaThread.java (added)
-
benchmark/mutexStmt/cpp1.cc (added)
-
benchmark/mutexStmt/cpp2.cc (added)
-
benchmark/mutexStmt/cpp4.cc (added)
-
benchmark/mutexStmt/cpp8.cc (added)
-
benchmark/mutexStmt/cppLock.hpp (added)
-
benchmark/mutexStmt/lock1.cfa (modified) (1 diff)
-
benchmark/mutexStmt/lock2.cfa (modified) (1 diff)
-
benchmark/mutexStmt/lock4.cfa (modified) (1 diff)
-
benchmark/mutexStmt/lock8.cfa (modified) (1 diff)
-
benchmark/mutexStmt/no_stmt_lock1.cfa (modified) (1 diff)
-
benchmark/mutexStmt/no_stmt_lock2.cfa (modified) (1 diff)
-
benchmark/mutexStmt/no_stmt_lock4.cfa (modified) (1 diff)
-
benchmark/mutexStmt/no_stmt_lock8.cfa (modified) (1 diff)
-
libcfa/src/concurrency/mutex_stmt.hfa (modified) (1 diff)
-
src/Concurrency/Keywords.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
r140eb16 r4d8fbf4 372 372 chmod a+x a.out 373 373 374 ## ========================================================================================================= 375 374 376 mutexStmt$(EXEEXT) : \ 377 mutexStmt-cpp1.run \ 378 mutexStmt-cpp2.run \ 379 mutexStmt-cpp4.run \ 380 mutexStmt-cpp8.run \ 381 mutexStmt-java.run \ 375 382 mutexStmt-lock1.run \ 376 383 mutexStmt-lock2.run \ … … 397 404 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock8.cfa 398 405 406 mutexStmt-cpp1$(EXEEXT): 407 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp1.cc 408 409 mutexStmt-cpp2$(EXEEXT): 410 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp2.cc 411 412 mutexStmt-cpp4$(EXEEXT): 413 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp4.cc 414 415 mutexStmt-cpp8$(EXEEXT): 416 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp8.cc 417 399 418 mutexStmt-monitor1$(EXEEXT): 400 419 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/monitor1.cfa … … 417 436 mutexStmt-no-stmt-lock8$(EXEEXT): 418 437 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock8.cfa 438 439 mutexStmt-java$(EXEEXT): 440 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutexStmt/JavaThread.java 441 echo "#!/bin/sh" > a.out 442 echo "java JavaThread \"$$""@\"" >> a.out 443 chmod a+x a.out 419 444 420 445 ## ========================================================================================================= -
benchmark/bench.h
r140eb16 r4d8fbf4 21 21 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 22 22 } // bench_time 23 24 25 #if defined(__cforall) 26 struct test_spinlock { 27 volatile bool lock; 28 }; 29 30 static inline void lock( test_spinlock & this ) { 31 for ( ;; ) { 32 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 33 } 34 } 35 36 static inline void unlock( test_spinlock & this ) { 37 __atomic_clear( &this.lock, __ATOMIC_RELEASE ); 38 } 39 #endif 23 40 24 41 #ifndef BENCH_N -
benchmark/mutexStmt/lock1.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1;7 test_spinlock l1; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/lock2.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2;7 test_spinlock l1, l2; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/lock4.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2, l3, l4;7 test_spinlock l1, l2, l3, l4; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/lock8.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2, l3, l4, l5, l6, l7, l8;7 test_spinlock l1, l2, l3, l4, l5, l6, l7, l8; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/no_stmt_lock1.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1;7 test_spinlock l1; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/no_stmt_lock2.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2;7 test_spinlock l1, l2; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/no_stmt_lock4.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2, l3, l4;7 test_spinlock l1, l2, l3, l4; 8 8 9 9 int main( int argc, char * argv[] ) { -
benchmark/mutexStmt/no_stmt_lock8.cfa
r140eb16 r4d8fbf4 5 5 #include "bench.h" 6 6 7 single_acquisition_lock l1, l2, l3, l4, l5, l6, l7, l8;7 test_spinlock l1, l2, l3, l4, l5, l6, l7, l8; 8 8 9 9 int main( int argc, char * argv[] ) { -
libcfa/src/concurrency/mutex_stmt.hfa
r140eb16 r4d8fbf4 40 40 } 41 41 } 42 43 static inline L * __get_ptr( L & this ) { 44 return &this; 45 } 46 47 static inline L __get_type( L & this ); 48 49 static inline L __get_type( L * this ); 42 50 } -
src/Concurrency/Keywords.cc
r140eb16 r4d8fbf4 1200 1200 new PointerType( 1201 1201 noQualifiers, 1202 new TypeofType( noQualifiers, args.front()->clone() ) 1202 //new TypeofType( noQualifiers, args.front()->clone() ) 1203 new TypeofType( noQualifiers, new UntypedExpr( 1204 new NameExpr( "__get_type" ), 1205 { args.front()->clone() } 1206 ) 1207 ) 1203 1208 ), 1204 1209 new ConstantExpr( Constant::from_ulong( args.size() ) ), … … 1208 1213 new ListInit( 1209 1214 map_range < std::list<Initializer*> > ( args, [](Expression * var ){ 1210 return new SingleInit( new AddressExpr( var ) ); 1215 return new SingleInit( new UntypedExpr( 1216 new NameExpr( "__get_ptr" ), 1217 { var } 1218 ) ); 1219 //return new SingleInit( new AddressExpr( var ) ); 1211 1220 }) 1212 1221 ) … … 1214 1223 1215 1224 StructInstType * lock_guard_struct = new StructInstType( noQualifiers, lock_guard_decl ); 1216 TypeExpr * lock_type_expr = new TypeExpr( new TypeofType( noQualifiers, args.front()->clone() ) ); 1225 TypeExpr * lock_type_expr = new TypeExpr( 1226 new TypeofType( noQualifiers, new UntypedExpr( 1227 new NameExpr( "__get_type" ), 1228 { args.front()->clone() } 1229 ) 1230 ) 1231 ); 1217 1232 1218 1233 lock_guard_struct->parameters.push_back( lock_type_expr ) ;
Note:
See TracChangeset
for help on using the changeset viewer.