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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 | 344 |
345 void InstructionSelector::VisitStore(Node* node) { | 345 void InstructionSelector::VisitStore(Node* node) { |
346 ArmOperandGenerator g(this); | 346 ArmOperandGenerator g(this); |
347 Node* base = node->InputAt(0); | 347 Node* base = node->InputAt(0); |
348 Node* index = node->InputAt(1); | 348 Node* index = node->InputAt(1); |
349 Node* value = node->InputAt(2); | 349 Node* value = node->InputAt(2); |
350 | 350 |
351 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 351 StoreRepresentation store_rep = StoreRepresentationOf(node->op()); |
352 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); | 352 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); |
353 MachineRepresentation rep = store_rep.machine_type().representation(); | 353 MachineRepresentation rep = store_rep.representation(); |
354 | 354 |
355 if (write_barrier_kind != kNoWriteBarrier) { | 355 if (write_barrier_kind != kNoWriteBarrier) { |
356 DCHECK_EQ(MachineRepresentation::kTagged, rep); | 356 DCHECK_EQ(MachineRepresentation::kTagged, rep); |
357 InstructionOperand inputs[3]; | 357 InstructionOperand inputs[3]; |
358 size_t input_count = 0; | 358 size_t input_count = 0; |
359 inputs[input_count++] = g.UseUniqueRegister(base); | 359 inputs[input_count++] = g.UseUniqueRegister(base); |
360 inputs[input_count++] = g.UseUniqueRegister(index); | 360 inputs[input_count++] = g.UseUniqueRegister(index); |
361 inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) | 361 inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) |
362 ? g.UseRegister(value) | 362 ? g.UseRegister(value) |
363 : g.UseUniqueRegister(value); | 363 : g.UseUniqueRegister(value); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) | 448 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) |
449 ? g.UseImmediate(length) | 449 ? g.UseImmediate(length) |
450 : g.UseRegister(length); | 450 : g.UseRegister(length); |
451 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), | 451 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), |
452 g.DefineAsRegister(node), offset_operand, length_operand, | 452 g.DefineAsRegister(node), offset_operand, length_operand, |
453 g.UseRegister(buffer), offset_operand); | 453 g.UseRegister(buffer), offset_operand); |
454 } | 454 } |
455 | 455 |
456 | 456 |
457 void InstructionSelector::VisitCheckedStore(Node* node) { | 457 void InstructionSelector::VisitCheckedStore(Node* node) { |
458 MachineRepresentation rep = | 458 MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); |
459 CheckedStoreRepresentationOf(node->op()).representation(); | |
460 ArmOperandGenerator g(this); | 459 ArmOperandGenerator g(this); |
461 Node* const buffer = node->InputAt(0); | 460 Node* const buffer = node->InputAt(0); |
462 Node* const offset = node->InputAt(1); | 461 Node* const offset = node->InputAt(1); |
463 Node* const length = node->InputAt(2); | 462 Node* const length = node->InputAt(2); |
464 Node* const value = node->InputAt(3); | 463 Node* const value = node->InputAt(3); |
465 ArchOpcode opcode; | 464 ArchOpcode opcode; |
466 switch (rep) { | 465 switch (rep) { |
467 case MachineRepresentation::kWord8: | 466 case MachineRepresentation::kWord8: |
468 opcode = kCheckedStoreWord8; | 467 opcode = kCheckedStoreWord8; |
469 break; | 468 break; |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1592 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1594 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1593 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1595 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1594 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1596 } | 1595 } |
1597 return flags; | 1596 return flags; |
1598 } | 1597 } |
1599 | 1598 |
1600 } // namespace compiler | 1599 } // namespace compiler |
1601 } // namespace internal | 1600 } // namespace internal |
1602 } // namespace v8 | 1601 } // namespace v8 |
OLD | NEW |