Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 9d8169787d30958651ef32714ba920eeeedf6ff3..9d640dc6a9bc25d70029842efbfe943e2279cce1 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -674,7 +674,7 @@ bool Object::IsJSFunctionResultCache() { |
| % JSFunctionResultCache::kEntrySize != 0) { |
| return false; |
| } |
| -#ifdef DEBUG |
| +#ifdef VERIFY_HEAP |
| if (FLAG_verify_heap) { |
| reinterpret_cast<JSFunctionResultCache*>(this)-> |
| JSFunctionResultCacheVerify(); |
| @@ -689,7 +689,7 @@ bool Object::IsNormalizedMapCache() { |
| if (FixedArray::cast(this)->length() != NormalizedMapCache::kEntries) { |
| return false; |
| } |
| -#ifdef DEBUG |
| +#ifdef VERIFY_HEAP |
| if (FLAG_verify_heap) { |
| reinterpret_cast<NormalizedMapCache*>(this)->NormalizedMapCacheVerify(); |
| } |
| @@ -1110,13 +1110,13 @@ HeapObject* MapWord::ToForwardingAddress() { |
| } |
| -#ifdef DEBUG |
| +#ifdef VERIFY_HEAP |
| void HeapObject::VerifyObjectField(int offset) { |
| VerifyPointer(READ_FIELD(this, offset)); |
| } |
| void HeapObject::VerifySmiField(int offset) { |
| - ASSERT(READ_FIELD(this, offset)->IsSmi()); |
| + CHECK(READ_FIELD(this, offset)->IsSmi()); |
| } |
| #endif |
| @@ -3628,14 +3628,14 @@ 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()); |
| + |
| + if (Heap::ShouldZapGarbage()) { |
|
Michael Starzinger
2012/10/12 10:53:16
Let's also use the following here, it's equivalent
mvstanton1
2012/10/12 11:16:27
Done.
|
| + Object* transitions = READ_FIELD(this, kTransitionsOrBackPointerOffset); |
| + if (transitions->IsTransitionArray()) { |
| + ZapTransitions(); |
| + } |
| } |
| -#endif |
| + |
| WRITE_FIELD(this, kTransitionsOrBackPointerOffset, back_pointer); |
| CONDITIONAL_WRITE_BARRIER( |
| heap, this, kTransitionsOrBackPointerOffset, back_pointer, mode); |
| @@ -3757,12 +3757,11 @@ TransitionArray* Map::transitions() { |
| void Map::set_transitions(TransitionArray* transition_array, |
| WriteBarrierMode mode) { |
| -#ifdef DEBUG |
| - if (HasTransitionArray()) { |
| - ASSERT(transitions() != transition_array); |
| + // In release mode, only run this code if verify_heap is on. |
| + if (Heap::ShouldZapGarbage() && HasTransitionArray()) { |
| + CHECK(transitions() != transition_array); |
| ZapTransitions(); |
| } |
| -#endif |
| WRITE_FIELD(this, kTransitionsOrBackPointerOffset, transition_array); |
| CONDITIONAL_WRITE_BARRIER( |