| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 Emit(code, 1, outputs, input_count, inputs); | 148 Emit(code, 1, outputs, input_count, inputs); |
| 149 } | 149 } |
| 150 | 150 |
| 151 | 151 |
| 152 void InstructionSelector::VisitStore(Node* node) { | 152 void InstructionSelector::VisitStore(Node* node) { |
| 153 X64OperandGenerator g(this); | 153 X64OperandGenerator g(this); |
| 154 Node* base = node->InputAt(0); | 154 Node* base = node->InputAt(0); |
| 155 Node* index = node->InputAt(1); | 155 Node* index = node->InputAt(1); |
| 156 Node* value = node->InputAt(2); | 156 Node* value = node->InputAt(2); |
| 157 | 157 |
| 158 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 158 StoreRepresentation store_rep = StoreRepresentationOf(node->op()); |
| 159 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); | 159 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); |
| 160 MachineRepresentation rep = store_rep.machine_type().representation(); | 160 MachineRepresentation rep = store_rep.representation(); |
| 161 | 161 |
| 162 if (write_barrier_kind != kNoWriteBarrier) { | 162 if (write_barrier_kind != kNoWriteBarrier) { |
| 163 DCHECK_EQ(MachineRepresentation::kTagged, rep); | 163 DCHECK_EQ(MachineRepresentation::kTagged, rep); |
| 164 AddressingMode addressing_mode; | 164 AddressingMode addressing_mode; |
| 165 InstructionOperand inputs[3]; | 165 InstructionOperand inputs[3]; |
| 166 size_t input_count = 0; | 166 size_t input_count = 0; |
| 167 inputs[input_count++] = g.UseUniqueRegister(base); | 167 inputs[input_count++] = g.UseUniqueRegister(base); |
| 168 if (g.CanBeImmediate(index)) { | 168 if (g.CanBeImmediate(index)) { |
| 169 inputs[input_count++] = g.UseImmediate(index); | 169 inputs[input_count++] = g.UseImmediate(index); |
| 170 addressing_mode = kMode_MRI; | 170 addressing_mode = kMode_MRI; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 InstructionOperand length_operand = | 282 InstructionOperand length_operand = |
| 283 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); | 283 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); |
| 284 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), | 284 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer), |
| 285 g.UseRegister(offset), g.TempImmediate(0), length_operand); | 285 g.UseRegister(offset), g.TempImmediate(0), length_operand); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 void InstructionSelector::VisitCheckedStore(Node* node) { | 289 void InstructionSelector::VisitCheckedStore(Node* node) { |
| 290 MachineRepresentation rep = | 290 MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); |
| 291 CheckedStoreRepresentationOf(node->op()).representation(); | |
| 292 X64OperandGenerator g(this); | 291 X64OperandGenerator g(this); |
| 293 Node* const buffer = node->InputAt(0); | 292 Node* const buffer = node->InputAt(0); |
| 294 Node* const offset = node->InputAt(1); | 293 Node* const offset = node->InputAt(1); |
| 295 Node* const length = node->InputAt(2); | 294 Node* const length = node->InputAt(2); |
| 296 Node* const value = node->InputAt(3); | 295 Node* const value = node->InputAt(3); |
| 297 ArchOpcode opcode; | 296 ArchOpcode opcode; |
| 298 switch (rep) { | 297 switch (rep) { |
| 299 case MachineRepresentation::kWord8: | 298 case MachineRepresentation::kWord8: |
| 300 opcode = kCheckedStoreWord8; | 299 opcode = kCheckedStoreWord8; |
| 301 break; | 300 break; |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 MachineOperatorBuilder::kFloat64RoundTruncate | | 1769 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1771 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1770 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1772 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1771 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1773 } | 1772 } |
| 1774 return flags; | 1773 return flags; |
| 1775 } | 1774 } |
| 1776 | 1775 |
| 1777 } // namespace compiler | 1776 } // namespace compiler |
| 1778 } // namespace internal | 1777 } // namespace internal |
| 1779 } // namespace v8 | 1778 } // namespace v8 |
| OLD | NEW |