Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: src/objects.cc

Issue 1929853002: Propagate not-found on proxy target to GetRealNamedProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } 713 }
714 714
715 715
716 // static 716 // static
717 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) { 717 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
718 for (; it->IsFound(); it->Next()) { 718 for (; it->IsFound(); it->Next()) {
719 switch (it->state()) { 719 switch (it->state()) {
720 case LookupIterator::NOT_FOUND: 720 case LookupIterator::NOT_FOUND:
721 case LookupIterator::TRANSITION: 721 case LookupIterator::TRANSITION:
722 UNREACHABLE(); 722 UNREACHABLE();
723 case LookupIterator::JSPROXY: 723 case LookupIterator::JSPROXY: {
724 return JSProxy::GetProperty(it->isolate(), it->GetHolder<JSProxy>(), 724 bool was_found;
725 it->GetName(), it->GetReceiver()); 725 MaybeHandle<Object> result =
726 JSProxy::GetProperty(it->isolate(), it->GetHolder<JSProxy>(),
727 it->GetName(), it->GetReceiver(), &was_found);
728 if (!was_found) it->NotFound();
729 return result;
730 }
726 case LookupIterator::INTERCEPTOR: { 731 case LookupIterator::INTERCEPTOR: {
727 bool done; 732 bool done;
728 Handle<Object> result; 733 Handle<Object> result;
729 ASSIGN_RETURN_ON_EXCEPTION( 734 ASSIGN_RETURN_ON_EXCEPTION(
730 it->isolate(), result, 735 it->isolate(), result,
731 JSObject::GetPropertyWithInterceptor(it, &done), Object); 736 JSObject::GetPropertyWithInterceptor(it, &done), Object);
732 if (done) return result; 737 if (done) return result;
733 break; 738 break;
734 } 739 }
735 case LookupIterator::ACCESS_CHECK: 740 case LookupIterator::ACCESS_CHECK:
(...skipping 19 matching lines...) Expand all
755 MessageTemplate::kStackOverflow)); \ 760 MessageTemplate::kStackOverflow)); \
756 return result_value; \ 761 return result_value; \
757 } \ 762 } \
758 } while (false) 763 } while (false)
759 764
760 765
761 // static 766 // static
762 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate, 767 MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
763 Handle<JSProxy> proxy, 768 Handle<JSProxy> proxy,
764 Handle<Name> name, 769 Handle<Name> name,
765 Handle<Object> receiver) { 770 Handle<Object> receiver,
771 bool* was_found) {
772 *was_found = true;
766 if (receiver->IsJSGlobalObject()) { 773 if (receiver->IsJSGlobalObject()) {
767 THROW_NEW_ERROR( 774 THROW_NEW_ERROR(
768 isolate, 775 isolate,
769 NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name), 776 NewTypeError(MessageTemplate::kReadGlobalReferenceThroughProxy, name),
770 Object); 777 Object);
771 } 778 }
772 779
773 DCHECK(!name->IsPrivate()); 780 DCHECK(!name->IsPrivate());
774 STACK_CHECK(MaybeHandle<Object>()); 781 STACK_CHECK(MaybeHandle<Object>());
775 Handle<Name> trap_name = isolate->factory()->get_string(); 782 Handle<Name> trap_name = isolate->factory()->get_string();
(...skipping 12 matching lines...) Expand all
788 // 6. Let trap be ? GetMethod(handler, "get"). 795 // 6. Let trap be ? GetMethod(handler, "get").
789 Handle<Object> trap; 796 Handle<Object> trap;
790 ASSIGN_RETURN_ON_EXCEPTION( 797 ASSIGN_RETURN_ON_EXCEPTION(
791 isolate, trap, 798 isolate, trap,
792 Object::GetMethod(Handle<JSReceiver>::cast(handler), trap_name), Object); 799 Object::GetMethod(Handle<JSReceiver>::cast(handler), trap_name), Object);
793 // 7. If trap is undefined, then 800 // 7. If trap is undefined, then
794 if (trap->IsUndefined()) { 801 if (trap->IsUndefined()) {
795 // 7.a Return target.[[Get]](P, Receiver). 802 // 7.a Return target.[[Get]](P, Receiver).
796 LookupIterator it = 803 LookupIterator it =
797 LookupIterator::PropertyOrElement(isolate, receiver, name, target); 804 LookupIterator::PropertyOrElement(isolate, receiver, name, target);
798 return Object::GetProperty(&it); 805 MaybeHandle<Object> result = Object::GetProperty(&it);
806 *was_found = it.IsFound();
807 return result;
799 } 808 }
800 // 8. Let trapResult be ? Call(trap, handler, «target, P, Receiver»). 809 // 8. Let trapResult be ? Call(trap, handler, «target, P, Receiver»).
801 Handle<Object> trap_result; 810 Handle<Object> trap_result;
802 Handle<Object> args[] = {target, name, receiver}; 811 Handle<Object> args[] = {target, name, receiver};
803 ASSIGN_RETURN_ON_EXCEPTION( 812 ASSIGN_RETURN_ON_EXCEPTION(
804 isolate, trap_result, 813 isolate, trap_result,
805 Execution::Call(isolate, trap, handler, arraysize(args), args), Object); 814 Execution::Call(isolate, trap, handler, arraysize(args), args), Object);
806 // 9. Let targetDesc be ? target.[[GetOwnProperty]](P). 815 // 9. Let targetDesc be ? target.[[GetOwnProperty]](P).
807 PropertyDescriptor target_desc; 816 PropertyDescriptor target_desc;
808 Maybe<bool> target_found = 817 Maybe<bool> target_found =
(...skipping 18264 matching lines...) Expand 10 before | Expand all | Expand 10 after
19073 if (cell->value() != *new_value) { 19082 if (cell->value() != *new_value) {
19074 cell->set_value(*new_value); 19083 cell->set_value(*new_value);
19075 Isolate* isolate = cell->GetIsolate(); 19084 Isolate* isolate = cell->GetIsolate();
19076 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19085 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19077 isolate, DependentCode::kPropertyCellChangedGroup); 19086 isolate, DependentCode::kPropertyCellChangedGroup);
19078 } 19087 }
19079 } 19088 }
19080 19089
19081 } // namespace internal 19090 } // namespace internal
19082 } // namespace v8 19091 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698