summaryrefslogtreecommitdiffstats
path: root/runtime/gc/collector/semi_space.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-02-19 10:54:44 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-21 15:24:04 -0800
commit4e30541a92381fb280cd0be9a1763b713ee4d64c (patch)
tree84093651bbf0ad95b66b846c4f4cf4101994037b /runtime/gc/collector/semi_space.cc
parente266ba9935bd12d685d83f73cd8d759e46c3014d (diff)
downloadart-4e30541a92381fb280cd0be9a1763b713ee4d64c.zip
art-4e30541a92381fb280cd0be9a1763b713ee4d64c.tar.gz
art-4e30541a92381fb280cd0be9a1763b713ee4d64c.tar.bz2
Fix and optimize verify object.
VerifyObject no longer resides in heap. You can now enable VerifyObject for non-debug builds. VerifyStack is still slow, so it is now guarded by its own flag. Fixed the image writer to not use verification at places where verification fails due to invalid reads. Fixed RosAlloc to use SizeOf which doesn't call verify object. Added a flag paremeter to some of the mirror getters / setters to be able to selectively disable VerifyObject on certain calls. Optimized the GC to not verify each object multiple times during object scanning if verify object is enabled. Added 3 verification options: verify reads, verify this, and verify writes so that you can select how much verification you want for mirror getters and setters. Removed some useless DCHECKs which would slow debug builds without providing any benefits. TODO: RosAlloc verification doesn't currently work with verify objects. Bug: 12934910 Bug: 12879358 Change-Id: Ic61033104dfc334543f89b0fc0ad8cd4f4015d69
Diffstat (limited to 'runtime/gc/collector/semi_space.cc')
-rw-r--r--runtime/gc/collector/semi_space.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc
index 882867b..fe8c253 100644
--- a/runtime/gc/collector/semi_space.cc
+++ b/runtime/gc/collector/semi_space.cc
@@ -666,11 +666,11 @@ void SemiSpace::ScanObject(Object* obj) {
// case since it does not dirty cards and use additional memory.
// Since we do not change the actual object, we can safely use non-transactional mode. Also
// disable check as we could run inside a transaction.
- obj->SetFieldObjectWithoutWriteBarrier<false, false>(offset, new_address, false);
+ obj->SetFieldObjectWithoutWriteBarrier<false, false, kVerifyNone>(offset, new_address, false);
}
}, kMovingClasses);
- mirror::Class* klass = obj->GetClass();
- if (UNLIKELY(klass->IsReferenceClass())) {
+ mirror::Class* klass = obj->GetClass<kVerifyNone>();
+ if (UNLIKELY(klass->IsReferenceClass<kVerifyNone>())) {
DelayReferenceReferent(klass, obj);
}
}