OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/elements.h" | 5 #include "src/elements.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 Handle<FixedArrayBase> from(receiver->elements()); | 895 Handle<FixedArrayBase> from(receiver->elements()); |
896 uint32_t add_length = | 896 uint32_t add_length = |
897 ElementsAccessorSubclass::GetCapacityImpl(*receiver, *from); | 897 ElementsAccessorSubclass::GetCapacityImpl(*receiver, *from); |
898 if (add_length == 0) return; | 898 if (add_length == 0) return; |
899 | 899 |
900 for (uint32_t i = 0; i < add_length; i++) { | 900 for (uint32_t i = 0; i < add_length; i++) { |
901 if (!ElementsAccessorSubclass::HasEntryImpl(*from, i)) continue; | 901 if (!ElementsAccessorSubclass::HasEntryImpl(*from, i)) continue; |
902 Handle<Object> value = ElementsAccessorSubclass::GetImpl(from, i); | 902 Handle<Object> value = ElementsAccessorSubclass::GetImpl(from, i); |
903 DCHECK(!value->IsTheHole()); | 903 DCHECK(!value->IsTheHole()); |
904 DCHECK(!value->IsAccessorPair()); | 904 DCHECK(!value->IsAccessorPair()); |
905 DCHECK(!value->IsExecutableAccessorInfo()); | 905 DCHECK(!value->IsAccessorInfo()); |
906 accumulator->AddKey(value, convert); | 906 accumulator->AddKey(value, convert); |
907 } | 907 } |
908 } | 908 } |
909 | 909 |
910 static uint32_t GetCapacityImpl(JSObject* holder, | 910 static uint32_t GetCapacityImpl(JSObject* holder, |
911 FixedArrayBase* backing_store) { | 911 FixedArrayBase* backing_store) { |
912 return backing_store->length(); | 912 return backing_store->length(); |
913 } | 913 } |
914 | 914 |
915 uint32_t GetCapacity(JSObject* holder, FixedArrayBase* backing_store) final { | 915 uint32_t GetCapacity(JSObject* holder, FixedArrayBase* backing_store) final { |
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 } | 2415 } |
2416 } | 2416 } |
2417 | 2417 |
2418 DCHECK(j == result_len); | 2418 DCHECK(j == result_len); |
2419 return result_array; | 2419 return result_array; |
2420 } | 2420 } |
2421 | 2421 |
2422 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 2422 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
2423 } // namespace internal | 2423 } // namespace internal |
2424 } // namespace v8 | 2424 } // namespace v8 |
OLD | NEW |