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

Unified Diff: src/objects-inl.h

Issue 11085070: Enable --verify-heap in release mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: After rebase plus one new issue fix Created 8 years, 2 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index e47cec7db5cab20a29071c8f7cbc616d39ff4b04..4dc2e106073721d09a2c9315dcbef092c79c2d03 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3642,14 +3642,21 @@ SMI_ACCESSORS(Map, bit_field3, kBitField3Offset)
void Map::ClearTransitions(Heap* heap, WriteBarrierMode mode) {
Object* back_pointer = GetBackPointer();
-#ifdef DEBUG
- Object* object = READ_FIELD(this, kTransitionsOrBackPointerOffset);
- if (object->IsTransitionArray()) {
- ZapTransitions();
- } else {
- ASSERT(object->IsMap() || object->IsUndefined());
+
+ // In release builds we only need to run this code if verify_heap is on.
+#ifndef DEBUG
Michael Starzinger 2012/10/11 12:42:46 I think it would be useful to have a static inline
mvstanton1 2012/10/12 08:40:50 Done.
+ if (FLAG_verify_heap) {
+#endif
+ Object* object = READ_FIELD(this, kTransitionsOrBackPointerOffset);
+ if (object->IsTransitionArray()) {
+ ZapTransitions();
+ } else {
+ CHECK(object->IsMap() || object->IsUndefined());
+ }
+#ifndef DEBUG
}
#endif
+
WRITE_FIELD(this, kTransitionsOrBackPointerOffset, back_pointer);
CONDITIONAL_WRITE_BARRIER(
heap, this, kTransitionsOrBackPointerOffset, back_pointer, mode);
@@ -3778,10 +3785,15 @@ TransitionArray* Map::transitions() {
void Map::set_transitions(TransitionArray* transition_array,
WriteBarrierMode mode) {
-#ifdef DEBUG
- if (HasTransitionArray()) {
- ASSERT(transitions() != transition_array);
- ZapTransitions();
+ // In release mode, only run this code if verify_heap is on.
+#ifndef DEBUG
Michael Starzinger 2012/10/11 12:42:46 Likewise.
mvstanton1 2012/10/12 08:40:50 Done.
+ if (FLAG_verify_heap) {
+#endif
+ if (HasTransitionArray()) {
+ CHECK(transitions() != transition_array);
+ ZapTransitions();
+ }
+#ifndef DEBUG
}
#endif

Powered by Google App Engine
This is Rietveld 408576698