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/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 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 __ StoreP(temp, g.ToMemOperand(destination), r0); | 2230 __ StoreP(temp, g.ToMemOperand(destination), r0); |
2231 } | 2231 } |
2232 } else if (source->IsConstant()) { | 2232 } else if (source->IsConstant()) { |
2233 Constant src = g.ToConstant(source); | 2233 Constant src = g.ToConstant(source); |
2234 if (destination->IsRegister() || destination->IsStackSlot()) { | 2234 if (destination->IsRegister() || destination->IsStackSlot()) { |
2235 Register dst = | 2235 Register dst = |
2236 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 2236 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
2237 switch (src.type()) { | 2237 switch (src.type()) { |
2238 case Constant::kInt32: | 2238 case Constant::kInt32: |
2239 #if V8_TARGET_ARCH_PPC64 | 2239 #if V8_TARGET_ARCH_PPC64 |
2240 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | 2240 if (RelocInfo::IsWasmSizeReference(src.rmode())) { |
2241 #else | 2241 #else |
2242 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2242 if (RelocInfo::IsWasmReference(src.rmode())) { |
2243 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || | |
2244 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | |
2245 #endif | 2243 #endif |
2246 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | 2244 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
2247 } else { | 2245 } else { |
2248 __ mov(dst, Operand(src.ToInt32())); | 2246 __ mov(dst, Operand(src.ToInt32())); |
2249 } | 2247 } |
2250 break; | 2248 break; |
2251 case Constant::kInt64: | 2249 case Constant::kInt64: |
2252 #if V8_TARGET_ARCH_PPC64 | 2250 #if V8_TARGET_ARCH_PPC64 |
2253 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2251 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
2254 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | 2252 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
2255 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | 2253 __ mov(dst, Operand(src.ToInt64(), src.rmode())); |
2256 } else { | 2254 } else { |
2257 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 2255 DCHECK(!RelocInfo::IsWasmReference(src.rmode())); |
2258 #endif | 2256 #endif |
2259 __ mov(dst, Operand(src.ToInt64())); | 2257 __ mov(dst, Operand(src.ToInt64())); |
2260 #if V8_TARGET_ARCH_PPC64 | 2258 #if V8_TARGET_ARCH_PPC64 |
2261 } | 2259 } |
2262 #endif | 2260 #endif |
2263 break; | 2261 break; |
2264 case Constant::kFloat32: | 2262 case Constant::kFloat32: |
2265 __ Move(dst, | 2263 __ Move(dst, |
2266 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 2264 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
2267 break; | 2265 break; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 padding_size -= v8::internal::Assembler::kInstrSize; | 2435 padding_size -= v8::internal::Assembler::kInstrSize; |
2438 } | 2436 } |
2439 } | 2437 } |
2440 } | 2438 } |
2441 | 2439 |
2442 #undef __ | 2440 #undef __ |
2443 | 2441 |
2444 } // namespace compiler | 2442 } // namespace compiler |
2445 } // namespace internal | 2443 } // namespace internal |
2446 } // namespace v8 | 2444 } // namespace v8 |
OLD | NEW |