From: Bart Van Assche Date: Fri, 6 Jun 2008 10:18:24 +0000 (+0000) Subject: Enable more optimization opportunities. X-Git-Tag: svn/VALGRIND_3_4_0~509 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=380d96c2bef9da9b4526f2c69a082ecbf65fe7d8;p=thirdparty%2Fvalgrind.git Enable more optimization opportunities. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8195 --- diff --git a/exp-drd/Makefile.am b/exp-drd/Makefile.am index ef2441efa5..9f033852e1 100644 --- a/exp-drd/Makefile.am +++ b/exp-drd/Makefile.am @@ -97,11 +97,8 @@ DRD_SOURCES_COMMON = \ drd_malloc_wrappers.c \ drd_mutex.c \ drd_rwlock.c \ - drd_segment.c \ drd_semaphore.c \ - drd_suppression.c \ - drd_thread.c \ - drd_vc.c + drd_suppression.c noinst_HEADERS = \ drd_barrier.h \ diff --git a/exp-drd/drd_main.c b/exp-drd/drd_main.c index 4fb9010574..c8131897ea 100644 --- a/exp-drd/drd_main.c +++ b/exp-drd/drd_main.c @@ -54,6 +54,15 @@ #include "pub_tool_tooliface.h" +/* Include several source files here in order to allow the compiler to */ +/* do more inlining. */ +#include "drd_bitmap.c" +#include "drd_segment.c" +#include "drd_thread.c" +#include "drd_vc.c" + + + // Function declarations. static void drd_start_client_code(const ThreadId tid, const ULong bbs_done); diff --git a/exp-drd/drd_thread.c b/exp-drd/drd_thread.c index a015508544..cc15eb9056 100644 --- a/exp-drd/drd_thread.c +++ b/exp-drd/drd_thread.c @@ -39,9 +39,6 @@ #include "pub_tool_options.h" // VG_(clo_backtrace_size) #include "pub_tool_threadstate.h" // VG_(get_pthread_id)() -/* Include the drd_bitmap.c source file here to allow the compiler to */ -/* inline the bitmap manipulation functions called from this source file. */ -#include "drd_bitmap.c" // Local functions. @@ -89,14 +86,6 @@ void thread_set_segment_merging(const Bool m) s_segment_merging = m; } -__inline__ Bool IsValidDrdThreadId(const DrdThreadId tid) -{ - return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID - && ! (s_threadinfo[tid].vg_thread_exists == False - && s_threadinfo[tid].posix_thread_exists == False - && s_threadinfo[tid].detached_posix_thread == False)); -} - /** * Convert Valgrind's ThreadId into a DrdThreadId. Report failure if * Valgrind's ThreadId does not yet exist. diff --git a/exp-drd/drd_thread.h b/exp-drd/drd_thread.h index 7a0bd25002..299bed3210 100644 --- a/exp-drd/drd_thread.h +++ b/exp-drd/drd_thread.h @@ -92,7 +92,6 @@ extern struct bitmap* s_danger_set; void thread_trace_context_switches(const Bool t); void thread_trace_danger_set(const Bool t); void thread_set_segment_merging(const Bool m); -Bool IsValidDrdThreadId(const DrdThreadId tid); DrdThreadId VgThreadIdToDrdThreadId(const ThreadId tid); DrdThreadId NewVgThreadIdToDrdThreadId(const ThreadId tid); @@ -154,6 +153,15 @@ ULong thread_get_danger_set_bitmap_creation_count(void); ULong thread_get_danger_set_bitmap2_creation_count(void); +static __inline__ +Bool IsValidDrdThreadId(const DrdThreadId tid) +{ + return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID + && ! (s_threadinfo[tid].vg_thread_exists == False + && s_threadinfo[tid].posix_thread_exists == False + && s_threadinfo[tid].detached_posix_thread == False)); +} + static inline DrdThreadId thread_get_running_tid(void) {