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

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 2216453002: [turbofan] Use CheckMaps for the COW check on elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | 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/compiler/js-native-context-specialization.h" 5 #include "src/compiler/js-native-context-specialization.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 MapList const& receiver_maps = access_info.receiver_maps(); 965 MapList const& receiver_maps = access_info.receiver_maps();
966 966
967 // Load the elements for the {receiver}. 967 // Load the elements for the {receiver}.
968 Node* elements = effect = graph()->NewNode( 968 Node* elements = effect = graph()->NewNode(
969 simplified()->LoadField(AccessBuilder::ForJSObjectElements()), receiver, 969 simplified()->LoadField(AccessBuilder::ForJSObjectElements()), receiver,
970 effect, control); 970 effect, control);
971 971
972 // Don't try to store to a copy-on-write backing store. 972 // Don't try to store to a copy-on-write backing store.
973 if (access_mode == AccessMode::kStore && 973 if (access_mode == AccessMode::kStore &&
974 IsFastSmiOrObjectElementsKind(elements_kind)) { 974 IsFastSmiOrObjectElementsKind(elements_kind)) {
975 Node* elements_map = effect = 975 effect = graph()->NewNode(
976 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), 976 simplified()->CheckMaps(1), elements,
977 elements, effect, control); 977 jsgraph()->HeapConstant(factory()->fixed_array_map()), effect, control);
978 Node* check = graph()->NewNode(
979 simplified()->ReferenceEqual(Type::Any()), elements_map,
980 jsgraph()->HeapConstant(factory()->fixed_array_map()));
981 effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
982 } 978 }
983 979
984 if (IsFixedTypedArrayElementsKind(elements_kind)) { 980 if (IsFixedTypedArrayElementsKind(elements_kind)) {
985 // Load the {receiver}s length. 981 // Load the {receiver}s length.
986 Node* length = effect = graph()->NewNode( 982 Node* length = effect = graph()->NewNode(
987 simplified()->LoadField(AccessBuilder::ForJSTypedArrayLength()), 983 simplified()->LoadField(AccessBuilder::ForJSTypedArrayLength()),
988 receiver, effect, control); 984 receiver, effect, control);
989 985
990 // Check if the {receiver}s buffer was neutered. 986 // Check if the {receiver}s buffer was neutered.
991 Node* buffer = effect = graph()->NewNode( 987 Node* buffer = effect = graph()->NewNode(
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 } 1335 }
1340 1336
1341 1337
1342 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 1338 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
1343 return jsgraph()->simplified(); 1339 return jsgraph()->simplified();
1344 } 1340 }
1345 1341
1346 } // namespace compiler 1342 } // namespace compiler
1347 } // namespace internal 1343 } // namespace internal
1348 } // namespace v8 1344 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698