Commit 6156aecd authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[mips][wasm-c-api] Fix offset when calling WasmCapiFunction

In WasmCapiCallWrappers, the address is passed in a register instead
of as an immediate, so we reduced 3 instructions to load the address
to t9;

before: lui + ori + dsll + ori;
after: mov;

Port: 54d84cf3

Bug: v8:11774
Change-Id: I423e54216ff65f1c12128c2b26443e1838b68003
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2914771
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#74720}
parent f4135ff5
......@@ -778,7 +778,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
bool isWasmCapiFunction =
linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
// from start_call to return address.
int offset = __ root_array_available() ? 68 : 80;
int offset = __ root_array_available() ? 64 : 88;
#endif // V8_ENABLE_WEBASSEMBLY
#if V8_HOST_ARCH_MIPS
if (FLAG_debug_code) {
......
......@@ -743,7 +743,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
bool isWasmCapiFunction =
linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
// from start_call to return address.
int offset = __ root_array_available() ? 76 : 88;
int offset = __ root_array_available() ? 64 : 112;
#endif // V8_ENABLE_WEBASSEMBLY
#if V8_HOST_ARCH_MIPS64
if (FLAG_debug_code) {
......
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