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/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2318 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 2318 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
2319 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2319 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2320 } | 2320 } |
2321 | 2321 |
2322 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 2322 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { |
2323 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 2323 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( |
2324 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 2324 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
2325 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2325 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2326 } | 2326 } |
2327 | 2327 |
| 2328 void InstructionSelector::VisitTrapIf(Node* node) { UNREACHABLE(); } |
| 2329 |
| 2330 void InstructionSelector::VisitTrapUnless(Node* node) { UNREACHABLE(); } |
| 2331 |
2328 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { | 2332 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { |
2329 Mips64OperandGenerator g(this); | 2333 Mips64OperandGenerator g(this); |
2330 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); | 2334 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); |
2331 | 2335 |
2332 // Emit either ArchTableSwitch or ArchLookupSwitch. | 2336 // Emit either ArchTableSwitch or ArchLookupSwitch. |
2333 size_t table_space_cost = 10 + 2 * sw.value_range; | 2337 size_t table_space_cost = 10 + 2 * sw.value_range; |
2334 size_t table_time_cost = 3; | 2338 size_t table_time_cost = 3; |
2335 size_t lookup_space_cost = 2 + 2 * sw.case_count; | 2339 size_t lookup_space_cost = 2 + 2 * sw.case_count; |
2336 size_t lookup_time_cost = sw.case_count; | 2340 size_t lookup_time_cost = sw.case_count; |
2337 if (sw.case_count > 0 && | 2341 if (sw.case_count > 0 && |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 } else { | 2648 } else { |
2645 DCHECK(kArchVariant == kMips64r2); | 2649 DCHECK(kArchVariant == kMips64r2); |
2646 return MachineOperatorBuilder::AlignmentRequirements:: | 2650 return MachineOperatorBuilder::AlignmentRequirements:: |
2647 NoUnalignedAccessSupport(); | 2651 NoUnalignedAccessSupport(); |
2648 } | 2652 } |
2649 } | 2653 } |
2650 | 2654 |
2651 } // namespace compiler | 2655 } // namespace compiler |
2652 } // namespace internal | 2656 } // namespace internal |
2653 } // namespace v8 | 2657 } // namespace v8 |
OLD | NEW |