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 12314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12325 void JSObject::ValidateElements(Handle<JSObject> object) { | 12325 void JSObject::ValidateElements(Handle<JSObject> object) { |
12326 #ifdef ENABLE_SLOW_DCHECKS | 12326 #ifdef ENABLE_SLOW_DCHECKS |
12327 if (FLAG_enable_slow_asserts) { | 12327 if (FLAG_enable_slow_asserts) { |
12328 ElementsAccessor* accessor = object->GetElementsAccessor(); | 12328 ElementsAccessor* accessor = object->GetElementsAccessor(); |
12329 accessor->Validate(object); | 12329 accessor->Validate(object); |
12330 } | 12330 } |
12331 #endif | 12331 #endif |
12332 } | 12332 } |
12333 | 12333 |
12334 | 12334 |
12335 // static | |
12336 MaybeHandle<Object> JSReceiver::SetElement(Handle<JSReceiver> object, | |
12337 uint32_t index, Handle<Object> value, | |
12338 LanguageMode language_mode) { | |
12339 Isolate* isolate = object->GetIsolate(); | |
12340 LookupIterator it(isolate, object, index); | |
12341 return SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED); | |
12342 } | |
12343 | |
12344 | |
12345 static bool ShouldConvertToSlowElements(JSObject* object, uint32_t capacity, | 12335 static bool ShouldConvertToSlowElements(JSObject* object, uint32_t capacity, |
12346 uint32_t index, | 12336 uint32_t index, |
12347 uint32_t* new_capacity) { | 12337 uint32_t* new_capacity) { |
12348 STATIC_ASSERT(JSObject::kMaxUncheckedOldFastElementsLength <= | 12338 STATIC_ASSERT(JSObject::kMaxUncheckedOldFastElementsLength <= |
12349 JSObject::kMaxUncheckedFastElementsLength); | 12339 JSObject::kMaxUncheckedFastElementsLength); |
12350 if (index < capacity) { | 12340 if (index < capacity) { |
12351 *new_capacity = capacity; | 12341 *new_capacity = capacity; |
12352 return false; | 12342 return false; |
12353 } | 12343 } |
12354 if (index - capacity >= JSObject::kMaxGap) return true; | 12344 if (index - capacity >= JSObject::kMaxGap) return true; |
(...skipping 3777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16132 Handle<Object> new_value) { | 16122 Handle<Object> new_value) { |
16133 if (cell->value() != *new_value) { | 16123 if (cell->value() != *new_value) { |
16134 cell->set_value(*new_value); | 16124 cell->set_value(*new_value); |
16135 Isolate* isolate = cell->GetIsolate(); | 16125 Isolate* isolate = cell->GetIsolate(); |
16136 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16126 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16137 isolate, DependentCode::kPropertyCellChangedGroup); | 16127 isolate, DependentCode::kPropertyCellChangedGroup); |
16138 } | 16128 } |
16139 } | 16129 } |
16140 } // namespace internal | 16130 } // namespace internal |
16141 } // namespace v8 | 16131 } // namespace v8 |
OLD | NEW |