More of the concurrent copying collector.
Bug: 12687968
Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
diff --git a/runtime/stack.h b/runtime/stack.h
index 233e1c3..b2b2072 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -24,6 +24,7 @@
#include "dex_file.h"
#include "gc_root.h"
#include "mirror/object_reference.h"
+#include "read_barrier.h"
#include "throw_location.h"
#include "utils.h"
#include "verify_object.h"
@@ -163,6 +164,9 @@
const uint32_t* vreg_ptr = &vregs_[i];
ref = reinterpret_cast<const StackReference<mirror::Object>*>(vreg_ptr)->AsMirrorPtr();
}
+ if (kUseReadBarrier) {
+ ReadBarrier::AssertToSpaceInvariant(ref);
+ }
if (kVerifyFlags & kVerifyReads) {
VerifyObject(ref);
}
@@ -230,6 +234,9 @@
if (kVerifyFlags & kVerifyWrites) {
VerifyObject(val);
}
+ if (kUseReadBarrier) {
+ ReadBarrier::AssertToSpaceInvariant(val);
+ }
uint32_t* vreg = &vregs_[i];
reinterpret_cast<StackReference<mirror::Object>*>(vreg)->Assign(val);
if (HasReferenceArray()) {