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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 2069 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
2070 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2070 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2071 } | 2071 } |
2072 | 2072 |
2073 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 2073 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { |
2074 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 2074 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( |
2075 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); | 2075 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
2076 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2076 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2077 } | 2077 } |
2078 | 2078 |
2079 void InstructionSelector::VisitTrapIf(Node* node) { | 2079 void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) { |
2080 FlagsContinuation cont = FlagsContinuation::ForTrap( | 2080 FlagsContinuation cont = |
2081 kNotEqual, OpParameter<Runtime::FunctionId>(node->op()), | 2081 FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1)); |
2082 node->InputAt(1)); | |
2083 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2082 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2084 } | 2083 } |
2085 | 2084 |
2086 void InstructionSelector::VisitTrapUnless(Node* node) { | 2085 void InstructionSelector::VisitTrapUnless(Node* node, |
2087 FlagsContinuation cont = FlagsContinuation::ForTrap( | 2086 Runtime::FunctionId func_id) { |
2088 kEqual, OpParameter<Runtime::FunctionId>(node->op()), node->InputAt(1)); | 2087 FlagsContinuation cont = |
| 2088 FlagsContinuation::ForTrap(kEqual, func_id, node->InputAt(1)); |
2089 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2089 VisitWordCompareZero(this, node, node->InputAt(0), &cont); |
2090 } | 2090 } |
2091 | 2091 |
2092 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { | 2092 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { |
2093 X64OperandGenerator g(this); | 2093 X64OperandGenerator g(this); |
2094 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); | 2094 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); |
2095 | 2095 |
2096 // Emit either ArchTableSwitch or ArchLookupSwitch. | 2096 // Emit either ArchTableSwitch or ArchLookupSwitch. |
2097 size_t table_space_cost = 4 + sw.value_range; | 2097 size_t table_space_cost = 4 + sw.value_range; |
2098 size_t table_time_cost = 3; | 2098 size_t table_time_cost = 3; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 // static | 2451 // static |
2452 MachineOperatorBuilder::AlignmentRequirements | 2452 MachineOperatorBuilder::AlignmentRequirements |
2453 InstructionSelector::AlignmentRequirements() { | 2453 InstructionSelector::AlignmentRequirements() { |
2454 return MachineOperatorBuilder::AlignmentRequirements:: | 2454 return MachineOperatorBuilder::AlignmentRequirements:: |
2455 FullUnalignedAccessSupport(); | 2455 FullUnalignedAccessSupport(); |
2456 } | 2456 } |
2457 | 2457 |
2458 } // namespace compiler | 2458 } // namespace compiler |
2459 } // namespace internal | 2459 } // namespace internal |
2460 } // namespace v8 | 2460 } // namespace v8 |
OLD | NEW |