OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug.h" | 9 #include "src/debug.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 if (receiver_obj->IsJSObject()) { | 589 if (receiver_obj->IsJSObject()) { |
590 if (!receiver_obj->IsJSGlobalProxy() && | 590 if (!receiver_obj->IsJSGlobalProxy() && |
591 !receiver_obj->IsAccessCheckNeeded() && key_obj->IsName()) { | 591 !receiver_obj->IsAccessCheckNeeded() && key_obj->IsName()) { |
592 DisallowHeapAllocation no_allocation; | 592 DisallowHeapAllocation no_allocation; |
593 Handle<JSObject> receiver = Handle<JSObject>::cast(receiver_obj); | 593 Handle<JSObject> receiver = Handle<JSObject>::cast(receiver_obj); |
594 Handle<Name> key = Handle<Name>::cast(key_obj); | 594 Handle<Name> key = Handle<Name>::cast(key_obj); |
595 if (receiver->IsGlobalObject()) { | 595 if (receiver->IsGlobalObject()) { |
596 // Attempt dictionary lookup. | 596 // Attempt dictionary lookup. |
597 GlobalDictionary* dictionary = receiver->global_dictionary(); | 597 GlobalDictionary* dictionary = receiver->global_dictionary(); |
598 int entry = dictionary->FindEntry(key); | 598 int entry = dictionary->FindEntry(key); |
599 if ((entry != GlobalDictionary::kNotFound) && | 599 if (entry != GlobalDictionary::kNotFound) { |
600 (dictionary->DetailsAt(entry).type() == DATA)) { | 600 DCHECK(dictionary->ValueAt(entry)->IsPropertyCell()); |
601 Object* value = dictionary->ValueAt(entry); | 601 PropertyCell* cell = PropertyCell::cast(dictionary->ValueAt(entry)); |
602 DCHECK(value->IsPropertyCell()); | 602 if (cell->property_details().type() == DATA) { |
603 value = PropertyCell::cast(value)->value(); | 603 Object* value = cell->value(); |
604 if (!value->IsTheHole()) return value; | 604 if (!value->IsTheHole()) return value; |
605 // If value is the hole (meaning, absent) do the general lookup. | 605 // If value is the hole (meaning, absent) do the general lookup. |
| 606 } |
606 } | 607 } |
607 } else if (!receiver->HasFastProperties()) { | 608 } else if (!receiver->HasFastProperties()) { |
608 // Attempt dictionary lookup. | 609 // Attempt dictionary lookup. |
609 NameDictionary* dictionary = receiver->property_dictionary(); | 610 NameDictionary* dictionary = receiver->property_dictionary(); |
610 int entry = dictionary->FindEntry(key); | 611 int entry = dictionary->FindEntry(key); |
611 if ((entry != NameDictionary::kNotFound) && | 612 if ((entry != NameDictionary::kNotFound) && |
612 (dictionary->DetailsAt(entry).type() == DATA)) { | 613 (dictionary->DetailsAt(entry).type() == DATA)) { |
613 Object* value = dictionary->ValueAt(entry); | 614 Object* value = dictionary->ValueAt(entry); |
614 return value; | 615 return value; |
615 } | 616 } |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1581 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
1581 | 1582 |
1582 RETURN_FAILURE_ON_EXCEPTION( | 1583 RETURN_FAILURE_ON_EXCEPTION( |
1583 isolate, | 1584 isolate, |
1584 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1585 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
1585 setter, attrs)); | 1586 setter, attrs)); |
1586 return isolate->heap()->undefined_value(); | 1587 return isolate->heap()->undefined_value(); |
1587 } | 1588 } |
1588 } // namespace internal | 1589 } // namespace internal |
1589 } // namespace v8 | 1590 } // namespace v8 |
OLD | NEW |