Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: runtime/vm/scavenger.cc

Issue 2626343002: 1. Added new flag verify_gc_contains and moved all the asserts that do a (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/pages.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 1ca9e3f04ba05d237a8cca5f9d478aa093eec635..f728f6b967aba3b50bd1975f3de77c8f7516cd3b 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -79,9 +79,11 @@ class ScavengerVisitor : public ObjectPointerVisitor {
visiting_old_object_(NULL) {}
void VisitPointers(RawObject** first, RawObject** last) {
- ASSERT((visiting_old_object_ != NULL) ||
- scavenger_->Contains(reinterpret_cast<uword>(first)) ||
- !heap_->Contains(reinterpret_cast<uword>(first)));
+ if (FLAG_verify_gc_contains) {
+ ASSERT((visiting_old_object_ != NULL) ||
+ scavenger_->Contains(reinterpret_cast<uword>(first)) ||
+ !heap_->Contains(reinterpret_cast<uword>(first)));
+ }
for (RawObject** current = first; current <= last; current++) {
ScavengePointer(current);
}
@@ -96,11 +98,12 @@ class ScavengerVisitor : public ObjectPointerVisitor {
private:
void UpdateStoreBuffer(RawObject** p, RawObject* obj) {
- uword ptr = reinterpret_cast<uword>(p);
ASSERT(obj->IsHeapObject());
- ASSERT(!scavenger_->Contains(ptr));
- ASSERT(!heap_->CodeContains(ptr));
- ASSERT(heap_->Contains(ptr));
+ if (FLAG_verify_gc_contains) {
+ uword ptr = reinterpret_cast<uword>(p);
+ ASSERT(!scavenger_->Contains(ptr));
+ ASSERT(heap_->DataContains(ptr));
+ }
// If the newly written object is not a new object, drop it immediately.
if (!obj->IsNewObject() || visiting_old_object_->IsRemembered()) {
return;
« no previous file with comments | « runtime/vm/pages.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698