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/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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 __ LoadP(temp, src, r0); | 1841 __ LoadP(temp, src, r0); |
1842 __ StoreP(temp, g.ToMemOperand(destination), r0); | 1842 __ StoreP(temp, g.ToMemOperand(destination), r0); |
1843 } | 1843 } |
1844 } else if (source->IsConstant()) { | 1844 } else if (source->IsConstant()) { |
1845 Constant src = g.ToConstant(source); | 1845 Constant src = g.ToConstant(source); |
1846 if (destination->IsRegister() || destination->IsStackSlot()) { | 1846 if (destination->IsRegister() || destination->IsStackSlot()) { |
1847 Register dst = | 1847 Register dst = |
1848 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1848 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
1849 switch (src.type()) { | 1849 switch (src.type()) { |
1850 case Constant::kInt32: | 1850 case Constant::kInt32: |
1851 #if !V8_TARGET_ARCH_PPC64 | 1851 __ mov(dst, Operand(src.ToInt32())); |
1852 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | |
1853 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | |
1854 } else { | |
1855 #endif | |
1856 __ mov(dst, Operand(src.ToInt32())); | |
1857 #if !V8_TARGET_ARCH_PPC64 | |
1858 } | |
1859 #endif | |
1860 break; | 1852 break; |
1861 case Constant::kInt64: | 1853 case Constant::kInt64: |
1862 #if V8_TARGET_ARCH_PPC64 | 1854 __ mov(dst, Operand(src.ToInt64())); |
1863 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | |
1864 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | |
1865 } else { | |
1866 #endif | |
1867 __ mov(dst, Operand(src.ToInt64())); | |
1868 #if V8_TARGET_ARCH_PPC64 | |
1869 } | |
1870 #endif | |
1871 break; | 1855 break; |
1872 case Constant::kFloat32: | 1856 case Constant::kFloat32: |
1873 __ Move(dst, | 1857 __ Move(dst, |
1874 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1858 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1875 break; | 1859 break; |
1876 case Constant::kFloat64: | 1860 case Constant::kFloat64: |
1877 __ Move(dst, | 1861 __ Move(dst, |
1878 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1862 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
1879 break; | 1863 break; |
1880 case Constant::kExternalReference: | 1864 case Constant::kExternalReference: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 padding_size -= v8::internal::Assembler::kInstrSize; | 2021 padding_size -= v8::internal::Assembler::kInstrSize; |
2038 } | 2022 } |
2039 } | 2023 } |
2040 } | 2024 } |
2041 | 2025 |
2042 #undef __ | 2026 #undef __ |
2043 | 2027 |
2044 } // namespace compiler | 2028 } // namespace compiler |
2045 } // namespace internal | 2029 } // namespace internal |
2046 } // namespace v8 | 2030 } // namespace v8 |
OLD | NEW |