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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 1494 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
1495 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 1495 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
1496 } | 1496 } |
1497 | 1497 |
1498 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 1498 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { |
1499 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 1499 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( |
1500 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 1500 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
1501 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 1501 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
1502 } | 1502 } |
1503 | 1503 |
| 1504 void InstructionSelector::VisitTrapIf(Node* node) { UNREACHABLE(); } |
| 1505 |
| 1506 void InstructionSelector::VisitTrapUnless(Node* node) { UNREACHABLE(); } |
| 1507 |
1504 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { | 1508 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { |
1505 IA32OperandGenerator g(this); | 1509 IA32OperandGenerator g(this); |
1506 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); | 1510 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); |
1507 | 1511 |
1508 // Emit either ArchTableSwitch or ArchLookupSwitch. | 1512 // Emit either ArchTableSwitch or ArchLookupSwitch. |
1509 size_t table_space_cost = 4 + sw.value_range; | 1513 size_t table_space_cost = 4 + sw.value_range; |
1510 size_t table_time_cost = 3; | 1514 size_t table_time_cost = 3; |
1511 size_t lookup_space_cost = 3 + 2 * sw.case_count; | 1515 size_t lookup_space_cost = 3 + 2 * sw.case_count; |
1512 size_t lookup_time_cost = sw.case_count; | 1516 size_t lookup_time_cost = sw.case_count; |
1513 if (sw.case_count > 4 && | 1517 if (sw.case_count > 4 && |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 // static | 1751 // static |
1748 MachineOperatorBuilder::AlignmentRequirements | 1752 MachineOperatorBuilder::AlignmentRequirements |
1749 InstructionSelector::AlignmentRequirements() { | 1753 InstructionSelector::AlignmentRequirements() { |
1750 return MachineOperatorBuilder::AlignmentRequirements:: | 1754 return MachineOperatorBuilder::AlignmentRequirements:: |
1751 FullUnalignedAccessSupport(); | 1755 FullUnalignedAccessSupport(); |
1752 } | 1756 } |
1753 | 1757 |
1754 } // namespace compiler | 1758 } // namespace compiler |
1755 } // namespace internal | 1759 } // namespace internal |
1756 } // namespace v8 | 1760 } // namespace v8 |
OLD | NEW |