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

Side by Side Diff: src/objects.cc

Issue 1189423002: Don't roundtrip to JS to update the length. This is 1) faster (although we don't care) and 2) avoid… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | 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 12000 matching lines...) Expand 10 before | Expand all | Expand 10 after
12011 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0); 12011 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0);
12012 if (delete_count > 0) { 12012 if (delete_count > 0) {
12013 for (int i = indices.length() - 1; i >= 0; i--) { 12013 for (int i = indices.length() - 1; i >= 0; i--) {
12014 // Skip deletions where the property was an accessor, leaving holes 12014 // Skip deletions where the property was an accessor, leaving holes
12015 // in the array of old values. 12015 // in the array of old values.
12016 if (old_values[i]->IsTheHole()) continue; 12016 if (old_values[i]->IsTheHole()) continue;
12017 JSObject::AddDataElement(deleted, indices[i] - index, old_values[i], NONE) 12017 JSObject::AddDataElement(deleted, indices[i] - index, old_values[i], NONE)
12018 .Assert(); 12018 .Assert();
12019 } 12019 }
12020 12020
12021 SetProperty(deleted, isolate->factory()->length_string(), 12021 ElementsAccessor* accessor = deleted->GetElementsAccessor();
12022 isolate->factory()->NewNumberFromUint(delete_count), 12022 accessor->SetLength(deleted, isolate->factory()->NewNumberFromUint(
12023 STRICT).Assert(); 12023 delete_count)).Check();
12024 } 12024 }
12025 12025
12026 RETURN_ON_EXCEPTION( 12026 RETURN_ON_EXCEPTION(
12027 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object); 12027 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object);
12028 12028
12029 return hresult; 12029 return hresult;
12030 } 12030 }
12031 12031
12032 12032
12033 // static 12033 // static
(...skipping 4640 matching lines...) Expand 10 before | Expand all | Expand 10 after
16674 Handle<Object> new_value) { 16674 Handle<Object> new_value) {
16675 if (cell->value() != *new_value) { 16675 if (cell->value() != *new_value) {
16676 cell->set_value(*new_value); 16676 cell->set_value(*new_value);
16677 Isolate* isolate = cell->GetIsolate(); 16677 Isolate* isolate = cell->GetIsolate();
16678 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16678 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16679 isolate, DependentCode::kPropertyCellChangedGroup); 16679 isolate, DependentCode::kPropertyCellChangedGroup);
16680 } 16680 }
16681 } 16681 }
16682 } // namespace internal 16682 } // namespace internal
16683 } // namespace v8 16683 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698