OLD | NEW |
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_KEY_ACCUMULATOR_H_ | 5 #ifndef V8_KEY_ACCUMULATOR_H_ |
6 #define V8_KEY_ACCUMULATOR_H_ | 6 #define V8_KEY_ACCUMULATOR_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 AddKeyConversion convert = DO_NOT_CONVERT); | 45 AddKeyConversion convert = DO_NOT_CONVERT); |
46 void AddKeysFromProxy(Handle<JSObject> array); | 46 void AddKeysFromProxy(Handle<JSObject> array); |
47 void AddElementKeysFromInterceptor(Handle<JSObject> array); | 47 void AddElementKeysFromInterceptor(Handle<JSObject> array); |
48 // Jump to the next level, pushing the current |levelLength_| to | 48 // Jump to the next level, pushing the current |levelLength_| to |
49 // |levelLengths_| and adding a new list to |elements_|. | 49 // |levelLengths_| and adding a new list to |elements_|. |
50 void NextPrototype(); | 50 void NextPrototype(); |
51 // Sort the integer indices in the last list in |elements_| | 51 // Sort the integer indices in the last list in |elements_| |
52 void SortCurrentElementsList(); | 52 void SortCurrentElementsList(); |
53 Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS); | 53 Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS); |
54 int length() { return length_; } | 54 int length() { return length_; } |
| 55 Isolate* isolate() { return isolate_; } |
55 | 56 |
56 private: | 57 private: |
57 bool AddIntegerKey(uint32_t key); | 58 bool AddIntegerKey(uint32_t key); |
58 bool AddStringKey(Handle<Object> key, AddKeyConversion convert); | 59 bool AddStringKey(Handle<Object> key, AddKeyConversion convert); |
59 bool AddSymbolKey(Handle<Object> array); | 60 bool AddSymbolKey(Handle<Object> array); |
60 void SortCurrentElementsListRemoveDuplicates(); | 61 void SortCurrentElementsListRemoveDuplicates(); |
61 | 62 |
62 Isolate* isolate_; | 63 Isolate* isolate_; |
63 KeyFilter filter_; | 64 KeyFilter filter_; |
64 // |elements_| contains the sorted element keys (indices) per level. | 65 // |elements_| contains the sorted element keys (indices) per level. |
(...skipping 18 matching lines...) Expand all Loading... |
83 | 84 |
84 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 85 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
85 }; | 86 }; |
86 | 87 |
87 | 88 |
88 } // namespace internal | 89 } // namespace internal |
89 } // namespace v8 | 90 } // namespace v8 |
90 | 91 |
91 | 92 |
92 #endif // V8_KEY_ACCUMULATOR_H_ | 93 #endif // V8_KEY_ACCUMULATOR_H_ |
OLD | NEW |