Commit 3673171a authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64]Increase the number of args supported by the simulator to 20

Port 4de20cb1

Change-Id: I8801bbcf9647c1abcb9cc5fb41720009e002d153
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3257964
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: 's avatarji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#77667}
parent 059cd3cd
......@@ -2191,11 +2191,11 @@ void Simulator::Format(Instruction* instr, const char* format) {
// calls return 64 bits of result. If they don't, the a1 result register
// contains a bogus value, which is fine because it is caller-saved.
using SimulatorRuntimeCall = ObjectPair (*)(int64_t arg0, int64_t arg1,
int64_t arg2, int64_t arg3,
int64_t arg4, int64_t arg5,
int64_t arg6, int64_t arg7,
int64_t arg8, int64_t arg9);
using SimulatorRuntimeCall = ObjectPair (*)(
int64_t arg0, int64_t arg1, int64_t arg2, int64_t arg3, int64_t arg4,
int64_t arg5, int64_t arg6, int64_t arg7, int64_t arg8, int64_t arg9,
int64_t arg10, int64_t arg11, int64_t arg12, int64_t arg13, int64_t arg14,
int64_t arg15, int64_t arg16, int64_t arg17, int64_t arg18, int64_t arg19);
// These prototypes handle the four types of FP calls.
using SimulatorRuntimeCompareCall = int64_t (*)(double darg0, double darg1);
......@@ -2226,17 +2226,27 @@ void Simulator::SoftwareInterrupt() {
int64_t* stack_pointer = reinterpret_cast<int64_t*>(get_register(sp));
int64_t arg0 = get_register(a0);
int64_t arg1 = get_register(a1);
int64_t arg2 = get_register(a2);
int64_t arg3 = get_register(a3);
int64_t arg4 = get_register(a4);
int64_t arg5 = get_register(a5);
int64_t arg6 = get_register(a6);
int64_t arg7 = get_register(a7);
int64_t arg8 = stack_pointer[0];
int64_t arg9 = stack_pointer[1];
STATIC_ASSERT(kMaxCParameters == 10);
const int64_t arg0 = get_register(a0);
const int64_t arg1 = get_register(a1);
const int64_t arg2 = get_register(a2);
const int64_t arg3 = get_register(a3);
const int64_t arg4 = get_register(a4);
const int64_t arg5 = get_register(a5);
const int64_t arg6 = get_register(a6);
const int64_t arg7 = get_register(a7);
const int64_t arg8 = stack_pointer[0];
const int64_t arg9 = stack_pointer[1];
const int64_t arg10 = stack_pointer[2];
const int64_t arg11 = stack_pointer[3];
const int64_t arg12 = stack_pointer[4];
const int64_t arg13 = stack_pointer[5];
const int64_t arg14 = stack_pointer[6];
const int64_t arg15 = stack_pointer[7];
const int64_t arg16 = stack_pointer[8];
const int64_t arg17 = stack_pointer[9];
const int64_t arg18 = stack_pointer[10];
const int64_t arg19 = stack_pointer[11];
STATIC_ASSERT(kMaxCParameters == 20);
bool fp_call =
(redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
......@@ -2395,13 +2405,18 @@ void Simulator::SoftwareInterrupt() {
"Call to host function %s at %p "
"args %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64
" , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64 " , %08" PRIx64
" , %08" PRIx64 " , %08" PRIx64 " \n",
" , %08" PRIx64 " , %08" PRIx64 " , %016" PRIx64
" , %016" PRIx64 " , %016" PRIx64 " , %016" PRIx64
" , %016" PRIx64 " , %016" PRIx64 " , %016" PRIx64
" , %016" PRIx64 " , %016" PRIx64 " , %016" PRIx64 " \n",
ExternalReferenceTable::NameOfIsolateIndependentAddress(pc),
reinterpret_cast<void*>(FUNCTION_ADDR(target)), arg0, arg1, arg2,
arg3, arg4, arg5, arg6, arg7, arg8, arg9);
arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12,
arg13, arg14, arg15, arg16, arg17, arg18, arg19);
}
ObjectPair result =
target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
ObjectPair result = target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7,
arg8, arg9, arg10, arg11, arg12, arg13, arg14,
arg15, arg16, arg17, arg18, arg19);
set_register(a0, (int64_t)(result.x));
set_register(a1, (int64_t)(result.y));
}
......
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