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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 | 1156 |
1157 SimplifiedLowering::SimplifiedLowering(JSGraph* jsgraph, Zone* zone, | 1157 SimplifiedLowering::SimplifiedLowering(JSGraph* jsgraph, Zone* zone, |
1158 SourcePositionTable* source_positions) | 1158 SourcePositionTable* source_positions) |
1159 : jsgraph_(jsgraph), | 1159 : jsgraph_(jsgraph), |
1160 zone_(zone), | 1160 zone_(zone), |
1161 zero_thirtyone_range_(Type::Range(0, 31, zone)), | 1161 zero_thirtyone_range_(Type::Range(0, 31, zone)), |
1162 source_positions_(source_positions) {} | 1162 source_positions_(source_positions) {} |
1163 | 1163 |
1164 | 1164 |
1165 void SimplifiedLowering::LowerAllNodes() { | 1165 void SimplifiedLowering::LowerAllNodes() { |
1166 SimplifiedOperatorBuilder simplified(graph()->zone()); | 1166 RepresentationChanger changer(jsgraph(), jsgraph()->simplified(), |
1167 RepresentationChanger changer(jsgraph(), &simplified, jsgraph()->isolate()); | 1167 jsgraph()->isolate()); |
1168 RepresentationSelector selector(jsgraph(), zone_, &changer, | 1168 RepresentationSelector selector(jsgraph(), zone_, &changer, |
1169 source_positions_); | 1169 source_positions_); |
1170 selector.Run(this); | 1170 selector.Run(this); |
1171 } | 1171 } |
1172 | 1172 |
1173 | 1173 |
1174 Node* SimplifiedLowering::Untag(Node* node) { | 1174 Node* SimplifiedLowering::Untag(Node* node) { |
1175 // TODO(titzer): factor this out to a TaggingScheme abstraction. | 1175 // TODO(titzer): factor this out to a TaggingScheme abstraction. |
1176 Node* shift_amount = jsgraph()->Int32Constant(kSmiTagSize + kSmiShiftSize); | 1176 Node* shift_amount = jsgraph()->Int32Constant(kSmiTagSize + kSmiShiftSize); |
1177 return graph()->NewNode(machine()->WordSar(), node, shift_amount); | 1177 return graph()->NewNode(machine()->WordSar(), node, shift_amount); |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 ReplaceEffectUses(node, comparison); | 1685 ReplaceEffectUses(node, comparison); |
1686 node->ReplaceInput(0, comparison); | 1686 node->ReplaceInput(0, comparison); |
1687 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1687 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1688 node->TrimInputCount(2); | 1688 node->TrimInputCount(2); |
1689 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); | 1689 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); |
1690 } | 1690 } |
1691 | 1691 |
1692 } // namespace compiler | 1692 } // namespace compiler |
1693 } // namespace internal | 1693 } // namespace internal |
1694 } // namespace v8 | 1694 } // namespace v8 |
OLD | NEW |