Disable the CC collector / read barrier checks in non-debug build.
Bug: 12687968
Change-Id: Ia8295354b705018ffa864eb8101aa5c09528af13
diff --git a/runtime/gc/collector/concurrent_copying.h b/runtime/gc/collector/concurrent_copying.h
index e9ff618..afdc0f1 100644
--- a/runtime/gc/collector/concurrent_copying.h
+++ b/runtime/gc/collector/concurrent_copying.h
@@ -51,11 +51,10 @@
class ConcurrentCopying : public GarbageCollector {
public:
- // TODO: disable thse flags for production use.
// Enable the no-from-space-refs verification at the pause.
- static constexpr bool kEnableNoFromSpaceRefsVerification = true;
+ static constexpr bool kEnableNoFromSpaceRefsVerification = kIsDebugBuild;
// Enable the from-space bytes/objects check.
- static constexpr bool kEnableFromSpaceAccountingCheck = true;
+ static constexpr bool kEnableFromSpaceAccountingCheck = kIsDebugBuild;
// Enable verbose mode.
static constexpr bool kVerboseMode = false;
diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h
index b7bd99b..42e959c 100644
--- a/runtime/read_barrier.h
+++ b/runtime/read_barrier.h
@@ -37,11 +37,10 @@
class ReadBarrier {
public:
- // TODO: disable thse flags for production use.
// Enable the to-space invariant checks.
- static constexpr bool kEnableToSpaceInvariantChecks = true;
+ static constexpr bool kEnableToSpaceInvariantChecks = kIsDebugBuild;
// Enable the read barrier checks.
- static constexpr bool kEnableReadBarrierInvariantChecks = true;
+ static constexpr bool kEnableReadBarrierInvariantChecks = kIsDebugBuild;
// It's up to the implementation whether the given field gets updated whereas the return value
// must be an updated reference unless kAlwaysUpdateField is true.