OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 11209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11220 int Dictionary<Shape, Key>::NumberOfEnumElements() { | 11220 int Dictionary<Shape, Key>::NumberOfEnumElements() { |
11221 return NumberOfElementsFilterAttributes( | 11221 return NumberOfElementsFilterAttributes( |
11222 static_cast<PropertyAttributes>(DONT_ENUM)); | 11222 static_cast<PropertyAttributes>(DONT_ENUM)); |
11223 } | 11223 } |
11224 | 11224 |
11225 | 11225 |
11226 template<typename Shape, typename Key> | 11226 template<typename Shape, typename Key> |
11227 void Dictionary<Shape, Key>::CopyKeysTo( | 11227 void Dictionary<Shape, Key>::CopyKeysTo( |
11228 FixedArray* storage, | 11228 FixedArray* storage, |
11229 PropertyAttributes filter, | 11229 PropertyAttributes filter, |
11230 Dictionary<Shape, Key>::SortMode sort_mode) { | 11230 typename Dictionary<Shape, Key>::SortMode sort_mode) { |
11231 ASSERT(storage->length() >= NumberOfEnumElements()); | 11231 ASSERT(storage->length() >= NumberOfEnumElements()); |
11232 int capacity = HashTable<Shape, Key>::Capacity(); | 11232 int capacity = HashTable<Shape, Key>::Capacity(); |
11233 int index = 0; | 11233 int index = 0; |
11234 for (int i = 0; i < capacity; i++) { | 11234 for (int i = 0; i < capacity; i++) { |
11235 Object* k = HashTable<Shape, Key>::KeyAt(i); | 11235 Object* k = HashTable<Shape, Key>::KeyAt(i); |
11236 if (HashTable<Shape, Key>::IsKey(k)) { | 11236 if (HashTable<Shape, Key>::IsKey(k)) { |
11237 PropertyDetails details = DetailsAt(i); | 11237 PropertyDetails details = DetailsAt(i); |
11238 if (details.IsDeleted()) continue; | 11238 if (details.IsDeleted()) continue; |
11239 PropertyAttributes attr = details.attributes(); | 11239 PropertyAttributes attr = details.attributes(); |
11240 if ((attr & filter) == 0) storage->set(index++, k); | 11240 if ((attr & filter) == 0) storage->set(index++, k); |
(...skipping 22 matching lines...) Expand all Loading... |
11263 } | 11263 } |
11264 } | 11264 } |
11265 storage->SortPairs(sort_array, sort_array->length()); | 11265 storage->SortPairs(sort_array, sort_array->length()); |
11266 ASSERT(storage->length() >= index); | 11266 ASSERT(storage->length() >= index); |
11267 } | 11267 } |
11268 | 11268 |
11269 | 11269 |
11270 template<typename Shape, typename Key> | 11270 template<typename Shape, typename Key> |
11271 void Dictionary<Shape, Key>::CopyKeysTo( | 11271 void Dictionary<Shape, Key>::CopyKeysTo( |
11272 FixedArray* storage, | 11272 FixedArray* storage, |
11273 Dictionary<Shape, Key>::SortMode sort_mode) { | 11273 typename Dictionary<Shape, Key>::SortMode sort_mode) { |
11274 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( | 11274 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( |
11275 static_cast<PropertyAttributes>(NONE))); | 11275 static_cast<PropertyAttributes>(NONE))); |
11276 int capacity = HashTable<Shape, Key>::Capacity(); | 11276 int capacity = HashTable<Shape, Key>::Capacity(); |
11277 int index = 0; | 11277 int index = 0; |
11278 for (int i = 0; i < capacity; i++) { | 11278 for (int i = 0; i < capacity; i++) { |
11279 Object* k = HashTable<Shape, Key>::KeyAt(i); | 11279 Object* k = HashTable<Shape, Key>::KeyAt(i); |
11280 if (HashTable<Shape, Key>::IsKey(k)) { | 11280 if (HashTable<Shape, Key>::IsKey(k)) { |
11281 PropertyDetails details = DetailsAt(i); | 11281 PropertyDetails details = DetailsAt(i); |
11282 if (details.IsDeleted()) continue; | 11282 if (details.IsDeleted()) continue; |
11283 storage->set(index++, k); | 11283 storage->set(index++, k); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11692 if (break_point_objects()->IsUndefined()) return 0; | 11692 if (break_point_objects()->IsUndefined()) return 0; |
11693 // Single beak point. | 11693 // Single beak point. |
11694 if (!break_point_objects()->IsFixedArray()) return 1; | 11694 if (!break_point_objects()->IsFixedArray()) return 1; |
11695 // Multiple break points. | 11695 // Multiple break points. |
11696 return FixedArray::cast(break_point_objects())->length(); | 11696 return FixedArray::cast(break_point_objects())->length(); |
11697 } | 11697 } |
11698 #endif | 11698 #endif |
11699 | 11699 |
11700 | 11700 |
11701 } } // namespace v8::internal | 11701 } } // namespace v8::internal |
OLD | NEW |