| Index: src/heap-inl.h
|
| ===================================================================
|
| --- src/heap-inl.h (revision 4205)
|
| +++ src/heap-inl.h (working copy)
|
| @@ -133,7 +133,8 @@
|
| #ifdef DEBUG
|
| if (!result->IsFailure()) {
|
| // Maps have their own alignment.
|
| - CHECK((OffsetFrom(result) & kMapAlignmentMask) == kHeapObjectTag);
|
| + CHECK((reinterpret_cast<intptr_t>(result) & kMapAlignmentMask) ==
|
| + static_cast<intptr_t>(kHeapObjectTag));
|
| }
|
| #endif
|
| return result;
|
| @@ -273,6 +274,25 @@
|
| }
|
|
|
|
|
| +Object* Heap::PrepareForCompare(String* str) {
|
| + // Always flatten small strings and force flattening of long strings
|
| + // after we have accumulated a certain amount we failed to flatten.
|
| + static const int kMaxAlwaysFlattenLength = 32;
|
| + static const int kFlattenLongThreshold = 16*KB;
|
| +
|
| + const int length = str->length();
|
| + Object* obj = str->TryFlatten();
|
| + if (length <= kMaxAlwaysFlattenLength ||
|
| + unflattended_strings_length_ >= kFlattenLongThreshold) {
|
| + return obj;
|
| + }
|
| + if (obj->IsFailure()) {
|
| + unflattended_strings_length_ += length;
|
| + }
|
| + return str;
|
| +}
|
| +
|
| +
|
| int Heap::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) {
|
| ASSERT(HasBeenSetup());
|
| int amount = amount_of_external_allocated_memory_ + change_in_bytes;
|
|
|