| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 __ shr_cl(i.OutputOperand()); | 673 __ shr_cl(i.OutputOperand()); |
| 674 } | 674 } |
| 675 break; | 675 break; |
| 676 case kIA32Sar: | 676 case kIA32Sar: |
| 677 if (HasImmediateInput(instr, 1)) { | 677 if (HasImmediateInput(instr, 1)) { |
| 678 __ sar(i.OutputOperand(), i.InputInt5(1)); | 678 __ sar(i.OutputOperand(), i.InputInt5(1)); |
| 679 } else { | 679 } else { |
| 680 __ sar_cl(i.OutputOperand()); | 680 __ sar_cl(i.OutputOperand()); |
| 681 } | 681 } |
| 682 break; | 682 break; |
| 683 case kIA32AddPair: { |
| 684 // i.OutputRegister(0) == i.InputRegister(0) ... left low word. |
| 685 // i.InputRegister(1) ... left high word. |
| 686 // i.InputRegister(2) ... right low word. |
| 687 // i.InputRegister(3) ... right high word. |
| 688 bool use_temp = false; |
| 689 if (i.OutputRegister(0).code() == i.InputRegister(1).code() || |
| 690 i.OutputRegister(0).code() == i.InputRegister(3).code()) { |
| 691 // We cannot write to the output register directly, because it would |
| 692 // overwrite an input for adc. We have to use the temp register. |
| 693 use_temp = true; |
| 694 __ Move(i.TempRegister(0), i.InputRegister(0)); |
| 695 __ add(i.TempRegister(0), i.InputRegister(2)); |
| 696 } else { |
| 697 __ add(i.OutputRegister(0), i.InputRegister(2)); |
| 698 } |
| 699 __ adc(i.InputRegister(1), Operand(i.InputRegister(3))); |
| 700 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { |
| 701 __ Move(i.OutputRegister(1), i.InputRegister(1)); |
| 702 } |
| 703 if (use_temp) { |
| 704 __ Move(i.OutputRegister(0), i.TempRegister(0)); |
| 705 } |
| 706 break; |
| 707 } |
| 683 case kIA32ShlPair: | 708 case kIA32ShlPair: |
| 684 if (HasImmediateInput(instr, 2)) { | 709 if (HasImmediateInput(instr, 2)) { |
| 685 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); | 710 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); |
| 686 } else { | 711 } else { |
| 687 // Shift has been loaded into CL by the register allocator. | 712 // Shift has been loaded into CL by the register allocator. |
| 688 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); | 713 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); |
| 689 } | 714 } |
| 690 break; | 715 break; |
| 691 case kIA32ShrPair: | 716 case kIA32ShrPair: |
| 692 if (HasImmediateInput(instr, 2)) { | 717 if (HasImmediateInput(instr, 2)) { |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1852 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 1828 __ Nop(padding_size); | 1853 __ Nop(padding_size); |
| 1829 } | 1854 } |
| 1830 } | 1855 } |
| 1831 | 1856 |
| 1832 #undef __ | 1857 #undef __ |
| 1833 | 1858 |
| 1834 } // namespace compiler | 1859 } // namespace compiler |
| 1835 } // namespace internal | 1860 } // namespace internal |
| 1836 } // namespace v8 | 1861 } // namespace v8 |
| OLD | NEW |