| 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 9548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9559 // mirrors. | 9559 // mirrors. |
| 9560 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) { | 9560 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) { |
| 9561 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index)); | 9561 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index)); |
| 9562 if (HasFastProperties()) { | 9562 if (HasFastProperties()) { |
| 9563 DescriptorArray* descs = map()->instance_descriptors(); | 9563 DescriptorArray* descs = map()->instance_descriptors(); |
| 9564 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 9564 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
| 9565 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i)); | 9565 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i)); |
| 9566 } | 9566 } |
| 9567 ASSERT(storage->length() >= index); | 9567 ASSERT(storage->length() >= index); |
| 9568 } else { | 9568 } else { |
| 9569 property_dictionary()->CopyKeysTo(storage, StringDictionary::UNSORTED); | 9569 property_dictionary()->CopyKeysTo(storage, |
| 9570 index, |
| 9571 StringDictionary::UNSORTED); |
| 9570 } | 9572 } |
| 9571 } | 9573 } |
| 9572 | 9574 |
| 9573 | 9575 |
| 9574 int JSObject::NumberOfLocalElements(PropertyAttributes filter) { | 9576 int JSObject::NumberOfLocalElements(PropertyAttributes filter) { |
| 9575 return GetLocalElementKeys(NULL, filter); | 9577 return GetLocalElementKeys(NULL, filter); |
| 9576 } | 9578 } |
| 9577 | 9579 |
| 9578 | 9580 |
| 9579 int JSObject::NumberOfEnumElements() { | 9581 int JSObject::NumberOfEnumElements() { |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10309 int, JSObject::DeleteMode); | 10311 int, JSObject::DeleteMode); |
| 10310 | 10312 |
| 10311 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Shrink( | 10313 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Shrink( |
| 10312 String*); | 10314 String*); |
| 10313 | 10315 |
| 10314 template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::Shrink( | 10316 template MaybeObject* Dictionary<NumberDictionaryShape, uint32_t>::Shrink( |
| 10315 uint32_t); | 10317 uint32_t); |
| 10316 | 10318 |
| 10317 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo( | 10319 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo( |
| 10318 FixedArray*, | 10320 FixedArray*, |
| 10321 int, |
| 10319 Dictionary<StringDictionaryShape, String*>::SortMode); | 10322 Dictionary<StringDictionaryShape, String*>::SortMode); |
| 10320 | 10323 |
| 10321 template int | 10324 template int |
| 10322 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes( | 10325 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes( |
| 10323 PropertyAttributes); | 10326 PropertyAttributes); |
| 10324 | 10327 |
| 10325 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add( | 10328 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add( |
| 10326 String*, Object*, PropertyDetails); | 10329 String*, Object*, PropertyDetails); |
| 10327 | 10330 |
| 10328 template MaybeObject* | 10331 template MaybeObject* |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11407 } | 11410 } |
| 11408 } | 11411 } |
| 11409 storage->SortPairs(sort_array, sort_array->length()); | 11412 storage->SortPairs(sort_array, sort_array->length()); |
| 11410 ASSERT(storage->length() >= index); | 11413 ASSERT(storage->length() >= index); |
| 11411 } | 11414 } |
| 11412 | 11415 |
| 11413 | 11416 |
| 11414 template<typename Shape, typename Key> | 11417 template<typename Shape, typename Key> |
| 11415 void Dictionary<Shape, Key>::CopyKeysTo( | 11418 void Dictionary<Shape, Key>::CopyKeysTo( |
| 11416 FixedArray* storage, | 11419 FixedArray* storage, |
| 11420 int index, |
| 11417 typename Dictionary<Shape, Key>::SortMode sort_mode) { | 11421 typename Dictionary<Shape, Key>::SortMode sort_mode) { |
| 11418 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( | 11422 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( |
| 11419 static_cast<PropertyAttributes>(NONE))); | 11423 static_cast<PropertyAttributes>(NONE))); |
| 11420 int capacity = HashTable<Shape, Key>::Capacity(); | 11424 int capacity = HashTable<Shape, Key>::Capacity(); |
| 11421 int index = 0; | |
| 11422 for (int i = 0; i < capacity; i++) { | 11425 for (int i = 0; i < capacity; i++) { |
| 11423 Object* k = HashTable<Shape, Key>::KeyAt(i); | 11426 Object* k = HashTable<Shape, Key>::KeyAt(i); |
| 11424 if (HashTable<Shape, Key>::IsKey(k)) { | 11427 if (HashTable<Shape, Key>::IsKey(k)) { |
| 11425 PropertyDetails details = DetailsAt(i); | 11428 PropertyDetails details = DetailsAt(i); |
| 11426 if (details.IsDeleted()) continue; | 11429 if (details.IsDeleted()) continue; |
| 11427 storage->set(index++, k); | 11430 storage->set(index++, k); |
| 11428 } | 11431 } |
| 11429 } | 11432 } |
| 11430 if (sort_mode == Dictionary<Shape, Key>::SORTED) { | 11433 if (sort_mode == Dictionary<Shape, Key>::SORTED) { |
| 11431 storage->SortPairs(storage, index); | 11434 storage->SortPairs(storage, index); |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11836 if (break_point_objects()->IsUndefined()) return 0; | 11839 if (break_point_objects()->IsUndefined()) return 0; |
| 11837 // Single beak point. | 11840 // Single beak point. |
| 11838 if (!break_point_objects()->IsFixedArray()) return 1; | 11841 if (!break_point_objects()->IsFixedArray()) return 1; |
| 11839 // Multiple break points. | 11842 // Multiple break points. |
| 11840 return FixedArray::cast(break_point_objects())->length(); | 11843 return FixedArray::cast(break_point_objects())->length(); |
| 11841 } | 11844 } |
| 11842 #endif | 11845 #endif |
| 11843 | 11846 |
| 11844 | 11847 |
| 11845 } } // namespace v8::internal | 11848 } } // namespace v8::internal |
| OLD | NEW |