Chromium Code Reviews| 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 |