OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/keys.h" | 5 #include "src/keys.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/elements.h" | 8 #include "src/elements.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/identity-map.h" | 10 #include "src/identity-map.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 int size = map->NumberOfOwnDescriptors(); | 321 int size = map->NumberOfOwnDescriptors(); |
322 int index = 0; | 322 int index = 0; |
323 | 323 |
324 for (int i = 0; i < size; i++) { | 324 for (int i = 0; i < size; i++) { |
325 PropertyDetails details = descs->GetDetails(i); | 325 PropertyDetails details = descs->GetDetails(i); |
326 if (details.IsDontEnum()) continue; | 326 if (details.IsDontEnum()) continue; |
327 Object* key = descs->GetKey(i); | 327 Object* key = descs->GetKey(i); |
328 if (key->IsSymbol()) continue; | 328 if (key->IsSymbol()) continue; |
329 storage->set(index, key); | 329 storage->set(index, key); |
330 if (!indices.is_null()) { | 330 if (!indices.is_null()) { |
331 if (details.type() != DATA) { | 331 if (details.location() == kField) { |
332 indices = Handle<FixedArray>(); | |
333 } else { | |
334 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); | 332 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); |
335 int load_by_field_index = field_index.GetLoadByFieldIndex(); | 333 int load_by_field_index = field_index.GetLoadByFieldIndex(); |
336 indices->set(index, Smi::FromInt(load_by_field_index)); | 334 indices->set(index, Smi::FromInt(load_by_field_index)); |
| 335 } else { |
| 336 indices = Handle<FixedArray>(); |
337 } | 337 } |
338 } | 338 } |
339 index++; | 339 index++; |
340 } | 340 } |
341 DCHECK(index == storage->length()); | 341 DCHECK(index == storage->length()); |
342 | 342 |
343 DescriptorArray::SetEnumCache(descs, isolate, storage, indices); | 343 DescriptorArray::SetEnumCache(descs, isolate, storage, indices); |
344 if (cache_enum_length) { | 344 if (cache_enum_length) { |
345 map->SetEnumLength(own_property_count); | 345 map->SetEnumLength(own_property_count); |
346 } | 346 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 isolate_, keys, | 862 isolate_, keys, |
863 KeyAccumulator::GetKeys(target, KeyCollectionMode::kOwnOnly, filter_, | 863 KeyAccumulator::GetKeys(target, KeyCollectionMode::kOwnOnly, filter_, |
864 GetKeysConversion::kConvertToString, is_for_in_), | 864 GetKeysConversion::kConvertToString, is_for_in_), |
865 Nothing<bool>()); | 865 Nothing<bool>()); |
866 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); | 866 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); |
867 return result; | 867 return result; |
868 } | 868 } |
869 | 869 |
870 } // namespace internal | 870 } // namespace internal |
871 } // namespace v8 | 871 } // namespace v8 |
OLD | NEW |