| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2451 case Constant::kInt32: { | 2451 case Constant::kInt32: { |
| 2452 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2452 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 2453 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | 2453 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
| 2454 __ movq(dst, src.ToInt64(), src.rmode()); | 2454 __ movq(dst, src.ToInt64(), src.rmode()); |
| 2455 } else { | 2455 } else { |
| 2456 // TODO(dcarney): don't need scratch in this case. | 2456 // TODO(dcarney): don't need scratch in this case. |
| 2457 int32_t value = src.ToInt32(); | 2457 int32_t value = src.ToInt32(); |
| 2458 if (value == 0) { | 2458 if (value == 0) { |
| 2459 __ xorl(dst, dst); | 2459 __ xorl(dst, dst); |
| 2460 } else { | 2460 } else { |
| 2461 __ movl(dst, Immediate(value)); | 2461 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { |
| 2462 __ movl(dst, Immediate(value, src.rmode())); |
| 2463 } else { |
| 2464 __ movl(dst, Immediate(value)); |
| 2465 } |
| 2462 } | 2466 } |
| 2463 } | 2467 } |
| 2464 break; | 2468 break; |
| 2465 } | 2469 } |
| 2466 case Constant::kInt64: | 2470 case Constant::kInt64: |
| 2467 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || | 2471 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || |
| 2468 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { | 2472 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { |
| 2469 __ movq(dst, src.ToInt64(), src.rmode()); | 2473 __ movq(dst, src.ToInt64(), src.rmode()); |
| 2470 } else { | 2474 } else { |
| 2471 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); | 2475 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2670 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2674 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2671 __ Nop(padding_size); | 2675 __ Nop(padding_size); |
| 2672 } | 2676 } |
| 2673 } | 2677 } |
| 2674 | 2678 |
| 2675 #undef __ | 2679 #undef __ |
| 2676 | 2680 |
| 2677 } // namespace compiler | 2681 } // namespace compiler |
| 2678 } // namespace internal | 2682 } // namespace internal |
| 2679 } // namespace v8 | 2683 } // namespace v8 |
| OLD | NEW |