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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 ProcessRemainingInputs(node, 2); | 1103 ProcessRemainingInputs(node, 2); |
1104 SetOutput(node, rep); | 1104 SetOutput(node, rep); |
1105 break; | 1105 break; |
1106 } | 1106 } |
1107 case IrOpcode::kStore: { | 1107 case IrOpcode::kStore: { |
1108 // TODO(jarin) Eventually, we should get rid of all machine stores | 1108 // TODO(jarin) Eventually, we should get rid of all machine stores |
1109 // from the high-level phases, then this becomes UNREACHABLE. | 1109 // from the high-level phases, then this becomes UNREACHABLE. |
1110 StoreRepresentation rep = StoreRepresentationOf(node->op()); | 1110 StoreRepresentation rep = StoreRepresentationOf(node->op()); |
1111 ProcessInput(node, 0, UseInfo::AnyTagged()); // tagged pointer | 1111 ProcessInput(node, 0, UseInfo::AnyTagged()); // tagged pointer |
1112 ProcessInput(node, 1, UseInfo::PointerInt()); // index | 1112 ProcessInput(node, 1, UseInfo::PointerInt()); // index |
1113 ProcessInput(node, 2, TruncatingUseInfoFromRepresentation( | 1113 ProcessInput(node, 2, |
1114 rep.machine_type().representation())); | 1114 TruncatingUseInfoFromRepresentation(rep.representation())); |
1115 ProcessRemainingInputs(node, 3); | 1115 ProcessRemainingInputs(node, 3); |
1116 SetOutput(node, MachineType::None()); | 1116 SetOutput(node, MachineType::None()); |
1117 break; | 1117 break; |
1118 } | 1118 } |
1119 case IrOpcode::kWord32Shr: | 1119 case IrOpcode::kWord32Shr: |
1120 // We output unsigned int32 for shift right because JavaScript. | 1120 // We output unsigned int32 for shift right because JavaScript. |
1121 return VisitBinop(node, UseInfo::TruncatingWord32(), | 1121 return VisitBinop(node, UseInfo::TruncatingWord32(), |
1122 MachineType::Uint32()); | 1122 MachineType::Uint32()); |
1123 case IrOpcode::kWord32And: | 1123 case IrOpcode::kWord32And: |
1124 case IrOpcode::kWord32Or: | 1124 case IrOpcode::kWord32Or: |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 NodeProperties::ChangeOp(node, | 1403 NodeProperties::ChangeOp(node, |
1404 common()->Phi(output_type.representation(), 2)); | 1404 common()->Phi(output_type.representation(), 2)); |
1405 } else { | 1405 } else { |
1406 NodeProperties::ChangeOp(node, machine()->CheckedLoad(type)); | 1406 NodeProperties::ChangeOp(node, machine()->CheckedLoad(type)); |
1407 } | 1407 } |
1408 } | 1408 } |
1409 | 1409 |
1410 | 1410 |
1411 void SimplifiedLowering::DoStoreBuffer(Node* node) { | 1411 void SimplifiedLowering::DoStoreBuffer(Node* node) { |
1412 DCHECK_EQ(IrOpcode::kStoreBuffer, node->opcode()); | 1412 DCHECK_EQ(IrOpcode::kStoreBuffer, node->opcode()); |
1413 MachineType const type = BufferAccessOf(node->op()).machine_type(); | 1413 MachineRepresentation const rep = |
1414 NodeProperties::ChangeOp(node, machine()->CheckedStore(type)); | 1414 BufferAccessOf(node->op()).machine_type().representation(); |
| 1415 NodeProperties::ChangeOp(node, machine()->CheckedStore(rep)); |
1415 } | 1416 } |
1416 | 1417 |
1417 | 1418 |
1418 void SimplifiedLowering::DoObjectIsNumber(Node* node) { | 1419 void SimplifiedLowering::DoObjectIsNumber(Node* node) { |
1419 Node* input = NodeProperties::GetValueInput(node, 0); | 1420 Node* input = NodeProperties::GetValueInput(node, 0); |
1420 // TODO(bmeurer): Optimize somewhat based on input type. | 1421 // TODO(bmeurer): Optimize somewhat based on input type. |
1421 Node* check = | 1422 Node* check = |
1422 graph()->NewNode(machine()->WordEqual(), | 1423 graph()->NewNode(machine()->WordEqual(), |
1423 graph()->NewNode(machine()->WordAnd(), input, | 1424 graph()->NewNode(machine()->WordAnd(), input, |
1424 jsgraph()->IntPtrConstant(kSmiTagMask)), | 1425 jsgraph()->IntPtrConstant(kSmiTagMask)), |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 ReplaceEffectUses(node, comparison); | 1772 ReplaceEffectUses(node, comparison); |
1772 node->ReplaceInput(0, comparison); | 1773 node->ReplaceInput(0, comparison); |
1773 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1774 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1774 node->TrimInputCount(2); | 1775 node->TrimInputCount(2); |
1775 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); | 1776 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); |
1776 } | 1777 } |
1777 | 1778 |
1778 } // namespace compiler | 1779 } // namespace compiler |
1779 } // namespace internal | 1780 } // namespace internal |
1780 } // namespace v8 | 1781 } // namespace v8 |
OLD | NEW |