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

Side by Side Diff: src/keys.h

Issue 1963633002: [keys] fixing nested JSProxy for-in enumeration (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 | « no previous file | src/keys.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_KEYS_H_ 5 #ifndef V8_KEYS_H_
6 #define V8_KEYS_H_ 6 #define V8_KEYS_H_
7 7
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void CollectOwnPropertyNames(Handle<JSObject> object); 43 void CollectOwnPropertyNames(Handle<JSObject> object);
44 44
45 static Handle<FixedArray> GetEnumPropertyKeys(Isolate* isolate, 45 static Handle<FixedArray> GetEnumPropertyKeys(Isolate* isolate,
46 Handle<JSObject> object); 46 Handle<JSObject> object);
47 47
48 bool AddKey(uint32_t key); 48 bool AddKey(uint32_t key);
49 bool AddKey(Object* key, AddKeyConversion convert); 49 bool AddKey(Object* key, AddKeyConversion convert);
50 bool AddKey(Handle<Object> key, AddKeyConversion convert); 50 bool AddKey(Handle<Object> key, AddKeyConversion convert);
51 void AddKeys(Handle<FixedArray> array, AddKeyConversion convert); 51 void AddKeys(Handle<FixedArray> array, AddKeyConversion convert);
52 void AddKeys(Handle<JSObject> array, AddKeyConversion convert); 52 void AddKeys(Handle<JSObject> array, AddKeyConversion convert);
53 void AddKeysFromProxy(Handle<JSObject> array);
54 Maybe<bool> AddKeysFromProxy(Handle<JSProxy> proxy, Handle<FixedArray> keys);
55 void AddElementKeysFromInterceptor(Handle<JSObject> array); 53 void AddElementKeysFromInterceptor(Handle<JSObject> array);
56 54
57 // Jump to the next level, pushing the current |levelLength_| to 55 // Jump to the next level, pushing the current |levelLength_| to
58 // |levelLengths_| and adding a new list to |elements_|. 56 // |levelLengths_| and adding a new list to |elements_|.
59 void NextPrototype(); 57 void NextPrototype();
60 // Sort the integer indices in the last list in |elements_| 58 // Sort the integer indices in the last list in |elements_|
61 void SortCurrentElementsList(); 59 void SortCurrentElementsList();
62 int length() { return length_; } 60 int length() { return length_; }
63 Isolate* isolate() { return isolate_; } 61 Isolate* isolate() { return isolate_; }
64 PropertyFilter filter() { return filter_; } 62 PropertyFilter filter() { return filter_; }
65 void set_filter_proxy_keys(bool filter) { filter_proxy_keys_ = filter; } 63 void set_filter_proxy_keys(bool filter) { filter_proxy_keys_ = filter; }
66 64
67 private: 65 private:
66 Maybe<bool> CollectOwnKeys(Handle<JSReceiver> receiver,
67 Handle<JSObject> object);
68 Maybe<bool> CollectOwnJSProxyKeys(Handle<JSReceiver> receiver, 68 Maybe<bool> CollectOwnJSProxyKeys(Handle<JSReceiver> receiver,
69 Handle<JSProxy> proxy); 69 Handle<JSProxy> proxy);
70 Maybe<bool> CollectOwnKeys(Handle<JSReceiver> receiver, 70 Maybe<bool> CollectOwnJSProxyTargetKeys(Handle<JSProxy> proxy,
71 Handle<JSObject> object); 71 Handle<JSReceiver> target);
72
73 Maybe<bool> AddKeysFromJSProxy(Handle<JSProxy> proxy,
74 Handle<FixedArray> keys);
75
72 bool AddIntegerKey(uint32_t key); 76 bool AddIntegerKey(uint32_t key);
73 bool AddStringKey(Handle<Object> key, AddKeyConversion convert); 77 bool AddStringKey(Handle<Object> key, AddKeyConversion convert);
74 bool AddSymbolKey(Handle<Object> array); 78 bool AddSymbolKey(Handle<Object> array);
75 void SortCurrentElementsListRemoveDuplicates(); 79 void SortCurrentElementsListRemoveDuplicates();
76 80
77 Isolate* isolate_; 81 Isolate* isolate_;
78 KeyCollectionType type_; 82 KeyCollectionType type_;
79 PropertyFilter filter_; 83 PropertyFilter filter_;
80 bool filter_proxy_keys_ = true; 84 bool filter_proxy_keys_ = true;
81 // |elements_| contains the sorted element keys (indices) per level. 85 // |elements_| contains the sorted element keys (indices) per level.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool has_empty_prototype_ = false; 138 bool has_empty_prototype_ = false;
135 bool filter_proxy_keys_ = true; 139 bool filter_proxy_keys_ = true;
136 140
137 DISALLOW_COPY_AND_ASSIGN(FastKeyAccumulator); 141 DISALLOW_COPY_AND_ASSIGN(FastKeyAccumulator);
138 }; 142 };
139 143
140 } // namespace internal 144 } // namespace internal
141 } // namespace v8 145 } // namespace v8
142 146
143 #endif // V8_KEYS_H_ 147 #endif // V8_KEYS_H_
OLDNEW
« no previous file with comments | « no previous file | src/keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698