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

Unified Diff: src/heap-inl.h

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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
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;

Powered by Google App Engine
This is Rietveld 408576698