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

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix uninitialized variable causing msan failure Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index d9c5d60fb9b06f16431adb208cb648e4ec4da32f..30b0f9dce62343a590dd93225800537e24460013 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2078,17 +2078,25 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
: kScratchRegister;
switch (src.type()) {
case Constant::kInt32: {
- // TODO(dcarney): don't need scratch in this case.
- int32_t value = src.ToInt32();
- if (value == 0) {
- __ xorl(dst, dst);
+ if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
+ __ movq(dst, src.ToInt64(), src.rmode());
} else {
- __ movl(dst, Immediate(value));
+ // TODO(dcarney): don't need scratch in this case.
+ int32_t value = src.ToInt32();
+ if (value == 0) {
+ __ xorl(dst, dst);
+ } else {
+ __ movl(dst, Immediate(value));
+ }
}
break;
}
case Constant::kInt64:
- __ Set(dst, src.ToInt64());
+ if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
+ __ movq(dst, src.ToInt64(), src.rmode());
+ } else {
+ __ Set(dst, src.ToInt64());
+ }
break;
case Constant::kFloat32:
__ Move(dst,
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698