| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |