Skip to content

Commit

Permalink
[JSC] x64 CCall returnValueGPR is not in m_validGPRs
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=253227
rdar://106127760

Reviewed by Mark Lam.

x64's returnValueGPR is not in m_validGPRs. So we cannot bind it to Location.
We should move it to argumentGPR0 if returnValueGPR is not argumentGPR0, this is kind of a hack and we should
change emitCCall in the future to make it more barebone like DFG's callOperation.

* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::emitCCall):

Canonical link: https://commits.webkit.org/261048@main
  • Loading branch information
Constellation committed Mar 2, 2023
1 parent 9800cc8 commit adae6f1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6868,13 +6868,22 @@ class BBQJIT {
case TypeKind::Array:
case TypeKind::Struct:
case TypeKind::Func: {
resultLocation = Location::fromGPR(GPRInfo::returnValueGPR);
resultLocation = Location::fromGPR(GPRInfo::argumentGPR0);
if constexpr (GPRInfo::argumentGPR0 != GPRInfo::returnValueGPR) {
ASSERT(m_dataScratchGPR == GPRInfo::returnValueGPR);
m_jit.move(GPRInfo::returnValueGPR, GPRInfo::argumentGPR0);
}
break;
}
case TypeKind::F32:
case TypeKind::F64:
case TypeKind::F64: {
resultLocation = Location::fromFPR(FPRInfo::returnValueFPR);
ASSERT(m_validFPRs.contains(FPRInfo::returnValueFPR, Width::Width128));
break;
}
case TypeKind::V128: {
resultLocation = Location::fromFPR(FPRInfo::returnValueFPR);
ASSERT(m_validFPRs.contains(FPRInfo::returnValueFPR, Width::Width128));
break;
}
case TypeKind::Void:
Expand Down

0 comments on commit adae6f1

Please sign in to comment.