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

Unified Diff: src/objects.cc

Issue 10822011: Limited the size of transition arrays so they never end up in the large object space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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.h ('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.cc
diff --git a/src/objects.cc b/src/objects.cc
index 67ff486905d498889a93e64c14717fc0569604b5..e229017daad07afa0d31a203c6d68bcec2c616b4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2121,8 +2121,6 @@ template<RightTrimMode trim_mode>
static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) {
ASSERT(elms->map() != HEAP->fixed_cow_array_map());
// For now this trick is only applied to fixed arrays in new and paged space.
- // In large object space the object's start must coincide with chunk
- // and thus the trick is just not applicable.
ASSERT(!HEAP->lo_space()->Contains(elms));
const int len = elms->length();
@@ -2218,7 +2216,7 @@ void Map::CopyAppendCallbackDescriptors(Handle<Map> map,
}
// If duplicates were detected, trim the descriptor array to the right size.
- int new_array_size = DescriptorArray::SizeFor(new_number_of_descriptors);
+ int new_array_size = DescriptorArray::LengthFor(new_number_of_descriptors);
if (new_array_size < result->length()) {
RightTrimFixedArray<FROM_MUTATOR>(
isolate->heap(), *result, result->length() - new_array_size);
@@ -4884,7 +4882,7 @@ MaybeObject* Map::CopyReplaceDescriptors(DescriptorArray* descriptors,
result->SetLastAdded(last_added);
}
- if (flag == INSERT_TRANSITION) {
+ if (flag == INSERT_TRANSITION && CanHaveMoreTransitions()) {
TransitionArray* transitions;
MaybeObject* maybe_transitions = AddTransition(name, result);
if (!maybe_transitions->To(&transitions)) return maybe_transitions;
@@ -5844,7 +5842,7 @@ MaybeObject* DescriptorArray::Allocate(int number_of_descriptors,
}
// Allocate the array of keys.
MaybeObject* maybe_array =
- heap->AllocateFixedArray(SizeFor(number_of_descriptors));
+ heap->AllocateFixedArray(LengthFor(number_of_descriptors));
if (!maybe_array->To(&result)) return maybe_array;
result->set(kEnumCacheIndex, Smi::FromInt(0));
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698