OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |