Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 2277443009: Populate relocation information correctly for RelocatableInt32Constants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + fix serializer test flakiness Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698