OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/property-descriptor.h" | 9 #include "src/property-descriptor.h" |
10 | 10 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 case LookupIterator::NOT_FOUND: | 638 case LookupIterator::NOT_FOUND: |
639 case LookupIterator::TRANSITION: | 639 case LookupIterator::TRANSITION: |
640 UNREACHABLE(); | 640 UNREACHABLE(); |
641 | 641 |
642 case LookupIterator::ACCESS_CHECK: | 642 case LookupIterator::ACCESS_CHECK: |
643 if (it.HasAccess()) continue; | 643 if (it.HasAccess()) continue; |
644 isolate->ReportFailedAccessCheck(it.GetHolder<JSObject>()); | 644 isolate->ReportFailedAccessCheck(it.GetHolder<JSObject>()); |
645 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); | 645 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); |
646 return isolate->heap()->undefined_value(); | 646 return isolate->heap()->undefined_value(); |
647 | 647 |
648 case LookupIterator::JSPROXY: | 648 case LookupIterator::JSPROXY: { |
| 649 PropertyDescriptor desc; |
| 650 Maybe<bool> found = JSProxy::GetOwnPropertyDescriptor( |
| 651 isolate, it.GetHolder<JSProxy>(), it.GetName(), &desc); |
| 652 MAYBE_RETURN(found, isolate->heap()->exception()); |
| 653 if (found.FromJust()) { |
| 654 if (component == ACCESSOR_GETTER && desc.has_get()) { |
| 655 return *desc.get(); |
| 656 } |
| 657 if (component == ACCESSOR_SETTER && desc.has_set()) { |
| 658 return *desc.set(); |
| 659 } |
| 660 return isolate->heap()->undefined_value(); |
| 661 } |
| 662 Handle<Object> prototype; |
| 663 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 664 isolate, prototype, JSProxy::GetPrototype(it.GetHolder<JSProxy>())); |
| 665 if (prototype->IsNull(isolate)) { |
| 666 return isolate->heap()->undefined_value(); |
| 667 } |
| 668 return ObjectLookupAccessor(isolate, prototype, key, component); |
| 669 } |
| 670 |
| 671 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 672 case LookupIterator::DATA: |
649 return isolate->heap()->undefined_value(); | 673 return isolate->heap()->undefined_value(); |
650 | 674 |
651 case LookupIterator::INTEGER_INDEXED_EXOTIC: | |
652 return isolate->heap()->undefined_value(); | |
653 case LookupIterator::DATA: | |
654 continue; | |
655 case LookupIterator::ACCESSOR: { | 675 case LookupIterator::ACCESSOR: { |
656 Handle<Object> maybe_pair = it.GetAccessors(); | 676 Handle<Object> maybe_pair = it.GetAccessors(); |
657 if (maybe_pair->IsAccessorPair()) { | 677 if (maybe_pair->IsAccessorPair()) { |
658 return *AccessorPair::GetComponent( | 678 return *AccessorPair::GetComponent( |
659 Handle<AccessorPair>::cast(maybe_pair), component); | 679 Handle<AccessorPair>::cast(maybe_pair), component); |
660 } | 680 } |
661 } | 681 } |
662 } | 682 } |
663 } | 683 } |
664 | 684 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 CodeStubAssembler assembler(state); | 1105 CodeStubAssembler assembler(state); |
1086 | 1106 |
1087 Node* object = assembler.Parameter(Descriptor::kObject); | 1107 Node* object = assembler.Parameter(Descriptor::kObject); |
1088 Node* context = assembler.Parameter(Descriptor::kContext); | 1108 Node* context = assembler.Parameter(Descriptor::kContext); |
1089 | 1109 |
1090 assembler.Return(assembler.GetSuperConstructor(object, context)); | 1110 assembler.Return(assembler.GetSuperConstructor(object, context)); |
1091 } | 1111 } |
1092 | 1112 |
1093 } // namespace internal | 1113 } // namespace internal |
1094 } // namespace v8 | 1114 } // namespace v8 |
OLD | NEW |