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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler-intrinsics.h" | 7 #include "src/compiler-intrinsics.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 | 299 |
300 static void VisitBinop(InstructionSelector* selector, Node* node, | 300 static void VisitBinop(InstructionSelector* selector, Node* node, |
301 InstructionCode opcode, InstructionCode reverse_opcode) { | 301 InstructionCode opcode, InstructionCode reverse_opcode) { |
302 FlagsContinuation cont; | 302 FlagsContinuation cont; |
303 VisitBinop(selector, node, opcode, reverse_opcode, &cont); | 303 VisitBinop(selector, node, opcode, reverse_opcode, &cont); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 void InstructionSelector::VisitLoad(Node* node) { | 307 void InstructionSelector::VisitLoad(Node* node) { |
308 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); | 308 MachineType rep = OpParameter<MachineType>(node); |
309 ArmOperandGenerator g(this); | 309 ArmOperandGenerator g(this); |
310 Node* base = node->InputAt(0); | 310 Node* base = node->InputAt(0); |
311 Node* index = node->InputAt(1); | 311 Node* index = node->InputAt(1); |
312 | 312 |
313 InstructionOperand* result = rep == kMachineFloat64 | 313 InstructionOperand* result = rep == kMachineFloat64 |
314 ? g.DefineAsDoubleRegister(node) | 314 ? g.DefineAsDoubleRegister(node) |
315 : g.DefineAsRegister(node); | 315 : g.DefineAsRegister(node); |
316 | 316 |
317 ArchOpcode opcode; | 317 ArchOpcode opcode; |
318 switch (rep) { | 318 switch (rep) { |
(...skipping 28 matching lines...) Expand all Loading... |
347 } | 347 } |
348 | 348 |
349 | 349 |
350 void InstructionSelector::VisitStore(Node* node) { | 350 void InstructionSelector::VisitStore(Node* node) { |
351 ArmOperandGenerator g(this); | 351 ArmOperandGenerator g(this); |
352 Node* base = node->InputAt(0); | 352 Node* base = node->InputAt(0); |
353 Node* index = node->InputAt(1); | 353 Node* index = node->InputAt(1); |
354 Node* value = node->InputAt(2); | 354 Node* value = node->InputAt(2); |
355 | 355 |
356 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 356 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); |
357 MachineRepresentation rep = store_rep.rep; | 357 MachineType rep = store_rep.rep; |
358 if (store_rep.write_barrier_kind == kFullWriteBarrier) { | 358 if (store_rep.write_barrier_kind == kFullWriteBarrier) { |
359 DCHECK(rep == kMachineTagged); | 359 DCHECK(rep == kMachineTagged); |
360 // TODO(dcarney): refactor RecordWrite function to take temp registers | 360 // TODO(dcarney): refactor RecordWrite function to take temp registers |
361 // and pass them here instead of using fixed regs | 361 // and pass them here instead of using fixed regs |
362 // TODO(dcarney): handle immediate indices. | 362 // TODO(dcarney): handle immediate indices. |
363 InstructionOperand* temps[] = {g.TempRegister(r5), g.TempRegister(r6)}; | 363 InstructionOperand* temps[] = {g.TempRegister(r5), g.TempRegister(r6)}; |
364 Emit(kArmStoreWriteBarrier, NULL, g.UseFixed(base, r4), | 364 Emit(kArmStoreWriteBarrier, NULL, g.UseFixed(base, r4), |
365 g.UseFixed(index, r5), g.UseFixed(value, r6), ARRAY_SIZE(temps), | 365 g.UseFixed(index, r5), g.UseFixed(value, r6), ARRAY_SIZE(temps), |
366 temps); | 366 temps); |
367 return; | 367 return; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 DCHECK(cont->IsSet()); | 934 DCHECK(cont->IsSet()); |
935 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 935 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), |
936 g.UseDoubleRegister(m.left().node()), | 936 g.UseDoubleRegister(m.left().node()), |
937 g.UseDoubleRegister(m.right().node())); | 937 g.UseDoubleRegister(m.right().node())); |
938 } | 938 } |
939 } | 939 } |
940 | 940 |
941 } // namespace compiler | 941 } // namespace compiler |
942 } // namespace internal | 942 } // namespace internal |
943 } // namespace v8 | 943 } // namespace v8 |
OLD | NEW |