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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 Emit(code, 1, outputs, input_count, inputs); | 206 Emit(code, 1, outputs, input_count, inputs); |
207 } | 207 } |
208 | 208 |
209 | 209 |
210 void InstructionSelector::VisitStore(Node* node) { | 210 void InstructionSelector::VisitStore(Node* node) { |
211 IA32OperandGenerator g(this); | 211 IA32OperandGenerator g(this); |
212 Node* base = node->InputAt(0); | 212 Node* base = node->InputAt(0); |
213 Node* index = node->InputAt(1); | 213 Node* index = node->InputAt(1); |
214 Node* value = node->InputAt(2); | 214 Node* value = node->InputAt(2); |
215 | 215 |
216 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 216 StoreRepresentation store_rep = StoreRepresentationOf(node->op()); |
217 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); | 217 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); |
218 MachineRepresentation rep = store_rep.machine_type().representation(); | 218 MachineRepresentation rep = store_rep.representation(); |
219 | 219 |
220 if (write_barrier_kind != kNoWriteBarrier) { | 220 if (write_barrier_kind != kNoWriteBarrier) { |
221 DCHECK_EQ(MachineRepresentation::kTagged, rep); | 221 DCHECK_EQ(MachineRepresentation::kTagged, rep); |
222 AddressingMode addressing_mode; | 222 AddressingMode addressing_mode; |
223 InstructionOperand inputs[3]; | 223 InstructionOperand inputs[3]; |
224 size_t input_count = 0; | 224 size_t input_count = 0; |
225 inputs[input_count++] = g.UseUniqueRegister(base); | 225 inputs[input_count++] = g.UseUniqueRegister(base); |
226 if (g.CanBeImmediate(index)) { | 226 if (g.CanBeImmediate(index)) { |
227 inputs[input_count++] = g.UseImmediate(index); | 227 inputs[input_count++] = g.UseImmediate(index); |
228 addressing_mode = kMode_MRI; | 228 addressing_mode = kMode_MRI; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 offset_operand, g.UseImmediate(buffer)); | 337 offset_operand, g.UseImmediate(buffer)); |
338 } else { | 338 } else { |
339 Emit(opcode | AddressingModeField::encode(kMode_MR1), | 339 Emit(opcode | AddressingModeField::encode(kMode_MR1), |
340 g.DefineAsRegister(node), offset_operand, length_operand, | 340 g.DefineAsRegister(node), offset_operand, length_operand, |
341 g.UseRegister(buffer), offset_operand); | 341 g.UseRegister(buffer), offset_operand); |
342 } | 342 } |
343 } | 343 } |
344 | 344 |
345 | 345 |
346 void InstructionSelector::VisitCheckedStore(Node* node) { | 346 void InstructionSelector::VisitCheckedStore(Node* node) { |
347 MachineRepresentation rep = | 347 MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); |
348 CheckedStoreRepresentationOf(node->op()).representation(); | |
349 IA32OperandGenerator g(this); | 348 IA32OperandGenerator g(this); |
350 Node* const buffer = node->InputAt(0); | 349 Node* const buffer = node->InputAt(0); |
351 Node* const offset = node->InputAt(1); | 350 Node* const offset = node->InputAt(1); |
352 Node* const length = node->InputAt(2); | 351 Node* const length = node->InputAt(2); |
353 Node* const value = node->InputAt(3); | 352 Node* const value = node->InputAt(3); |
354 ArchOpcode opcode; | 353 ArchOpcode opcode; |
355 switch (rep) { | 354 switch (rep) { |
356 case MachineRepresentation::kWord8: | 355 case MachineRepresentation::kWord8: |
357 opcode = kCheckedStoreWord8; | 356 opcode = kCheckedStoreWord8; |
358 break; | 357 break; |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 MachineOperatorBuilder::kFloat64RoundTruncate | | 1312 MachineOperatorBuilder::kFloat64RoundTruncate | |
1314 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1313 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1315 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1314 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1316 } | 1315 } |
1317 return flags; | 1316 return flags; |
1318 } | 1317 } |
1319 | 1318 |
1320 } // namespace compiler | 1319 } // namespace compiler |
1321 } // namespace internal | 1320 } // namespace internal |
1322 } // namespace v8 | 1321 } // namespace v8 |
OLD | NEW |