| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 1dc170410951f7e01238815dae3b62340e6f6721..d5e28abf8d4b8bff57aad760dc6e3c192d7fedbb 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -6880,6 +6880,7 @@ bool String::LooksValid() {
|
|
|
|
|
| String::FlatContent String::GetFlatContent() {
|
| + ASSERT(!GetHeap()->allow_allocation(false));
|
| int length = this->length();
|
| StringShape shape(this);
|
| String* string = this;
|
| @@ -7106,6 +7107,8 @@ void FlatStringReader::PostGarbageCollection() {
|
| if (str_ == NULL) return;
|
| Handle<String> str(str_);
|
| ASSERT(str->IsFlat());
|
| + AssertNoAllocation no_gc;
|
| + // This does not actually prevent the vector from being relocated later.
|
| String::FlatContent content = str->GetFlatContent();
|
| ASSERT(content.IsFlat());
|
| is_ascii_ = content.IsAscii();
|
| @@ -7656,6 +7659,7 @@ bool String::IsUtf8EqualTo(Vector<const char> str) {
|
| bool String::IsOneByteEqualTo(Vector<const uint8_t> str) {
|
| int slen = length();
|
| if (str.length() != slen) return false;
|
| + AssertNoAllocation no_gc;
|
| FlatContent content = GetFlatContent();
|
| if (content.IsAscii()) {
|
| return CompareChars(content.ToOneByteVector().start(),
|
| @@ -7671,6 +7675,7 @@ bool String::IsOneByteEqualTo(Vector<const uint8_t> str) {
|
| bool String::IsTwoByteEqualTo(Vector<const uc16> str) {
|
| int slen = length();
|
| if (str.length() != slen) return false;
|
| + AssertNoAllocation no_gc;
|
| FlatContent content = GetFlatContent();
|
| if (content.IsTwoByte()) {
|
| return CompareChars(content.ToUC16Vector().start(), str.start(), slen) == 0;
|
|
|