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