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

Unified Diff: src/factory.cc

Issue 10692185: Couple the enumeration index of a property to the size of the descriptor array where it first appea… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adding assert in 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/bootstrapper.cc ('k') | src/objects.h » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 7b915371616863782650b973e22d331f4c0806e6..c0bbb78e2abe979a2c6833b76e465f8ff5b7aef5 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -938,7 +938,6 @@ Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
// back to front so that the last callback with a given name takes
// precedence over previously added callbacks with that name.
int added_descriptor_count = descriptor_count;
- int next_enum = array->NextEnumerationIndex();
for (int i = nof_callbacks - 1; i >= 0; i--) {
Handle<AccessorInfo> entry =
Handle<AccessorInfo>(AccessorInfo::cast(callbacks.get(i)));
@@ -948,11 +947,8 @@ Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
// Check if a descriptor with this name already exists before writing.
if (LinearSearch(*result, EXPECT_UNSORTED, *key, added_descriptor_count) ==
DescriptorArray::kNotFound) {
- CallbacksDescriptor desc(*key,
- *entry,
- entry->property_attributes(),
- next_enum++);
- result->Set(added_descriptor_count, &desc, witness);
+ CallbacksDescriptor desc(*key, *entry, entry->property_attributes(), 0);
+ result->Append(added_descriptor_count, &desc, witness);
added_descriptor_count++;
}
}
@@ -973,7 +969,6 @@ Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
// Sort the result before returning.
result->Sort(witness);
- ASSERT(result->NextEnumerationIndex() == next_enum);
return result;
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698