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

Side by Side Diff: src/objects.cc

Issue 1099453007: Empty Array prototype elements protection needs to alert on length change. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: With comments. Created 5 years, 8 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 | « src/isolate.cc ('k') | test/cctest/test-api.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 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 11880 matching lines...) Expand 10 before | Expand all | Expand 10 after
11891 11891
11892 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength( 11892 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength(
11893 Handle<JSObject> object, 11893 Handle<JSObject> object,
11894 int capacity, 11894 int capacity,
11895 int length, 11895 int length,
11896 SetFastElementsCapacitySmiMode smi_mode) { 11896 SetFastElementsCapacitySmiMode smi_mode) {
11897 // We should never end in here with a pixel or external array. 11897 // We should never end in here with a pixel or external array.
11898 DCHECK(!object->HasExternalArrayElements()); 11898 DCHECK(!object->HasExternalArrayElements());
11899 11899
11900 // Allocate a new fast elements backing store. 11900 // Allocate a new fast elements backing store.
11901 Isolate* isolate = object->GetIsolate();
11901 Handle<FixedArray> new_elements = 11902 Handle<FixedArray> new_elements =
11902 object->GetIsolate()->factory()->NewUninitializedFixedArray(capacity); 11903 isolate->factory()->NewUninitializedFixedArray(capacity);
11904
11905 isolate->UpdateArrayProtectorOnSetLength(object);
11903 11906
11904 ElementsKind elements_kind = object->GetElementsKind(); 11907 ElementsKind elements_kind = object->GetElementsKind();
11905 ElementsKind new_elements_kind; 11908 ElementsKind new_elements_kind;
11906 // The resized array has FAST_*_SMI_ELEMENTS if the capacity mode forces it, 11909 // The resized array has FAST_*_SMI_ELEMENTS if the capacity mode forces it,
11907 // or if it's allowed and the old elements array contained only SMIs. 11910 // or if it's allowed and the old elements array contained only SMIs.
11908 bool has_fast_smi_elements = 11911 bool has_fast_smi_elements =
11909 (smi_mode == kForceSmiElements) || 11912 (smi_mode == kForceSmiElements) ||
11910 ((smi_mode == kAllowSmiElements) && object->HasFastSmiElements()); 11913 ((smi_mode == kAllowSmiElements) && object->HasFastSmiElements());
11911 if (has_fast_smi_elements) { 11914 if (has_fast_smi_elements) {
11912 if (IsHoleyElementsKind(elements_kind)) { 11915 if (IsHoleyElementsKind(elements_kind)) {
(...skipping 5192 matching lines...) Expand 10 before | Expand all | Expand 10 after
17105 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17108 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17106 Handle<Object> new_value) { 17109 Handle<Object> new_value) {
17107 if (cell->value() != *new_value) { 17110 if (cell->value() != *new_value) {
17108 cell->set_value(*new_value); 17111 cell->set_value(*new_value);
17109 Isolate* isolate = cell->GetIsolate(); 17112 Isolate* isolate = cell->GetIsolate();
17110 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17113 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17111 isolate, DependentCode::kPropertyCellChangedGroup); 17114 isolate, DependentCode::kPropertyCellChangedGroup);
17112 } 17115 }
17113 } 17116 }
17114 } } // namespace v8::internal 17117 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698