Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 2285) |
+++ src/runtime.cc (working copy) |
@@ -618,9 +618,6 @@ |
// property as read-only, so we don't either. |
PropertyAttributes base = is_eval ? NONE : DONT_DELETE; |
- // Only optimize the object if we intend to add more than 5 properties. |
- OptimizedObjectForAddingMultipleProperties ba(global, pairs->length()/2 > 5); |
- |
// Traverse the name/value pairs and set the properties. |
int length = pairs->length(); |
for (int i = 0; i < length; i += 2) { |
@@ -932,10 +929,8 @@ |
properties->set(index, *value); |
} |
} else if (type == NORMAL) { |
- Dictionary* dictionary = global->property_dictionary(); |
- int entry = lookup.GetDictionaryEntry(); |
- if (dictionary->ValueAt(entry)->IsTheHole()) { |
- dictionary->ValueAtPut(entry, *value); |
+ if (global->GetNormalizedProperty(&lookup)->IsTheHole()) { |
+ global->SetNormalizedProperty(&lookup, *value); |
} |
} else { |
// Ignore re-initialization of constants that have already been |
@@ -1025,10 +1020,8 @@ |
properties->set(index, *value); |
} |
} else if (type == NORMAL) { |
- Dictionary* dictionary = context_ext->property_dictionary(); |
- int entry = lookup.GetDictionaryEntry(); |
- if (dictionary->ValueAt(entry)->IsTheHole()) { |
- dictionary->ValueAtPut(entry, *value); |
+ if (context_ext->GetNormalizedProperty(&lookup)->IsTheHole()) { |
+ context_ext->SetNormalizedProperty(&lookup, *value); |
} |
} else { |
// We should not reach here. Any real, named property should be |
@@ -2640,9 +2633,13 @@ |
// Attempt dictionary lookup. |
Dictionary* dictionary = receiver->property_dictionary(); |
int entry = dictionary->FindStringEntry(key); |
- if ((entry != DescriptorArray::kNotFound) && |
+ if ((entry != Dictionary::kNotFound) && |
(dictionary->DetailsAt(entry).type() == NORMAL)) { |
- return dictionary->ValueAt(entry); |
+ Object* value = dictionary->ValueAt(entry); |
+ if (receiver->IsJSGlobalObject()) { |
+ value = JSGlobalPropertyCell::cast(value)->value(); |
+ } |
+ return value; |
} |
} |
} |
@@ -5560,15 +5557,12 @@ |
bool* caught_exception) { |
Object* value; |
switch (result->type()) { |
- case NORMAL: { |
- Dictionary* dict = |
- JSObject::cast(result->holder())->property_dictionary(); |
- value = dict->ValueAt(result->GetDictionaryEntry()); |
+ case NORMAL: |
+ value = result->holder()->GetNormalizedProperty(result); |
if (value->IsTheHole()) { |
return Heap::undefined_value(); |
} |
return value; |
- } |
case FIELD: |
value = |
JSObject::cast( |