| Index: src/runtime/runtime-object.cc
|
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
|
| index b470c9670516ee02e5d38042c263bbf0c3efebb1..4ab2d4caa6ad99e0c0c34ee3773a517df480129e 100644
|
| --- a/src/runtime/runtime-object.cc
|
| +++ b/src/runtime/runtime-object.cc
|
| @@ -598,19 +598,27 @@ RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
|
| DisallowHeapAllocation no_allocation;
|
| Handle<JSObject> receiver = Handle<JSObject>::cast(receiver_obj);
|
| Handle<Name> key = Handle<Name>::cast(key_obj);
|
| - if (!receiver->HasFastProperties()) {
|
| + if (receiver->IsGlobalObject()) {
|
| // Attempt dictionary lookup.
|
| - NameDictionary* dictionary = receiver->property_dictionary();
|
| + GlobalDictionary* dictionary = receiver->global_dictionary();
|
| int entry = dictionary->FindEntry(key);
|
| - if ((entry != NameDictionary::kNotFound) &&
|
| + if ((entry != GlobalDictionary::kNotFound) &&
|
| (dictionary->DetailsAt(entry).type() == DATA)) {
|
| Object* value = dictionary->ValueAt(entry);
|
| - if (!receiver->IsGlobalObject()) return value;
|
| DCHECK(value->IsPropertyCell());
|
| value = PropertyCell::cast(value)->value();
|
| if (!value->IsTheHole()) return value;
|
| // If value is the hole (meaning, absent) do the general lookup.
|
| }
|
| + } else if (!receiver->HasFastProperties()) {
|
| + // Attempt dictionary lookup.
|
| + NameDictionary* dictionary = receiver->property_dictionary();
|
| + int entry = dictionary->FindEntry(key);
|
| + if ((entry != NameDictionary::kNotFound) &&
|
| + (dictionary->DetailsAt(entry).type() == DATA)) {
|
| + Object* value = dictionary->ValueAt(entry);
|
| + return value;
|
| + }
|
| }
|
| } else if (key_obj->IsSmi()) {
|
| // JSObject without a name key. If the key is a Smi, check for a
|
|
|