Chromium Code Reviews| 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/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1857 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) { | 1857 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) { |
| 1858 opcode = word32_op; | 1858 opcode = word32_op; |
| 1859 } else { | 1859 } else { |
| 1860 UNREACHABLE(); | 1860 UNREACHABLE(); |
| 1861 return; | 1861 return; |
| 1862 } | 1862 } |
| 1863 InstructionOperand outputs[1]; | 1863 InstructionOperand outputs[1]; |
| 1864 AddressingMode addressing_mode; | 1864 AddressingMode addressing_mode; |
| 1865 InstructionOperand inputs[3]; | 1865 InstructionOperand inputs[3]; |
| 1866 size_t input_count = 0; | 1866 size_t input_count = 0; |
| 1867 if (type == MachineType::Int8() || type == MachineType::Uint8()) { | 1867 inputs[input_count++] = g.UseUniqueRegister(value); |
| 1868 inputs[input_count++] = g.UseByteRegister(value); | |
| 1869 } else { | |
| 1870 inputs[input_count++] = g.UseUniqueRegister(value); | |
| 1871 } | |
| 1872 inputs[input_count++] = g.UseUniqueRegister(base); | 1868 inputs[input_count++] = g.UseUniqueRegister(base); |
| 1873 if (g.CanBeImmediate(index)) { | 1869 if (g.CanBeImmediate(index)) { |
| 1874 inputs[input_count++] = g.UseImmediate(index); | 1870 inputs[input_count++] = g.UseImmediate(index); |
| 1875 addressing_mode = kMode_MRI; | 1871 addressing_mode = kMode_MRI; |
| 1876 } else { | 1872 } else { |
| 1877 inputs[input_count++] = g.UseUniqueRegister(index); | 1873 inputs[input_count++] = g.UseUniqueRegister(index); |
| 1878 addressing_mode = kMode_MR1; | 1874 addressing_mode = kMode_MR1; |
| 1879 } | 1875 } |
| 1880 outputs[0] = g.DefineAsFixed(node, eax); | 1876 outputs[0] = g.DefineAsFixed(node, eax); |
| 1881 InstructionOperand temp[1]; | 1877 InstructionOperand temp[1]; |
| 1882 temp[0] = g.TempRegister(); | 1878 temp[0] = g.UseByteRegister(node); |
|
aseemgarg
2017/04/11 23:11:50
Although this is correct, it might be better to fo
binji
2017/04/11 23:49:12
Done.
| |
| 1883 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1879 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 1884 Emit(code, 1, outputs, input_count, inputs, 1, temp); | 1880 Emit(code, 1, outputs, input_count, inputs, 1, temp); |
| 1885 } | 1881 } |
| 1886 | 1882 |
| 1887 #define VISIT_ATOMIC_BINOP(op) \ | 1883 #define VISIT_ATOMIC_BINOP(op) \ |
| 1888 void InstructionSelector::VisitAtomic##op(Node* node) { \ | 1884 void InstructionSelector::VisitAtomic##op(Node* node) { \ |
| 1889 VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \ | 1885 VisitAtomicBinaryOperation(node, kAtomic##op##Int8, kAtomic##op##Uint8, \ |
| 1890 kAtomic##op##Int16, kAtomic##op##Uint16, \ | 1886 kAtomic##op##Int16, kAtomic##op##Uint16, \ |
| 1891 kAtomic##op##Word32); \ | 1887 kAtomic##op##Word32); \ |
| 1892 } | 1888 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1949 // static | 1945 // static |
| 1950 MachineOperatorBuilder::AlignmentRequirements | 1946 MachineOperatorBuilder::AlignmentRequirements |
| 1951 InstructionSelector::AlignmentRequirements() { | 1947 InstructionSelector::AlignmentRequirements() { |
| 1952 return MachineOperatorBuilder::AlignmentRequirements:: | 1948 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1953 FullUnalignedAccessSupport(); | 1949 FullUnalignedAccessSupport(); |
| 1954 } | 1950 } |
| 1955 | 1951 |
| 1956 } // namespace compiler | 1952 } // namespace compiler |
| 1957 } // namespace internal | 1953 } // namespace internal |
| 1958 } // namespace v8 | 1954 } // namespace v8 |
| OLD | NEW |