summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/object-inl.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-05-26 21:34:09 -0700
committerAndreas Gampe <agampe@google.com>2015-05-27 08:24:03 -0700
commit3b45ef277e4a5f7e0314d5df7ef82e480156ba75 (patch)
tree1df28568b9e7e4e50102b7f834fab6e943c444a5 /runtime/mirror/object-inl.h
parentc06841dac1443e99e92596f15caa82c99bfee010 (diff)
downloadart-3b45ef277e4a5f7e0314d5df7ef82e480156ba75.tar.gz
art-3b45ef277e4a5f7e0314d5df7ef82e480156ba75.tar.bz2
art-3b45ef277e4a5f7e0314d5df7ef82e480156ba75.zip
ART: Fix VerifyObject runtime verification
Update some bit-rotted code to work again. Most tests now work, for some the verification overhead results in a timeout. Change-Id: Ieab4f2de474a05e915e24abc93da3c2eeed996eb
Diffstat (limited to 'runtime/mirror/object-inl.h')
-rw-r--r--runtime/mirror/object-inl.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h
index 39d0f5664f..7760ea2cfd 100644
--- a/runtime/mirror/object-inl.h
+++ b/runtime/mirror/object-inl.h
@@ -59,19 +59,23 @@ inline void Object::SetClass(Class* new_klass) {
OFFSET_OF_OBJECT_MEMBER(Object, klass_), new_klass);
}
+template<VerifyObjectFlags kVerifyFlags>
inline LockWord Object::GetLockWord(bool as_volatile) {
if (as_volatile) {
- return LockWord(GetField32Volatile(OFFSET_OF_OBJECT_MEMBER(Object, monitor_)));
+ return LockWord(GetField32Volatile<kVerifyFlags>(OFFSET_OF_OBJECT_MEMBER(Object, monitor_)));
}
- return LockWord(GetField32(OFFSET_OF_OBJECT_MEMBER(Object, monitor_)));
+ return LockWord(GetField32<kVerifyFlags>(OFFSET_OF_OBJECT_MEMBER(Object, monitor_)));
}
+template<VerifyObjectFlags kVerifyFlags>
inline void Object::SetLockWord(LockWord new_val, bool as_volatile) {
// Force use of non-transactional mode and do not check.
if (as_volatile) {
- SetField32Volatile<false, false>(OFFSET_OF_OBJECT_MEMBER(Object, monitor_), new_val.GetValue());
+ SetField32Volatile<false, false, kVerifyFlags>(
+ OFFSET_OF_OBJECT_MEMBER(Object, monitor_), new_val.GetValue());
} else {
- SetField32<false, false>(OFFSET_OF_OBJECT_MEMBER(Object, monitor_), new_val.GetValue());
+ SetField32<false, false, kVerifyFlags>(
+ OFFSET_OF_OBJECT_MEMBER(Object, monitor_), new_val.GetValue());
}
}