Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/elements.cc

Issue 1433133003: [runtime] Make elements backing store for arguments non-holey. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix another case. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 FixedArrayBase* backing_store, 935 FixedArrayBase* backing_store,
936 uint32_t index, 936 uint32_t index,
937 PropertyAttributes filter) { 937 PropertyAttributes filter) {
938 if (IsHoleyElementsKind(kind())) { 938 if (IsHoleyElementsKind(kind())) {
939 return index < ElementsAccessorSubclass::GetCapacityImpl(holder, 939 return index < ElementsAccessorSubclass::GetCapacityImpl(holder,
940 backing_store) && 940 backing_store) &&
941 !BackingStore::cast(backing_store)->is_the_hole(index) 941 !BackingStore::cast(backing_store)->is_the_hole(index)
942 ? index 942 ? index
943 : kMaxUInt32; 943 : kMaxUInt32;
944 } else { 944 } else {
945 Smi* smi_length = Smi::cast(JSArray::cast(holder)->length()); 945 uint32_t length =
946 uint32_t length = static_cast<uint32_t>(smi_length->value()); 946 holder->IsJSArray()
947 ? static_cast<uint32_t>(
948 Smi::cast(JSArray::cast(holder)->length())->value())
949 : ElementsAccessorSubclass::GetCapacityImpl(holder,
950 backing_store);
947 return index < length ? index : kMaxUInt32; 951 return index < length ? index : kMaxUInt32;
948 } 952 }
949 } 953 }
950 954
951 uint32_t GetEntryForIndex(JSObject* holder, FixedArrayBase* backing_store, 955 uint32_t GetEntryForIndex(JSObject* holder, FixedArrayBase* backing_store,
952 uint32_t index) final { 956 uint32_t index) final {
953 return ElementsAccessorSubclass::GetEntryForIndexImpl(holder, backing_store, 957 return ElementsAccessorSubclass::GetEntryForIndexImpl(holder, backing_store,
954 index, NONE); 958 index, NONE);
955 } 959 }
956 960
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 } 2386 }
2383 } 2387 }
2384 2388
2385 DCHECK(j == result_len); 2389 DCHECK(j == result_len);
2386 return result_array; 2390 return result_array;
2387 } 2391 }
2388 2392
2389 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 2393 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
2390 } // namespace internal 2394 } // namespace internal
2391 } // namespace v8 2395 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698