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 11885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11896 | 11896 |
11897 | 11897 |
11898 // static | 11898 // static |
11899 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { | 11899 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { |
11900 DCHECK(capacity >= 0); | 11900 DCHECK(capacity >= 0); |
11901 array->GetIsolate()->factory()->NewJSArrayStorage( | 11901 array->GetIsolate()->factory()->NewJSArrayStorage( |
11902 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); | 11902 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
11903 } | 11903 } |
11904 | 11904 |
11905 | 11905 |
11906 void JSArray::Expand(Handle<JSArray> array, int required_size) { | |
11907 ElementsAccessor* accessor = array->GetElementsAccessor(); | |
11908 accessor->SetCapacityAndLength(array, required_size, required_size); | |
11909 } | |
11910 | |
11911 | |
11912 // Returns false if the passed-in index is marked non-configurable, which will | 11906 // Returns false if the passed-in index is marked non-configurable, which will |
11913 // cause the truncation operation to halt, and thus no further old values need | 11907 // cause the truncation operation to halt, and thus no further old values need |
11914 // be collected. | 11908 // be collected. |
11915 static bool GetOldValue(Isolate* isolate, | 11909 static bool GetOldValue(Isolate* isolate, |
11916 Handle<JSObject> object, | 11910 Handle<JSObject> object, |
11917 uint32_t index, | 11911 uint32_t index, |
11918 List<Handle<Object> >* old_values, | 11912 List<Handle<Object> >* old_values, |
11919 List<uint32_t>* indices) { | 11913 List<uint32_t>* indices) { |
11920 LookupIterator it(isolate, object, index, LookupIterator::HIDDEN); | 11914 LookupIterator it(isolate, object, index, LookupIterator::HIDDEN); |
11921 CHECK(JSReceiver::GetPropertyAttributes(&it).IsJust()); | 11915 CHECK(JSReceiver::GetPropertyAttributes(&it).IsJust()); |
(...skipping 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16657 Handle<Object> new_value) { | 16651 Handle<Object> new_value) { |
16658 if (cell->value() != *new_value) { | 16652 if (cell->value() != *new_value) { |
16659 cell->set_value(*new_value); | 16653 cell->set_value(*new_value); |
16660 Isolate* isolate = cell->GetIsolate(); | 16654 Isolate* isolate = cell->GetIsolate(); |
16661 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16655 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16662 isolate, DependentCode::kPropertyCellChangedGroup); | 16656 isolate, DependentCode::kPropertyCellChangedGroup); |
16663 } | 16657 } |
16664 } | 16658 } |
16665 } // namespace internal | 16659 } // namespace internal |
16666 } // namespace v8 | 16660 } // namespace v8 |
OLD | NEW |