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

Side by Side Diff: src/objects.cc

Issue 1194943002: Inline SetLengthWithoutNormalize into its callers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only find last non-configurable element in dicts if it can be present Created 5 years, 6 months 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
« src/elements.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 11916 matching lines...) Expand 10 before | Expand all | Expand 10 after
11927 : JSReceiver::GetDataProperty(&it); 11927 : JSReceiver::GetDataProperty(&it);
11928 old_values->Add(value); 11928 old_values->Add(value);
11929 indices->Add(index); 11929 indices->Add(index);
11930 return true; 11930 return true;
11931 } 11931 }
11932 11932
11933 11933
11934 void JSArray::SetLength(Handle<JSArray> array, uint32_t new_length) { 11934 void JSArray::SetLength(Handle<JSArray> array, uint32_t new_length) {
11935 // We should never end in here with a pixel or external array. 11935 // We should never end in here with a pixel or external array.
11936 DCHECK(array->AllowsSetLength()); 11936 DCHECK(array->AllowsSetLength());
11937 if (JSArray::SetLengthWouldNormalize(array->GetHeap(), new_length)) {
11938 JSObject::NormalizeElements(array);
11939 }
11937 array->GetElementsAccessor()->SetLength(array, new_length); 11940 array->GetElementsAccessor()->SetLength(array, new_length);
11938 } 11941 }
11939 11942
11940 11943
11941 MaybeHandle<Object> JSArray::ObservableSetLength(Handle<JSArray> array, 11944 MaybeHandle<Object> JSArray::ObservableSetLength(Handle<JSArray> array,
11942 uint32_t new_length) { 11945 uint32_t new_length) {
11943 if (!array->map()->is_observed()) { 11946 if (!array->map()->is_observed()) {
11944 SetLength(array, new_length); 11947 SetLength(array, new_length);
11945 return array; 11948 return array;
11946 } 11949 }
(...skipping 4707 matching lines...) Expand 10 before | Expand all | Expand 10 after
16654 Handle<Object> new_value) { 16657 Handle<Object> new_value) {
16655 if (cell->value() != *new_value) { 16658 if (cell->value() != *new_value) {
16656 cell->set_value(*new_value); 16659 cell->set_value(*new_value);
16657 Isolate* isolate = cell->GetIsolate(); 16660 Isolate* isolate = cell->GetIsolate();
16658 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16661 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16659 isolate, DependentCode::kPropertyCellChangedGroup); 16662 isolate, DependentCode::kPropertyCellChangedGroup);
16660 } 16663 }
16661 } 16664 }
16662 } // namespace internal 16665 } // namespace internal
16663 } // namespace v8 16666 } // namespace v8
OLDNEW
« src/elements.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698