Commit 2c6d0789 authored by akos.palfi's avatar akos.palfi Committed by Commit bot

MIPS: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable...

MIPS: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory size references in generated code.

Port 117a56b7

BUG=

Review-Url: https://codereview.chromium.org/1959653002
Cr-Commit-Position: refs/heads/master@{#36081}
parent aa1b7f6b
......@@ -1803,7 +1803,8 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
switch (src.type()) {
case Constant::kInt32:
if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
__ li(dst, Operand(src.ToInt32(), src.rmode()));
} else {
__ li(dst, Operand(src.ToInt32()));
......
......@@ -2069,7 +2069,11 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
switch (src.type()) {
case Constant::kInt32:
__ li(dst, Operand(src.ToInt32()));
if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
__ li(dst, Operand(src.ToInt32(), src.rmode()));
} else {
__ li(dst, Operand(src.ToInt32()));
}
break;
case Constant::kFloat32:
__ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
......@@ -2078,6 +2082,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
__ li(dst, Operand(src.ToInt64(), src.rmode()));
} else {
DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
__ li(dst, Operand(src.ToInt64()));
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment