| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 4414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4425 !it->isolate()->IsInternallyUsedPropertyName(it->name())); | 4425 !it->isolate()->IsInternallyUsedPropertyName(it->name())); |
| 4426 MaybeHandle<Object> maybe_old; | 4426 MaybeHandle<Object> maybe_old; |
| 4427 if (is_observed) maybe_old = it->GetDataValue(); | 4427 if (is_observed) maybe_old = it->GetDataValue(); |
| 4428 | 4428 |
| 4429 Handle<Object> to_assign = value; | 4429 Handle<Object> to_assign = value; |
| 4430 // Convert the incoming value to a number for storing into typed arrays. | 4430 // Convert the incoming value to a number for storing into typed arrays. |
| 4431 if (it->IsElement() && receiver->HasFixedTypedArrayElements()) { | 4431 if (it->IsElement() && receiver->HasFixedTypedArrayElements()) { |
| 4432 if (!value->IsNumber() && !value->IsUndefined()) { | 4432 if (!value->IsNumber() && !value->IsUndefined()) { |
| 4433 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 4433 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 4434 it->isolate(), to_assign, Object::ToNumber(value), Nothing<bool>()); | 4434 it->isolate(), to_assign, Object::ToNumber(value), Nothing<bool>()); |
| 4435 // ToNumber above might modify the receiver, causing the cached | |
| 4436 // holder_map to mismatch the actual holder->map() after this point. | |
| 4437 // Reload the map to be in consistent state. Other cached state cannot | |
| 4438 // have been invalidated since typed array elements cannot be reconfigured | |
| 4439 // in any way. | |
| 4440 it->ReloadHolderMap(); | |
| 4441 | |
| 4442 // We have to recheck the length. However, it can only change if the | 4435 // We have to recheck the length. However, it can only change if the |
| 4443 // underlying buffer was neutered, so just check that. | 4436 // underlying buffer was neutered, so just check that. |
| 4444 if (Handle<JSArrayBufferView>::cast(receiver)->WasNeutered()) { | 4437 if (Handle<JSArrayBufferView>::cast(receiver)->WasNeutered()) { |
| 4445 return Just(true); | 4438 return Just(true); |
| 4446 // TODO(neis): According to the spec, this should throw a TypeError. | 4439 // TODO(neis): According to the spec, this should throw a TypeError. |
| 4447 } | 4440 } |
| 4448 } | 4441 } |
| 4449 } | 4442 } |
| 4450 | 4443 |
| 4451 // Possibly migrate to the most up-to-date map that will be able to store | 4444 // Possibly migrate to the most up-to-date map that will be able to store |
| (...skipping 15468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19920 if (cell->value() != *new_value) { | 19913 if (cell->value() != *new_value) { |
| 19921 cell->set_value(*new_value); | 19914 cell->set_value(*new_value); |
| 19922 Isolate* isolate = cell->GetIsolate(); | 19915 Isolate* isolate = cell->GetIsolate(); |
| 19923 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19916 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19924 isolate, DependentCode::kPropertyCellChangedGroup); | 19917 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19925 } | 19918 } |
| 19926 } | 19919 } |
| 19927 | 19920 |
| 19928 } // namespace internal | 19921 } // namespace internal |
| 19929 } // namespace v8 | 19922 } // namespace v8 |
| OLD | NEW |