OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 649 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
650 return ReadAbsentProperty(it, language_mode); | 650 return ReadAbsentProperty(it, language_mode); |
651 case LookupIterator::DATA: | 651 case LookupIterator::DATA: |
652 return it->GetDataValue(); | 652 return it->GetDataValue(); |
653 } | 653 } |
654 } | 654 } |
655 return ReadAbsentProperty(it, language_mode); | 655 return ReadAbsentProperty(it, language_mode); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 MaybeHandle<Object> Object::GetPropertyEx(LookupIterator* it, | |
660 bool& access_check_failed, | |
661 LanguageMode language_mode) { | |
662 access_check_failed = false; | |
caitp (gmail)
2015/10/01 15:16:47
This alternative implementation doesn't change the
| |
663 for (; it->IsFound(); it->Next()) { | |
664 switch (it->state()) { | |
665 case LookupIterator::NOT_FOUND: | |
666 case LookupIterator::TRANSITION: | |
667 UNREACHABLE(); | |
668 case LookupIterator::JSPROXY: | |
669 return JSProxy::GetPropertyWithHandler( | |
670 it->GetHolder<JSProxy>(), it->GetReceiver(), it->GetName()); | |
671 case LookupIterator::INTERCEPTOR: { | |
672 bool done; | |
673 Handle<Object> result; | |
674 ASSIGN_RETURN_ON_EXCEPTION( | |
675 it->isolate(), result, | |
676 JSObject::GetPropertyWithInterceptor(it, &done), Object); | |
677 if (done) return result; | |
678 break; | |
679 } | |
680 case LookupIterator::ACCESS_CHECK: | |
681 if (it->HasAccess()) break; | |
682 access_check_failed = true; | |
683 return it->isolate()->factory()->undefined_value(); | |
684 case LookupIterator::ACCESSOR: | |
685 return GetPropertyWithAccessor(it, language_mode); | |
686 case LookupIterator::INTEGER_INDEXED_EXOTIC: | |
687 return ReadAbsentProperty(it, language_mode); | |
688 case LookupIterator::DATA: | |
689 return it->GetDataValue(); | |
690 } | |
691 } | |
692 return ReadAbsentProperty(it, language_mode); | |
693 } | |
694 | |
695 | |
659 Handle<Object> JSReceiver::GetDataProperty(Handle<JSReceiver> object, | 696 Handle<Object> JSReceiver::GetDataProperty(Handle<JSReceiver> object, |
660 Handle<Name> name) { | 697 Handle<Name> name) { |
661 LookupIterator it(object, name, | 698 LookupIterator it(object, name, |
662 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 699 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
663 return GetDataProperty(&it); | 700 return GetDataProperty(&it); |
664 } | 701 } |
665 | 702 |
666 | 703 |
667 Handle<Object> JSReceiver::GetDataProperty(LookupIterator* it) { | 704 Handle<Object> JSReceiver::GetDataProperty(LookupIterator* it) { |
668 for (; it->IsFound(); it->Next()) { | 705 for (; it->IsFound(); it->Next()) { |
(...skipping 16145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16814 if (cell->value() != *new_value) { | 16851 if (cell->value() != *new_value) { |
16815 cell->set_value(*new_value); | 16852 cell->set_value(*new_value); |
16816 Isolate* isolate = cell->GetIsolate(); | 16853 Isolate* isolate = cell->GetIsolate(); |
16817 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16854 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16818 isolate, DependentCode::kPropertyCellChangedGroup); | 16855 isolate, DependentCode::kPropertyCellChangedGroup); |
16819 } | 16856 } |
16820 } | 16857 } |
16821 | 16858 |
16822 } // namespace internal | 16859 } // namespace internal |
16823 } // namespace v8 | 16860 } // namespace v8 |
OLD | NEW |