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

Side by Side Diff: src/objects.cc

Issue 1748923003: [proxies] use [[GetPrototypeOf]] trap in for-in (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | src/prototype.h » ('j') | test/mjsunit/harmony/proxies-for.js » ('J')
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 8641 matching lines...) Expand 10 before | Expand all | Expand 10 after
8652 Handle<JSReceiver> receiver, 8652 Handle<JSReceiver> receiver,
8653 Handle<JSReceiver> object, 8653 Handle<JSReceiver> object,
8654 KeyCollectionType type, 8654 KeyCollectionType type,
8655 PropertyFilter filter, 8655 PropertyFilter filter,
8656 KeyAccumulator* accumulator) { 8656 KeyAccumulator* accumulator) {
8657 PrototypeIterator::WhereToEnd end = type == OWN_ONLY 8657 PrototypeIterator::WhereToEnd end = type == OWN_ONLY
8658 ? PrototypeIterator::END_AT_NON_HIDDEN 8658 ? PrototypeIterator::END_AT_NON_HIDDEN
8659 : PrototypeIterator::END_AT_NULL; 8659 : PrototypeIterator::END_AT_NULL;
8660 for (PrototypeIterator iter(isolate, object, 8660 for (PrototypeIterator iter(isolate, object,
8661 PrototypeIterator::START_AT_RECEIVER, end); 8661 PrototypeIterator::START_AT_RECEIVER, end);
8662 !iter.IsAtEnd(); iter.Advance()) { 8662 !iter.IsAtEnd();) {
8663 Handle<JSReceiver> current = 8663 Handle<JSReceiver> current =
8664 PrototypeIterator::GetCurrent<JSReceiver>(iter); 8664 PrototypeIterator::GetCurrent<JSReceiver>(iter);
8665 Maybe<bool> result = Just(false); // Dummy initialization. 8665 Maybe<bool> result = Just(false); // Dummy initialization.
8666 if (current->IsJSProxy()) { 8666 if (current->IsJSProxy()) {
8667 result = JSProxy::OwnPropertyKeys(isolate, receiver, 8667 result = JSProxy::OwnPropertyKeys(isolate, receiver,
8668 Handle<JSProxy>::cast(current), filter, 8668 Handle<JSProxy>::cast(current), filter,
8669 accumulator); 8669 accumulator);
8670 } else { 8670 } else {
8671 DCHECK(current->IsJSObject()); 8671 DCHECK(current->IsJSObject());
8672 result = GetKeysFromJSObject(isolate, receiver, 8672 result = GetKeysFromJSObject(isolate, receiver,
8673 Handle<JSObject>::cast(current), &filter, 8673 Handle<JSObject>::cast(current), &filter,
8674 type, accumulator); 8674 type, accumulator);
8675 } 8675 }
8676 MAYBE_RETURN(result, Nothing<bool>()); 8676 MAYBE_RETURN(result, Nothing<bool>());
8677 if (!result.FromJust()) break; // |false| means "stop iterating". 8677 if (!result.FromJust()) break; // |false| means "stop iterating".
8678 if (!iter.AdvanceFollowingProxies(PrototypeIterator::STOP_EARLY)) {
8679 return Nothing<bool>();
8680 }
8678 } 8681 }
8679 return Just(true); 8682 return Just(true);
8680 } 8683 }
8681 8684
8682 8685
8683 // ES6 9.5.12 8686 // ES6 9.5.12
8684 // Returns |true| on success, |nothing| in case of exception. 8687 // Returns |true| on success, |nothing| in case of exception.
8685 // static 8688 // static
8686 Maybe<bool> JSProxy::OwnPropertyKeys(Isolate* isolate, 8689 Maybe<bool> JSProxy::OwnPropertyKeys(Isolate* isolate,
8687 Handle<JSReceiver> receiver, 8690 Handle<JSReceiver> receiver,
(...skipping 11170 matching lines...) Expand 10 before | Expand all | Expand 10 after
19858 if (cell->value() != *new_value) { 19861 if (cell->value() != *new_value) {
19859 cell->set_value(*new_value); 19862 cell->set_value(*new_value);
19860 Isolate* isolate = cell->GetIsolate(); 19863 Isolate* isolate = cell->GetIsolate();
19861 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19864 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19862 isolate, DependentCode::kPropertyCellChangedGroup); 19865 isolate, DependentCode::kPropertyCellChangedGroup);
19863 } 19866 }
19864 } 19867 }
19865 19868
19866 } // namespace internal 19869 } // namespace internal
19867 } // namespace v8 19870 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/prototype.h » ('j') | test/mjsunit/harmony/proxies-for.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698