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>(); | 332 DCHECK_EQ(kData, details.kind()); |
333 } else { | |
334 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); | 333 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); |
335 int load_by_field_index = field_index.GetLoadByFieldIndex(); | 334 int load_by_field_index = field_index.GetLoadByFieldIndex(); |
336 indices->set(index, Smi::FromInt(load_by_field_index)); | 335 indices->set(index, Smi::FromInt(load_by_field_index)); |
| 336 } else { |
| 337 indices = Handle<FixedArray>(); |
337 } | 338 } |
338 } | 339 } |
339 index++; | 340 index++; |
340 } | 341 } |
341 DCHECK(index == storage->length()); | 342 DCHECK(index == storage->length()); |
342 | 343 |
343 DescriptorArray::SetEnumCache(descs, isolate, storage, indices); | 344 DescriptorArray::SetEnumCache(descs, isolate, storage, indices); |
344 if (cache_enum_length) { | 345 if (cache_enum_length) { |
345 map->SetEnumLength(own_property_count); | 346 map->SetEnumLength(own_property_count); |
346 } | 347 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 isolate_, keys, | 863 isolate_, keys, |
863 KeyAccumulator::GetKeys(target, KeyCollectionMode::kOwnOnly, filter_, | 864 KeyAccumulator::GetKeys(target, KeyCollectionMode::kOwnOnly, filter_, |
864 GetKeysConversion::kConvertToString, is_for_in_), | 865 GetKeysConversion::kConvertToString, is_for_in_), |
865 Nothing<bool>()); | 866 Nothing<bool>()); |
866 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); | 867 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); |
867 return result; | 868 return result; |
868 } | 869 } |
869 | 870 |
870 } // namespace internal | 871 } // namespace internal |
871 } // namespace v8 | 872 } // namespace v8 |
OLD | NEW |