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

Unified Diff: src/heap.cc

Issue 113095: Before a scavenge collection in debug builds with ENABLE_SLOW_ASSERTS,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 1890)
+++ src/heap.cc (working copy)
@@ -554,26 +554,36 @@
}
}
};
-#endif
-void Heap::Scavenge() {
-#ifdef DEBUG
- if (FLAG_enable_slow_asserts) {
- VerifyNonPointerSpacePointersVisitor v;
- HeapObjectIterator it(code_space_);
- while (it.has_next()) {
- HeapObject* object = it.next();
- if (object->IsCode()) {
- Code::cast(object)->ConvertICTargetsFromAddressToObject();
- }
+
+static void VerifyNonPointerSpacePointers() {
Erik Corry 2009/05/07 09:53:01 If you move the flag test into this you and put an
Kevin Millikin (Chromium) 2009/05/07 10:24:02 Not a clear win. I actually prefer seeing at the
+ // Verify that there are no pointers to new space in spaces where we
+ // do not expect them.
+ VerifyNonPointerSpacePointersVisitor v;
+ HeapObjectIterator code_it(Heap::code_space());
+ while (code_it.has_next()) {
+ HeapObject* object = code_it.next();
+ if (object->IsCode()) {
+ Code::cast(object)->ConvertICTargetsFromAddressToObject();
object->Iterate(&v);
- if (object->IsCode()) {
- Code::cast(object)->ConvertICTargetsFromObjectToAddress();
- }
+ Code::cast(object)->ConvertICTargetsFromObjectToAddress();
+ } else {
+ // If we find non-code objects in code space (e.g., free list
+ // nodes) we want to verify them as well.
+ object->Iterate(&v);
}
}
+
+ HeapObjectIterator data_it(Heap::old_data_space());
+ while (data_it.has_next()) data_it.next()->Iterate(&v);
+}
#endif
+void Heap::Scavenge() {
+#ifdef DEBUG
+ if (FLAG_enable_slow_asserts) VerifyNonPointerSpacePointers();
+#endif
+
gc_state_ = SCAVENGE;
// Implements Cheney's copying algorithm
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698