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

Unified Diff: src/factory.cc

Issue 10444055: Promoting elements transitions to their own field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: full patch Created 8 years, 7 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/heap.cc » ('j') | src/mark-compact.cc » ('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 1c29ea13b2b2dd8a17c5c179635f7ab8362f8c55..fa0c9b1a2bf3d7bc113b0f84120085020d669db6 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -114,7 +114,7 @@ Handle<ObjectHashTable> Factory::NewObjectHashTable(int at_least_space_for) {
Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) {
ASSERT(0 <= number_of_descriptors);
CALL_HEAP_FUNCTION(isolate(),
- DescriptorArray::Allocate(number_of_descriptors),
+ DescriptorArray::Allocate(number_of_descriptors, false),
DescriptorArray);
}
@@ -495,7 +495,7 @@ Handle<Map> Factory::CopyMap(Handle<Map> src,
Handle<Map> Factory::CopyMapDropTransitions(Handle<Map> src) {
- CALL_HEAP_FUNCTION(isolate(), src->CopyDropTransitions(), Map);
+ CALL_HEAP_FUNCTION(isolate(), src->CopyDropTransitions(false), Map);
}
@@ -866,6 +866,21 @@ Handle<String> Factory::SymbolFromString(Handle<String> value) {
}
+static int LinearSearchUnsorted(DescriptorArray* descriptor_array,
+ String* name, int len) {
+ uint32_t hash = name->Hash();
+ for (int number = 0; number < len; number++) {
+ String* entry = descriptor_array->GetKey(number);
+ if (entry->Hash() == hash &&
+ name->Equals(entry) &&
+ !descriptor_array->IsNullDescriptor(number)) {
+ return number;
+ }
+ }
+ return DescriptorArray::kNotFound;
+}
+
+
Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
Handle<DescriptorArray> array,
Handle<Object> descriptors) {
@@ -900,7 +915,7 @@ Handle<DescriptorArray> Factory::CopyAppendCallbackDescriptors(
Handle<String> key =
SymbolFromString(Handle<String>(String::cast(entry->name())));
// Check if a descriptor with this name already exists before writing.
- if (result->LinearSearch(*key, descriptor_count) ==
+ if (LinearSearchUnsorted(*result, *key, descriptor_count) ==
danno 2012/06/01 13:49:55 Add a enum { EXPECT_SORTED, EXPECT_UNSORTED } and
Toon Verwaest 2012/06/04 09:17:48 Done.
DescriptorArray::kNotFound) {
CallbacksDescriptor desc(*key, *entry, entry->property_attributes());
result->Set(descriptor_count, &desc, witness);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/heap.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698