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

Side by Side Diff: src/compiler/js-builtin-reducer.cc

Issue 2653273004: [turbofan] Ensure {CheckMaps} is not used accross mutations. (Closed)
Patch Set: Created 3 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 | « no previous file | test/mjsunit/regress/regress-crbug-685506.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/compilation-dependencies.h" 8 #include "src/compilation-dependencies.h"
9 #include "src/compiler/access-builder.h" 9 #include "src/compiler/access-builder.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Check if the {node} is dominated by a CheckMaps with a single map 114 // Check if the {node} is dominated by a CheckMaps with a single map
115 // for the {receiver}, and if so use that map for the lowering below. 115 // for the {receiver}, and if so use that map for the lowering below.
116 for (Node* dominator = effect;;) { 116 for (Node* dominator = effect;;) {
117 if (dominator->opcode() == IrOpcode::kCheckMaps && 117 if (dominator->opcode() == IrOpcode::kCheckMaps &&
118 NodeProperties::IsSame(dominator->InputAt(0), receiver)) { 118 NodeProperties::IsSame(dominator->InputAt(0), receiver)) {
119 ZoneHandleSet<Map> const& maps = 119 ZoneHandleSet<Map> const& maps =
120 CheckMapsParametersOf(dominator->op()).maps(); 120 CheckMapsParametersOf(dominator->op()).maps();
121 return (maps.size() == 1) ? MaybeHandle<Map>(maps[0]) 121 return (maps.size() == 1) ? MaybeHandle<Map>(maps[0])
122 : MaybeHandle<Map>(); 122 : MaybeHandle<Map>();
123 } 123 }
124 if (dominator->op()->EffectInputCount() != 1) { 124 DCHECK_EQ(1, dominator->op()->EffectOutputCount());
125 if (dominator->op()->EffectInputCount() != 1 ||
126 !dominator->op()->HasProperty(Operator::kNoWrite)) {
125 // Didn't find any appropriate CheckMaps node. 127 // Didn't find any appropriate CheckMaps node.
126 return MaybeHandle<Map>(); 128 return MaybeHandle<Map>();
127 } 129 }
128 dominator = NodeProperties::GetEffectInput(dominator); 130 dominator = NodeProperties::GetEffectInput(dominator);
129 } 131 }
130 } 132 }
131 133
132 // TODO(turbofan): This was copied from Crankshaft, might be too restrictive. 134 // TODO(turbofan): This was copied from Crankshaft, might be too restrictive.
133 bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) { 135 bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) {
134 DCHECK(!jsarray_map->is_dictionary_map()); 136 DCHECK(!jsarray_map->is_dictionary_map());
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 return jsgraph()->simplified(); 2172 return jsgraph()->simplified();
2171 } 2173 }
2172 2174
2173 JSOperatorBuilder* JSBuiltinReducer::javascript() const { 2175 JSOperatorBuilder* JSBuiltinReducer::javascript() const {
2174 return jsgraph()->javascript(); 2176 return jsgraph()->javascript();
2175 } 2177 }
2176 2178
2177 } // namespace compiler 2179 } // namespace compiler
2178 } // namespace internal 2180 } // namespace internal
2179 } // namespace v8 2181 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-685506.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698