summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk4
-rw-r--r--dex2oat/dex2oat.cc9
-rw-r--r--runtime/instrumentation.cc5
-rw-r--r--runtime/instrumentation.h8
4 files changed, 18 insertions, 8 deletions
diff --git a/Android.mk b/Android.mk
index e89f6178e7..a518d2f56f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -270,9 +270,9 @@ endif
test-art-host-dexdump: $(addprefix $(HOST_OUT_EXECUTABLES)/, dexdump2 dexlist)
ANDROID_HOST_OUT=$(realpath $(HOST_OUT)) art/test/dexdump/run-all-tests
-# Valgrind. Currently only 32b gtests. TODO: change this from 32-bit only to both 32-bit and 64-bit.
+# Valgrind.
.PHONY: valgrind-test-art-host
-valgrind-test-art-host: valgrind-test-art-host-gtest32
+valgrind-test-art-host: valgrind-test-art-host-gtest
$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
.PHONY: valgrind-test-art-host32
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index a5d0c2797e..298101115d 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -255,6 +255,7 @@ NO_RETURN static void Usage(const char* fmt, ...) {
UsageError("");
UsageError(" --compiler-filter="
"(verify-none"
+ "|verify-at-runtime"
"|interpret-only"
"|space"
"|balanced"
@@ -287,8 +288,8 @@ NO_RETURN static void Usage(const char* fmt, ...) {
UsageError("");
UsageError(" --num-dex-methods=<method-count>: threshold size for a small dex file for");
UsageError(" compiler filter tuning. If the input has fewer than this many methods");
- UsageError(" and the filter is not interpret-only or verify-none, overrides the");
- UsageError(" filter to use speed");
+ UsageError(" and the filter is not interpret-only or verify-none or verify-at-runtime, ");
+ UsageError(" overrides the filter to use speed");
UsageError(" Example: --num-dex-method=%d", CompilerOptions::kDefaultNumDexMethodsThreshold);
UsageError(" Default: %d", CompilerOptions::kDefaultNumDexMethodsThreshold);
UsageError("");
@@ -1449,8 +1450,8 @@ class Dex2Oat FINAL {
}
/*
- * If we're not in interpret-only or verify-none mode, go ahead and compile small applications.
- * Don't bother to check if we're doing the image.
+ * If we're not in interpret-only or verify-none or verify-at-runtime mode, go ahead and
+ * compile small applications. Don't bother to check if we're doing the image.
*/
if (!IsBootImage() &&
compiler_options_->IsCompilationEnabled() &&
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index b107b72b55..a0c6bfbd83 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -83,7 +83,8 @@ Instrumentation::Instrumentation()
deoptimized_methods_lock_("deoptimized methods lock"),
deoptimization_enabled_(false),
interpreter_handler_table_(kMainHandlerTable),
- quick_alloc_entry_points_instrumentation_counter_(0) {
+ quick_alloc_entry_points_instrumentation_counter_(0),
+ alloc_entrypoints_instrumented_(false) {
}
void Instrumentation::InstallStubsForClass(mirror::Class* klass) {
@@ -642,10 +643,12 @@ void Instrumentation::SetEntrypointsInstrumented(bool instrumented) {
MutexLock mu(self, *Locks::runtime_shutdown_lock_);
SetQuickAllocEntryPointsInstrumented(instrumented);
ResetQuickAllocEntryPoints();
+ alloc_entrypoints_instrumented_ = instrumented;
} else {
MutexLock mu(self, *Locks::runtime_shutdown_lock_);
SetQuickAllocEntryPointsInstrumented(instrumented);
ResetQuickAllocEntryPoints();
+ alloc_entrypoints_instrumented_ = instrumented;
}
}
diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h
index b3cdb410f3..d07f47bf29 100644
--- a/runtime/instrumentation.h
+++ b/runtime/instrumentation.h
@@ -422,7 +422,7 @@ class Instrumentation {
// Does not hold lock, used to check if someone changed from not instrumented to instrumented
// during a GC suspend point.
bool AllocEntrypointsInstrumented() const SHARED_REQUIRES(Locks::mutator_lock_) {
- return quick_alloc_entry_points_instrumentation_counter_ > 0;
+ return alloc_entrypoints_instrumented_;
}
private:
@@ -579,6 +579,12 @@ class Instrumentation {
// Greater than 0 if quick alloc entry points instrumented.
size_t quick_alloc_entry_points_instrumentation_counter_;
+
+ // alloc_entrypoints_instrumented_ is only updated with all the threads suspended, this is done
+ // to prevent races with the GC where the GC relies on thread suspension only see
+ // alloc_entrypoints_instrumented_ change during suspend points.
+ bool alloc_entrypoints_instrumented_;
+
friend class InstrumentationTest; // For GetCurrentInstrumentationLevel and ConfigureStubs.
DISALLOW_COPY_AND_ASSIGN(Instrumentation);