| Index: src/objects-debug.cc
|
| diff --git a/src/objects-debug.cc b/src/objects-debug.cc
|
| index a14b5e7937d28663bf8c612e0a2b65714f4b8b73..1670a8b6707bd5af63769ba8509c7e40b296352a 100644
|
| --- a/src/objects-debug.cc
|
| +++ b/src/objects-debug.cc
|
| @@ -265,9 +265,9 @@ void JSObject::JSObjectVerify() {
|
| (map()->inobject_properties() + properties()->length() -
|
| map()->NextFreePropertyIndex()));
|
| }
|
| - ASSERT(map()->has_fast_elements() ==
|
| - (elements()->map() == GetHeap()->fixed_array_map() ||
|
| - elements()->map() == GetHeap()->fixed_cow_array_map()));
|
| + ASSERT_EQ(map()->has_fast_elements(),
|
| + (elements()->map() == GetHeap()->fixed_array_map() ||
|
| + elements()->map() == GetHeap()->fixed_cow_array_map()));
|
| ASSERT(map()->has_fast_elements() == HasFastElements());
|
| }
|
|
|
| @@ -360,6 +360,31 @@ void String::StringVerify() {
|
| if (IsSymbol()) {
|
| CHECK(!HEAP->InNewSpace(this));
|
| }
|
| + if (IsConsString()) {
|
| + ConsString::cast(this)->ConsStringVerify();
|
| + } else if (IsSlicedString()) {
|
| + SlicedString::cast(this)->SlicedStringVerify();
|
| + }
|
| +}
|
| +
|
| +
|
| +void ConsString::ConsStringVerify() {
|
| + CHECK(this->first()->IsString());
|
| + CHECK(this->second() == GetHeap()->empty_string() ||
|
| + this->second()->IsString());
|
| + CHECK(this->length() >= String::kMinNonFlatLength);
|
| + if (this->IsFlat()) {
|
| + // A flat cons can only be created by String::SlowTryFlatten.
|
| + // Afterwards, the first part may be externalized.
|
| + CHECK(this->first()->IsSeqString() || this->first()->IsExternalString());
|
| + }
|
| +}
|
| +
|
| +
|
| +void SlicedString::SlicedStringVerify() {
|
| + CHECK(!this->parent()->IsConsString());
|
| + CHECK(!this->parent()->IsSlicedString());
|
| + CHECK(this->length() >= SlicedString::kMinLength);
|
| }
|
|
|
|
|
|
|