| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 |
| 181 void InstructionSelector::VisitStore(Node* node) { | 181 void InstructionSelector::VisitStore(Node* node) { |
| 182 Mips64OperandGenerator g(this); | 182 Mips64OperandGenerator g(this); |
| 183 Node* base = node->InputAt(0); | 183 Node* base = node->InputAt(0); |
| 184 Node* index = node->InputAt(1); | 184 Node* index = node->InputAt(1); |
| 185 Node* value = node->InputAt(2); | 185 Node* value = node->InputAt(2); |
| 186 | 186 |
| 187 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 187 StoreRepresentation store_rep = StoreRepresentationOf(node->op()); |
| 188 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); | 188 WriteBarrierKind write_barrier_kind = store_rep.write_barrier_kind(); |
| 189 MachineRepresentation rep = store_rep.machine_type().representation(); | 189 MachineRepresentation rep = store_rep.representation(); |
| 190 | 190 |
| 191 // TODO(mips): I guess this could be done in a better way. | 191 // TODO(mips): I guess this could be done in a better way. |
| 192 if (write_barrier_kind != kNoWriteBarrier) { | 192 if (write_barrier_kind != kNoWriteBarrier) { |
| 193 DCHECK_EQ(MachineRepresentation::kTagged, rep); | 193 DCHECK_EQ(MachineRepresentation::kTagged, rep); |
| 194 InstructionOperand inputs[3]; | 194 InstructionOperand inputs[3]; |
| 195 size_t input_count = 0; | 195 size_t input_count = 0; |
| 196 inputs[input_count++] = g.UseUniqueRegister(base); | 196 inputs[input_count++] = g.UseUniqueRegister(base); |
| 197 inputs[input_count++] = g.UseUniqueRegister(index); | 197 inputs[input_count++] = g.UseUniqueRegister(index); |
| 198 inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) | 198 inputs[input_count++] = (write_barrier_kind == kMapWriteBarrier) |
| 199 ? g.UseRegister(value) | 199 ? g.UseRegister(value) |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 : g.UseRegister(length) | 1276 : g.UseRegister(length) |
| 1277 : g.UseRegister(length); | 1277 : g.UseRegister(length); |
| 1278 | 1278 |
| 1279 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1279 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
| 1280 g.DefineAsRegister(node), offset_operand, length_operand, | 1280 g.DefineAsRegister(node), offset_operand, length_operand, |
| 1281 g.UseRegister(buffer)); | 1281 g.UseRegister(buffer)); |
| 1282 } | 1282 } |
| 1283 | 1283 |
| 1284 | 1284 |
| 1285 void InstructionSelector::VisitCheckedStore(Node* node) { | 1285 void InstructionSelector::VisitCheckedStore(Node* node) { |
| 1286 MachineRepresentation rep = | 1286 MachineRepresentation rep = CheckedStoreRepresentationOf(node->op()); |
| 1287 CheckedStoreRepresentationOf(node->op()).representation(); | |
| 1288 Mips64OperandGenerator g(this); | 1287 Mips64OperandGenerator g(this); |
| 1289 Node* const buffer = node->InputAt(0); | 1288 Node* const buffer = node->InputAt(0); |
| 1290 Node* const offset = node->InputAt(1); | 1289 Node* const offset = node->InputAt(1); |
| 1291 Node* const length = node->InputAt(2); | 1290 Node* const length = node->InputAt(2); |
| 1292 Node* const value = node->InputAt(3); | 1291 Node* const value = node->InputAt(3); |
| 1293 ArchOpcode opcode; | 1292 ArchOpcode opcode; |
| 1294 switch (rep) { | 1293 switch (rep) { |
| 1295 case MachineRepresentation::kWord8: | 1294 case MachineRepresentation::kWord8: |
| 1296 opcode = kCheckedStoreWord8; | 1295 opcode = kCheckedStoreWord8; |
| 1297 break; | 1296 break; |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 MachineOperatorBuilder::kFloat32RoundUp | | 1786 MachineOperatorBuilder::kFloat32RoundUp | |
| 1788 MachineOperatorBuilder::kFloat64RoundTruncate | | 1787 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1789 MachineOperatorBuilder::kFloat32RoundTruncate | | 1788 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 1790 MachineOperatorBuilder::kFloat64RoundTiesEven | | 1789 MachineOperatorBuilder::kFloat64RoundTiesEven | |
| 1791 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1790 MachineOperatorBuilder::kFloat32RoundTiesEven; |
| 1792 } | 1791 } |
| 1793 | 1792 |
| 1794 } // namespace compiler | 1793 } // namespace compiler |
| 1795 } // namespace internal | 1794 } // namespace internal |
| 1796 } // namespace v8 | 1795 } // namespace v8 |
| OLD | NEW |