| 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/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 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2335 __ StoreP(temp, g.ToMemOperand(destination)); | 2335 __ StoreP(temp, g.ToMemOperand(destination)); |
| 2336 } | 2336 } |
| 2337 } else if (source->IsConstant()) { | 2337 } else if (source->IsConstant()) { |
| 2338 Constant src = g.ToConstant(source); | 2338 Constant src = g.ToConstant(source); |
| 2339 if (destination->IsRegister() || destination->IsStackSlot()) { | 2339 if (destination->IsRegister() || destination->IsStackSlot()) { |
| 2340 Register dst = | 2340 Register dst = |
| 2341 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; | 2341 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; |
| 2342 switch (src.type()) { | 2342 switch (src.type()) { |
| 2343 case Constant::kInt32: | 2343 case Constant::kInt32: |
| 2344 #if V8_TARGET_ARCH_S390X | 2344 #if V8_TARGET_ARCH_S390X |
| 2345 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | 2345 if (RelocInfo::IsWasmSizeReference(src.rmode())) { |
| 2346 #else | 2346 #else |
| 2347 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2347 if (RelocInfo::IsWasmReference(src.rmode())) { |
| 2348 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || | |
| 2349 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { | |
| 2350 #endif | 2348 #endif |
| 2351 __ mov(dst, Operand(src.ToInt32(), src.rmode())); | 2349 __ mov(dst, Operand(src.ToInt32(), src.rmode())); |
| 2352 } else { | 2350 } else { |
| 2353 __ mov(dst, Operand(src.ToInt32())); | 2351 __ mov(dst, Operand(src.ToInt32())); |
| 2354 } | 2352 } |
| 2355 break; | 2353 break; |
| 2356 case Constant::kInt64: | 2354 case Constant::kInt64: |
| 2357 #if V8_TARGET_ARCH_S390X | 2355 #if V8_TARGET_ARCH_S390X |
| 2358 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2356 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 2359 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | 2357 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
| 2360 __ mov(dst, Operand(src.ToInt64(), src.rmode())); | 2358 __ mov(dst, Operand(src.ToInt64(), src.rmode())); |
| 2361 } else { | 2359 } else { |
| 2362 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 2360 DCHECK(!RelocInfo::IsWasmSizeReference(src.rmode())); |
| 2363 __ mov(dst, Operand(src.ToInt64())); | 2361 __ mov(dst, Operand(src.ToInt64())); |
| 2364 } | 2362 } |
| 2365 #else | 2363 #else |
| 2366 __ mov(dst, Operand(src.ToInt64())); | 2364 __ mov(dst, Operand(src.ToInt64())); |
| 2367 #endif // V8_TARGET_ARCH_S390X | 2365 #endif // V8_TARGET_ARCH_S390X |
| 2368 break; | 2366 break; |
| 2369 case Constant::kFloat32: | 2367 case Constant::kFloat32: |
| 2370 __ Move(dst, | 2368 __ Move(dst, |
| 2371 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 2369 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
| 2372 break; | 2370 break; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2542 padding_size -= 2; | 2540 padding_size -= 2; |
| 2543 } | 2541 } |
| 2544 } | 2542 } |
| 2545 } | 2543 } |
| 2546 | 2544 |
| 2547 #undef __ | 2545 #undef __ |
| 2548 | 2546 |
| 2549 } // namespace compiler | 2547 } // namespace compiler |
| 2550 } // namespace internal | 2548 } // namespace internal |
| 2551 } // namespace v8 | 2549 } // namespace v8 |
| OLD | NEW |