summaryrefslogtreecommitdiff
path: root/runtime/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/stack.h')
-rw-r--r--runtime/stack.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/stack.h b/runtime/stack.h
index 233e1c36a8..b2b207273a 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 @@ class ShadowFrame {
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 @@ class ShadowFrame {
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()) {