| 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/compilation-info.h" | 7 #include "src/compilation-info.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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 int32_t constant_summand = i.InputInt32(1); | 1863 int32_t constant_summand = i.InputInt32(1); |
| 1864 if (constant_summand > 0) { | 1864 if (constant_summand > 0) { |
| 1865 __ add(i.OutputRegister(), Immediate(constant_summand)); | 1865 __ add(i.OutputRegister(), Immediate(constant_summand)); |
| 1866 } else if (constant_summand < 0) { | 1866 } else if (constant_summand < 0) { |
| 1867 __ sub(i.OutputRegister(), Immediate(-constant_summand)); | 1867 __ sub(i.OutputRegister(), Immediate(-constant_summand)); |
| 1868 } | 1868 } |
| 1869 } else if (mode == kMode_MR1) { | 1869 } else if (mode == kMode_MR1) { |
| 1870 if (i.InputRegister(1).is(i.OutputRegister())) { | 1870 if (i.InputRegister(1).is(i.OutputRegister())) { |
| 1871 __ shl(i.OutputRegister(), 1); | 1871 __ shl(i.OutputRegister(), 1); |
| 1872 } else { | 1872 } else { |
| 1873 __ lea(i.OutputRegister(), i.MemoryOperand()); | 1873 __ add(i.OutputRegister(), i.InputRegister(1)); |
| 1874 } | 1874 } |
| 1875 } else if (mode == kMode_M2) { | 1875 } else if (mode == kMode_M2) { |
| 1876 __ shl(i.OutputRegister(), 1); | 1876 __ shl(i.OutputRegister(), 1); |
| 1877 } else if (mode == kMode_M4) { | 1877 } else if (mode == kMode_M4) { |
| 1878 __ shl(i.OutputRegister(), 2); | 1878 __ shl(i.OutputRegister(), 2); |
| 1879 } else if (mode == kMode_M8) { | 1879 } else if (mode == kMode_M8) { |
| 1880 __ shl(i.OutputRegister(), 3); | 1880 __ shl(i.OutputRegister(), 3); |
| 1881 } else { | 1881 } else { |
| 1882 __ lea(i.OutputRegister(), i.MemoryOperand()); | 1882 __ lea(i.OutputRegister(), i.MemoryOperand()); |
| 1883 } | 1883 } |
| 1884 } else if (mode == kMode_MR1 && |
| 1885 i.InputRegister(1).is(i.OutputRegister())) { |
| 1886 __ add(i.OutputRegister(), i.InputRegister(0)); |
| 1884 } else { | 1887 } else { |
| 1885 __ lea(i.OutputRegister(), i.MemoryOperand()); | 1888 __ lea(i.OutputRegister(), i.MemoryOperand()); |
| 1886 } | 1889 } |
| 1887 break; | 1890 break; |
| 1888 } | 1891 } |
| 1889 case kX87Push: | 1892 case kX87Push: |
| 1890 if (instr->InputAt(0)->IsFPRegister()) { | 1893 if (instr->InputAt(0)->IsFPRegister()) { |
| 1891 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); | 1894 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); |
| 1892 if (allocated.representation() == MachineRepresentation::kFloat32) { | 1895 if (allocated.representation() == MachineRepresentation::kFloat32) { |
| 1893 __ sub(esp, Immediate(kFloatSize)); | 1896 __ sub(esp, Immediate(kFloatSize)); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2714 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2717 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2715 __ Nop(padding_size); | 2718 __ Nop(padding_size); |
| 2716 } | 2719 } |
| 2717 } | 2720 } |
| 2718 | 2721 |
| 2719 #undef __ | 2722 #undef __ |
| 2720 | 2723 |
| 2721 } // namespace compiler | 2724 } // namespace compiler |
| 2722 } // namespace internal | 2725 } // namespace internal |
| 2723 } // namespace v8 | 2726 } // namespace v8 |
| OLD | NEW |