Add thread pool class
Added a thread pool class loosely based on google3 code.
Modified the compiler to have a single thread pool instead of creating new threads in ForAll.
Moved barrier to be in top level directory as it is not GC specific code.
Performance Timings:
Reference:
boot.oat: 14.306596s
time mm oat-target:
real 2m33.748s
user 10m23.190s
sys 5m54.140s
Thread pool:
boot.oat: 13.111049s
time mm oat-target:
real 2m29.372s
user 10m3.130s
sys 5m46.290s
The speed increase is probably just noise.
Change-Id: If3c1280cbaa4c7e4361127d064ac744ea12cdf49
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 178af64..f4c7c98 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -164,6 +164,7 @@
LIBART_COMMON_SRC_FILES := \
src/atomic.cc.arm \
+ src/barrier.cc \
src/check_jni.cc \
src/class_linker.cc \
src/common_throws.cc \
@@ -181,7 +182,6 @@
src/dlmalloc.cc \
src/file.cc \
src/file_linux.cc \
- src/gc/barrier.cc \
src/gc/card_table.cc \
src/gc/heap_bitmap.cc \
src/gc/large_object_space.cc \
@@ -257,6 +257,7 @@
src/stringprintf.cc \
src/thread.cc \
src/thread_list.cc \
+ src/thread_pool.cc \
src/trace.cc \
src/utf.cc \
src/utils.cc \
@@ -394,6 +395,7 @@
test/ReferenceMap/stack_walk_refmap_jni.cc
TEST_COMMON_SRC_FILES := \
+ src/barrier_test.cc \
src/class_linker_test.cc \
src/compiler_test.cc \
src/dex_cache_test.cc \
@@ -418,6 +420,7 @@
src/reference_table_test.cc \
src/runtime_support_test.cc \
src/runtime_test.cc \
+ src/thread_pool_test.cc \
src/utils_test.cc \
src/zip_archive_test.cc \
src/verifier/method_verifier_test.cc \