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

Side by Side Diff: src/objects.cc

Issue 820503005: Use SetOwnElement when creating splice records in array length setter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | test/mjsunit/es7/regress/regress-443982.js » ('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 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 <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 11789 matching lines...) Expand 10 before | Expand all | Expand 10 after
11800 11800
11801 uint32_t index = Min(old_length, new_length); 11801 uint32_t index = Min(old_length, new_length);
11802 uint32_t add_count = new_length > old_length ? new_length - old_length : 0; 11802 uint32_t add_count = new_length > old_length ? new_length - old_length : 0;
11803 uint32_t delete_count = new_length < old_length ? old_length - new_length : 0; 11803 uint32_t delete_count = new_length < old_length ? old_length - new_length : 0;
11804 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0); 11804 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0);
11805 if (delete_count > 0) { 11805 if (delete_count > 0) {
11806 for (int i = indices.length() - 1; i >= 0; i--) { 11806 for (int i = indices.length() - 1; i >= 0; i--) {
11807 // Skip deletions where the property was an accessor, leaving holes 11807 // Skip deletions where the property was an accessor, leaving holes
11808 // in the array of old values. 11808 // in the array of old values.
11809 if (old_values[i]->IsTheHole()) continue; 11809 if (old_values[i]->IsTheHole()) continue;
11810 JSObject::SetElement( 11810 JSObject::SetOwnElement(deleted, indices[i] - index, old_values[i],
11811 deleted, indices[i] - index, old_values[i], NONE, SLOPPY).Assert(); 11811 SLOPPY).Assert();
11812 } 11812 }
11813 11813
11814 SetProperty(deleted, isolate->factory()->length_string(), 11814 SetProperty(deleted, isolate->factory()->length_string(),
11815 isolate->factory()->NewNumberFromUint(delete_count), 11815 isolate->factory()->NewNumberFromUint(delete_count),
11816 STRICT).Assert(); 11816 STRICT).Assert();
11817 } 11817 }
11818 11818
11819 RETURN_ON_EXCEPTION( 11819 RETURN_ON_EXCEPTION(
11820 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object); 11820 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object);
11821 11821
(...skipping 5282 matching lines...) Expand 10 before | Expand all | Expand 10 after
17104 Handle<DependentCode> codes = 17104 Handle<DependentCode> codes =
17105 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 17105 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
17106 DependentCode::kPropertyCellChangedGroup, 17106 DependentCode::kPropertyCellChangedGroup,
17107 info->object_wrapper()); 17107 info->object_wrapper());
17108 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 17108 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
17109 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 17109 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
17110 cell, info->zone()); 17110 cell, info->zone());
17111 } 17111 }
17112 17112
17113 } } // namespace v8::internal 17113 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es7/regress/regress-443982.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698