Commit 9673d794 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix tests that fail on GC stress tests.

R=mstarzinger@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/12681006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14000 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 91d8d9db
......@@ -16054,15 +16054,17 @@ THREADED_TEST(TwoByteStringInAsciiCons) {
CHECK(flat_string->IsTwoByteRepresentation());
// At this point, we should have a Cons string which is flat and ASCII,
// with a first half that is a two-byte string (although it only contains
// ASCII characters). This is a valid sequence of steps, and it can happen
// in real pages.
CHECK(string->IsOneByteRepresentation());
i::ConsString* cons = i::ConsString::cast(*string);
CHECK_EQ(0, cons->second()->length());
CHECK(cons->first()->IsTwoByteRepresentation());
// If the cons string has been short-circuited, skip the following checks.
if (!string.is_identical_to(flat_string)) {
// At this point, we should have a Cons string which is flat and ASCII,
// with a first half that is a two-byte string (although it only contains
// ASCII characters). This is a valid sequence of steps, and it can happen
// in real pages.
CHECK(string->IsOneByteRepresentation());
i::ConsString* cons = i::ConsString::cast(*string);
CHECK_EQ(0, cons->second()->length());
CHECK(cons->first()->IsTwoByteRepresentation());
}
// Check that some string operations work.
......
......@@ -1082,7 +1082,9 @@ TEST(SliceFromCons) {
CHECK(parent->IsFlat());
CHECK(slice->IsSlicedString());
CHECK_EQ(SlicedString::cast(*slice)->parent(),
ConsString::cast(*parent)->first());
// Parent could have been short-circuited.
parent->IsConsString() ? ConsString::cast(*parent)->first()
: *parent);
CHECK(SlicedString::cast(*slice)->parent()->IsSeqString());
CHECK(slice->IsFlat());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment