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 12000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |