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/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 g.UseFixed(node->InputAt(0), eax), | 431 g.UseFixed(node->InputAt(0), eax), |
432 g.UseUnique(node->InputAt(1)), temp_count, temps); | 432 g.UseUnique(node->InputAt(1)), temp_count, temps); |
433 } | 433 } |
434 | 434 |
435 | 435 |
436 void InstructionSelector::VisitInt32Div(Node* node) { | 436 void InstructionSelector::VisitInt32Div(Node* node) { |
437 VisitDiv(this, node, kIA32Idiv); | 437 VisitDiv(this, node, kIA32Idiv); |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 void InstructionSelector::VisitInt32UDiv(Node* node) { | 441 void InstructionSelector::VisitUint32Div(Node* node) { |
442 VisitDiv(this, node, kIA32Udiv); | 442 VisitDiv(this, node, kIA32Udiv); |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 static inline void VisitMod(InstructionSelector* selector, Node* node, | 446 static inline void VisitMod(InstructionSelector* selector, Node* node, |
447 ArchOpcode opcode) { | 447 ArchOpcode opcode) { |
448 IA32OperandGenerator g(selector); | 448 IA32OperandGenerator g(selector); |
449 InstructionOperand* temps[] = {g.TempRegister(eax), g.TempRegister(edx)}; | 449 InstructionOperand* temps[] = {g.TempRegister(eax), g.TempRegister(edx)}; |
450 size_t temp_count = arraysize(temps); | 450 size_t temp_count = arraysize(temps); |
451 selector->Emit(opcode, g.DefineAsFixed(node, edx), | 451 selector->Emit(opcode, g.DefineAsFixed(node, edx), |
452 g.UseFixed(node->InputAt(0), eax), | 452 g.UseFixed(node->InputAt(0), eax), |
453 g.UseUnique(node->InputAt(1)), temp_count, temps); | 453 g.UseUnique(node->InputAt(1)), temp_count, temps); |
454 } | 454 } |
455 | 455 |
456 | 456 |
457 void InstructionSelector::VisitInt32Mod(Node* node) { | 457 void InstructionSelector::VisitInt32Mod(Node* node) { |
458 VisitMod(this, node, kIA32Idiv); | 458 VisitMod(this, node, kIA32Idiv); |
459 } | 459 } |
460 | 460 |
461 | 461 |
462 void InstructionSelector::VisitInt32UMod(Node* node) { | 462 void InstructionSelector::VisitUint32Mod(Node* node) { |
463 VisitMod(this, node, kIA32Udiv); | 463 VisitMod(this, node, kIA32Udiv); |
464 } | 464 } |
465 | 465 |
466 | 466 |
467 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { | 467 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { |
468 IA32OperandGenerator g(this); | 468 IA32OperandGenerator g(this); |
469 // TODO(turbofan): IA32 SSE conversions should take an operand. | 469 // TODO(turbofan): IA32 SSE conversions should take an operand. |
470 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); | 470 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
471 } | 471 } |
472 | 472 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 call_instr->MarkAsCall(); | 676 call_instr->MarkAsCall(); |
677 if (deoptimization != NULL) { | 677 if (deoptimization != NULL) { |
678 DCHECK(continuation != NULL); | 678 DCHECK(continuation != NULL); |
679 call_instr->MarkAsControl(); | 679 call_instr->MarkAsControl(); |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
683 } // namespace compiler | 683 } // namespace compiler |
684 } // namespace internal | 684 } // namespace internal |
685 } // namespace v8 | 685 } // namespace v8 |
OLD | NEW |