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

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

Issue 2416543002: [wasm] Fix bounds check for zero initial memory. (Closed)
Patch Set: Created 4 years, 2 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
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 4d63e9ad8355479b6f2f95d2351b9b91df14acf5..a005944f20fb232883393b889c92f7476347ebbe 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -42,7 +42,7 @@ class X64OperandConverter : public InstructionOperandConverter {
return Immediate(0);
}
if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
- constant.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE ||
+ RelocInfo::IsWasmMemorySizeReference(constant.rmode()) ||
constant.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) {
return Immediate(constant.ToInt32(), constant.rmode());
}
@@ -2507,7 +2507,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
if (value == 0) {
__ xorl(dst, dst);
} else {
- if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
+ if (RelocInfo::IsWasmMemorySizeReference(src.rmode())) {
__ movl(dst, Immediate(value, src.rmode()));
} else {
__ movl(dst, Immediate(value));
@@ -2521,7 +2521,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) {
__ movq(dst, src.ToInt64(), src.rmode());
} else {
- DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
+ DCHECK(!RelocInfo::IsWasmMemorySizeReference(src.rmode()));
__ Set(dst, src.ToInt64());
}
break;

Powered by Google App Engine
This is Rietveld 408576698