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

Unified Diff: src/objects-debug.cc

Issue 7860035: Merge bleeding edge up to 9192 into the GC branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 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 | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698