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

Side by Side Diff: src/objects.cc

Issue 1702623002: [runtime] Don't cache the holder_map_ in the LookupIterator, it's faster. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698