Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/objects.cc

Issue 1234553002: Reload the map of typed arrays after performing ToNumber. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/lookup.cc ('k') | test/mjsunit/regress/regress-507980.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3274 matching lines...) Expand 10 before | Expand all | Expand 10 after
3285 if (is_observed) maybe_old = it->GetDataValue(); 3285 if (is_observed) maybe_old = it->GetDataValue();
3286 3286
3287 Handle<Object> to_assign = value; 3287 Handle<Object> to_assign = value;
3288 // Convert the incoming value to a number for storing into typed arrays. 3288 // Convert the incoming value to a number for storing into typed arrays.
3289 if (it->IsElement() && (receiver->HasExternalArrayElements() || 3289 if (it->IsElement() && (receiver->HasExternalArrayElements() ||
3290 receiver->HasFixedTypedArrayElements())) { 3290 receiver->HasFixedTypedArrayElements())) {
3291 if (!value->IsNumber() && !value->IsUndefined()) { 3291 if (!value->IsNumber() && !value->IsUndefined()) {
3292 ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), to_assign, 3292 ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), to_assign,
3293 Execution::ToNumber(it->isolate(), value), 3293 Execution::ToNumber(it->isolate(), value),
3294 Object); 3294 Object);
3295 // ToNumber above might modify the receiver, causing the cached
3296 // holder_map to mismatch the actual holder->map() after this point.
3297 // Reload the map to be in consistent state. Other cached state cannot
3298 // have been invalidated since typed array elements cannot be reconfigured
3299 // in any way.
3300 it->ReloadHolderMap();
3295 } 3301 }
3296 } 3302 }
3297 3303
3298 // Possibly migrate to the most up-to-date map that will be able to store 3304 // Possibly migrate to the most up-to-date map that will be able to store
3299 // |value| under it->name(). 3305 // |value| under it->name().
3300 it->PrepareForDataProperty(to_assign); 3306 it->PrepareForDataProperty(to_assign);
3301 3307
3302 // Write the property value. 3308 // Write the property value.
3303 it->WriteDataValue(to_assign); 3309 it->WriteDataValue(to_assign);
3304 3310
(...skipping 12821 matching lines...) Expand 10 before | Expand all | Expand 10 after
16126 Handle<Object> new_value) { 16132 Handle<Object> new_value) {
16127 if (cell->value() != *new_value) { 16133 if (cell->value() != *new_value) {
16128 cell->set_value(*new_value); 16134 cell->set_value(*new_value);
16129 Isolate* isolate = cell->GetIsolate(); 16135 Isolate* isolate = cell->GetIsolate();
16130 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16136 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16131 isolate, DependentCode::kPropertyCellChangedGroup); 16137 isolate, DependentCode::kPropertyCellChangedGroup);
16132 } 16138 }
16133 } 16139 }
16134 } // namespace internal 16140 } // namespace internal
16135 } // namespace v8 16141 } // namespace v8
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | test/mjsunit/regress/regress-507980.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698