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 #include "src/ppc/frames-ppc.h" | 9 #include "src/ppc/frames-ppc.h" |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 size_t output_count = 0; | 127 size_t output_count = 0; |
128 | 128 |
129 inputs[input_count++] = g.UseRegister(m.left().node()); | 129 inputs[input_count++] = g.UseRegister(m.left().node()); |
130 inputs[input_count++] = g.UseOperand(m.right().node(), operand_mode); | 130 inputs[input_count++] = g.UseOperand(m.right().node(), operand_mode); |
131 | 131 |
132 if (cont->IsBranch()) { | 132 if (cont->IsBranch()) { |
133 inputs[input_count++] = g.Label(cont->true_block()); | 133 inputs[input_count++] = g.Label(cont->true_block()); |
134 inputs[input_count++] = g.Label(cont->false_block()); | 134 inputs[input_count++] = g.Label(cont->false_block()); |
135 } | 135 } |
136 | 136 |
137 outputs[output_count++] = g.DefineAsRegister(node); | 137 if (cont->IsDeoptimize()) { |
| 138 // If we can deoptimize as a result of the binop, we need to make sure that |
| 139 // the deopt inputs are not overwritten by the binop result. One way |
| 140 // to achieve that is to declare the output register as same-as-first. |
| 141 outputs[output_count++] = g.DefineSameAsFirst(node); |
| 142 } else { |
| 143 outputs[output_count++] = g.DefineAsRegister(node); |
| 144 } |
138 if (cont->IsSet()) { | 145 if (cont->IsSet()) { |
139 outputs[output_count++] = g.DefineAsRegister(cont->result()); | 146 outputs[output_count++] = g.DefineAsRegister(cont->result()); |
140 } | 147 } |
141 | 148 |
142 DCHECK_NE(0u, input_count); | 149 DCHECK_NE(0u, input_count); |
143 DCHECK_NE(0u, output_count); | 150 DCHECK_NE(0u, output_count); |
144 DCHECK_GE(arraysize(inputs), input_count); | 151 DCHECK_GE(arraysize(inputs), input_count); |
145 DCHECK_GE(arraysize(outputs), output_count); | 152 DCHECK_GE(arraysize(outputs), output_count); |
146 | 153 |
147 opcode = cont->Encode(opcode); | 154 opcode = cont->Encode(opcode); |
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 // static | 2021 // static |
2015 MachineOperatorBuilder::AlignmentRequirements | 2022 MachineOperatorBuilder::AlignmentRequirements |
2016 InstructionSelector::AlignmentRequirements() { | 2023 InstructionSelector::AlignmentRequirements() { |
2017 return MachineOperatorBuilder::AlignmentRequirements:: | 2024 return MachineOperatorBuilder::AlignmentRequirements:: |
2018 FullUnalignedAccessSupport(); | 2025 FullUnalignedAccessSupport(); |
2019 } | 2026 } |
2020 | 2027 |
2021 } // namespace compiler | 2028 } // namespace compiler |
2022 } // namespace internal | 2029 } // namespace internal |
2023 } // namespace v8 | 2030 } // namespace v8 |
OLD | NEW |