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 RepresentationChanger changer(jsgraph(), jsgraph()->simplified(), | 1166 RepresentationChanger changer(jsgraph(), jsgraph()->isolate()); |
1167 jsgraph()->isolate()); | |
1168 RepresentationSelector selector(jsgraph(), zone_, &changer, | 1167 RepresentationSelector selector(jsgraph(), zone_, &changer, |
1169 source_positions_); | 1168 source_positions_); |
1170 selector.Run(this); | 1169 selector.Run(this); |
1171 } | 1170 } |
1172 | 1171 |
1173 | 1172 |
1174 Node* SimplifiedLowering::Untag(Node* node) { | 1173 Node* SimplifiedLowering::Untag(Node* node) { |
1175 // TODO(titzer): factor this out to a TaggingScheme abstraction. | 1174 // TODO(titzer): factor this out to a TaggingScheme abstraction. |
1176 Node* shift_amount = jsgraph()->Int32Constant(kSmiTagSize + kSmiShiftSize); | 1175 Node* shift_amount = jsgraph()->Int32Constant(kSmiTagSize + kSmiShiftSize); |
1177 return graph()->NewNode(machine()->WordSar(), node, shift_amount); | 1176 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); | 1684 ReplaceEffectUses(node, comparison); |
1686 node->ReplaceInput(0, comparison); | 1685 node->ReplaceInput(0, comparison); |
1687 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1686 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1688 node->TrimInputCount(2); | 1687 node->TrimInputCount(2); |
1689 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); | 1688 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); |
1690 } | 1689 } |
1691 | 1690 |
1692 } // namespace compiler | 1691 } // namespace compiler |
1693 } // namespace internal | 1692 } // namespace internal |
1694 } // namespace v8 | 1693 } // namespace v8 |
OLD | NEW |