| 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 8431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8442 // mirrors. | 8442 // mirrors. |
| 8443 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) { | 8443 void JSObject::GetLocalPropertyNames(FixedArray* storage, int index) { |
| 8444 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index)); | 8444 ASSERT(storage->length() >= (NumberOfLocalProperties(NONE) - index)); |
| 8445 if (HasFastProperties()) { | 8445 if (HasFastProperties()) { |
| 8446 DescriptorArray* descs = map()->instance_descriptors(); | 8446 DescriptorArray* descs = map()->instance_descriptors(); |
| 8447 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 8447 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
| 8448 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i)); | 8448 if (descs->IsProperty(i)) storage->set(index++, descs->GetKey(i)); |
| 8449 } | 8449 } |
| 8450 ASSERT(storage->length() >= index); | 8450 ASSERT(storage->length() >= index); |
| 8451 } else { | 8451 } else { |
| 8452 property_dictionary()->CopyKeysTo(storage); | 8452 property_dictionary()->CopyKeysTo(storage, index); |
| 8453 } | 8453 } |
| 8454 } | 8454 } |
| 8455 | 8455 |
| 8456 | 8456 |
| 8457 int JSObject::NumberOfLocalElements(PropertyAttributes filter) { | 8457 int JSObject::NumberOfLocalElements(PropertyAttributes filter) { |
| 8458 return GetLocalElementKeys(NULL, filter); | 8458 return GetLocalElementKeys(NULL, filter); |
| 8459 } | 8459 } |
| 8460 | 8460 |
| 8461 | 8461 |
| 8462 int JSObject::NumberOfEnumElements() { | 8462 int JSObject::NumberOfEnumElements() { |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9092 template void Dictionary<NumberDictionaryShape, uint32_t>::CopyKeysTo( | 9092 template void Dictionary<NumberDictionaryShape, uint32_t>::CopyKeysTo( |
| 9093 FixedArray*, PropertyAttributes); | 9093 FixedArray*, PropertyAttributes); |
| 9094 | 9094 |
| 9095 template Object* Dictionary<StringDictionaryShape, String*>::DeleteProperty( | 9095 template Object* Dictionary<StringDictionaryShape, String*>::DeleteProperty( |
| 9096 int, JSObject::DeleteMode); | 9096 int, JSObject::DeleteMode); |
| 9097 | 9097 |
| 9098 template Object* Dictionary<NumberDictionaryShape, uint32_t>::DeleteProperty( | 9098 template Object* Dictionary<NumberDictionaryShape, uint32_t>::DeleteProperty( |
| 9099 int, JSObject::DeleteMode); | 9099 int, JSObject::DeleteMode); |
| 9100 | 9100 |
| 9101 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo( | 9101 template void Dictionary<StringDictionaryShape, String*>::CopyKeysTo( |
| 9102 FixedArray*); | 9102 FixedArray*, int); |
| 9103 | 9103 |
| 9104 template int | 9104 template int |
| 9105 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes( | 9105 Dictionary<StringDictionaryShape, String*>::NumberOfElementsFilterAttributes( |
| 9106 PropertyAttributes); | 9106 PropertyAttributes); |
| 9107 | 9107 |
| 9108 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add( | 9108 template MaybeObject* Dictionary<StringDictionaryShape, String*>::Add( |
| 9109 String*, Object*, PropertyDetails); | 9109 String*, Object*, PropertyDetails); |
| 9110 | 9110 |
| 9111 template MaybeObject* | 9111 template MaybeObject* |
| 9112 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices(); | 9112 Dictionary<StringDictionaryShape, String*>::GenerateNewEnumerationIndices(); |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10177 sort_array->set(index, Smi::FromInt(details.index())); | 10177 sort_array->set(index, Smi::FromInt(details.index())); |
| 10178 index++; | 10178 index++; |
| 10179 } | 10179 } |
| 10180 } | 10180 } |
| 10181 storage->SortPairs(sort_array, sort_array->length()); | 10181 storage->SortPairs(sort_array, sort_array->length()); |
| 10182 ASSERT(storage->length() >= index); | 10182 ASSERT(storage->length() >= index); |
| 10183 } | 10183 } |
| 10184 | 10184 |
| 10185 | 10185 |
| 10186 template<typename Shape, typename Key> | 10186 template<typename Shape, typename Key> |
| 10187 void Dictionary<Shape, Key>::CopyKeysTo(FixedArray* storage) { | 10187 void Dictionary<Shape, Key>::CopyKeysTo( |
| 10188 FixedArray* storage, |
| 10189 int index) { |
| 10188 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( | 10190 ASSERT(storage->length() >= NumberOfElementsFilterAttributes( |
| 10189 static_cast<PropertyAttributes>(NONE))); | 10191 static_cast<PropertyAttributes>(NONE))); |
| 10190 int capacity = HashTable<Shape, Key>::Capacity(); | 10192 int capacity = HashTable<Shape, Key>::Capacity(); |
| 10191 int index = 0; | |
| 10192 for (int i = 0; i < capacity; i++) { | 10193 for (int i = 0; i < capacity; i++) { |
| 10193 Object* k = HashTable<Shape, Key>::KeyAt(i); | 10194 Object* k = HashTable<Shape, Key>::KeyAt(i); |
| 10194 if (HashTable<Shape, Key>::IsKey(k)) { | 10195 if (HashTable<Shape, Key>::IsKey(k)) { |
| 10195 PropertyDetails details = DetailsAt(i); | 10196 PropertyDetails details = DetailsAt(i); |
| 10196 if (details.IsDeleted()) continue; | 10197 if (details.IsDeleted()) continue; |
| 10197 storage->set(index++, k); | 10198 storage->set(index++, k); |
| 10198 } | 10199 } |
| 10199 } | 10200 } |
| 10200 ASSERT(storage->length() >= index); | 10201 ASSERT(storage->length() >= index); |
| 10201 } | 10202 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10603 if (break_point_objects()->IsUndefined()) return 0; | 10604 if (break_point_objects()->IsUndefined()) return 0; |
| 10604 // Single beak point. | 10605 // Single beak point. |
| 10605 if (!break_point_objects()->IsFixedArray()) return 1; | 10606 if (!break_point_objects()->IsFixedArray()) return 1; |
| 10606 // Multiple break points. | 10607 // Multiple break points. |
| 10607 return FixedArray::cast(break_point_objects())->length(); | 10608 return FixedArray::cast(break_point_objects())->length(); |
| 10608 } | 10609 } |
| 10609 #endif | 10610 #endif |
| 10610 | 10611 |
| 10611 | 10612 |
| 10612 } } // namespace v8::internal | 10613 } } // namespace v8::internal |
| OLD | NEW |