OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 __ LoadP(temp, src, r0); | 1930 __ LoadP(temp, src, r0); |
1931 __ StoreP(temp, g.ToMemOperand(destination)); | 1931 __ StoreP(temp, g.ToMemOperand(destination)); |
1932 } | 1932 } |
1933 } else if (source->IsConstant()) { | 1933 } else if (source->IsConstant()) { |
1934 Constant src = g.ToConstant(source); | 1934 Constant src = g.ToConstant(source); |
1935 if (destination->IsRegister() || destination->IsStackSlot()) { | 1935 if (destination->IsRegister() || destination->IsStackSlot()) { |
1936 Register dst = | 1936 Register dst = |
1937 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 1937 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
1938 switch (src.type()) { | 1938 switch (src.type()) { |
1939 case Constant::kInt32: | 1939 case Constant::kInt32: |
1940 #if !V8_TARGET_ARCH_S390X | 1940 #if V8_TARGET_ARCH_S390X |
1941 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | 1941 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 1942 #else |
| 1943 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 1944 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 1945 #endif |
1942 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | 1946 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
1943 } else { | 1947 } else { |
1944 __ mov(dst, Operand(src.ToInt32())); | 1948 __ mov(dst, Operand(src.ToInt32())); |
1945 } | 1949 } |
1946 #else | |
1947 __ mov(dst, Operand(src.ToInt32())); | |
1948 #endif // V8_TARGET_ARCH_S390X | |
1949 break; | 1950 break; |
1950 case Constant::kInt64: | 1951 case Constant::kInt64: |
1951 #if V8_TARGET_ARCH_S390X | 1952 #if V8_TARGET_ARCH_S390X |
1952 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { | 1953 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { |
1953 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | 1954 __ mov(dst, Operand(src.ToInt64(), src.rmode())); |
1954 } else { | 1955 } else { |
| 1956 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
1955 __ mov(dst, Operand(src.ToInt64())); | 1957 __ mov(dst, Operand(src.ToInt64())); |
1956 } | 1958 } |
1957 #else | 1959 #else |
1958 __ mov(dst, Operand(src.ToInt64())); | 1960 __ mov(dst, Operand(src.ToInt64())); |
1959 #endif // V8_TARGET_ARCH_S390X | 1961 #endif // V8_TARGET_ARCH_S390X |
1960 break; | 1962 break; |
1961 case Constant::kFloat32: | 1963 case Constant::kFloat32: |
1962 __ Move(dst, | 1964 __ Move(dst, |
1963 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1965 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1964 break; | 1966 break; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 padding_size -= 2; | 2123 padding_size -= 2; |
2122 } | 2124 } |
2123 } | 2125 } |
2124 } | 2126 } |
2125 | 2127 |
2126 #undef __ | 2128 #undef __ |
2127 | 2129 |
2128 } // namespace compiler | 2130 } // namespace compiler |
2129 } // namespace internal | 2131 } // namespace internal |
2130 } // namespace v8 | 2132 } // namespace v8 |
OLD | NEW |