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 #include "src/elements.h" | 5 #include "src/elements.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 int capacity = dictionary->Capacity(); | 1320 int capacity = dictionary->Capacity(); |
1321 Handle<FixedArray> elements = isolate->factory()->NewFixedArray( | 1321 Handle<FixedArray> elements = isolate->factory()->NewFixedArray( |
1322 GetMaxNumberOfEntries(*object, *backing_store)); | 1322 GetMaxNumberOfEntries(*object, *backing_store)); |
1323 int insertion_index = 0; | 1323 int insertion_index = 0; |
1324 PropertyFilter filter = keys->filter(); | 1324 PropertyFilter filter = keys->filter(); |
1325 for (int i = 0; i < capacity; i++) { | 1325 for (int i = 0; i < capacity; i++) { |
1326 Object* raw_key = dictionary->KeyAt(i); | 1326 Object* raw_key = dictionary->KeyAt(i); |
1327 if (!dictionary->IsKey(isolate, raw_key)) continue; | 1327 if (!dictionary->IsKey(isolate, raw_key)) continue; |
1328 uint32_t key = FilterKey(dictionary, i, raw_key, filter); | 1328 uint32_t key = FilterKey(dictionary, i, raw_key, filter); |
1329 if (key == kMaxUInt32) { | 1329 if (key == kMaxUInt32) { |
1330 keys->AddShadowKey(raw_key); | 1330 keys->AddShadowingKey(raw_key); |
1331 continue; | 1331 continue; |
1332 } | 1332 } |
1333 elements->set(insertion_index, raw_key); | 1333 elements->set(insertion_index, raw_key); |
1334 insertion_index++; | 1334 insertion_index++; |
1335 } | 1335 } |
1336 SortIndices(elements, insertion_index); | 1336 SortIndices(elements, insertion_index); |
1337 for (int i = 0; i < insertion_index; i++) { | 1337 for (int i = 0; i < insertion_index; i++) { |
1338 keys->AddKey(elements->get(i)); | 1338 keys->AddKey(elements->get(i)); |
1339 } | 1339 } |
1340 } | 1340 } |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3030 insertion_index += len; | 3030 insertion_index += len; |
3031 } | 3031 } |
3032 | 3032 |
3033 DCHECK_EQ(insertion_index, result_len); | 3033 DCHECK_EQ(insertion_index, result_len); |
3034 return result_array; | 3034 return result_array; |
3035 } | 3035 } |
3036 | 3036 |
3037 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 3037 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
3038 } // namespace internal | 3038 } // namespace internal |
3039 } // namespace v8 | 3039 } // namespace v8 |
OLD | NEW |