summaryrefslogtreecommitdiff
path: root/deps/v8/src/arm64/simulator-arm64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/arm64/simulator-arm64.cc')
-rw-r--r--deps/v8/src/arm64/simulator-arm64.cc69
1 files changed, 43 insertions, 26 deletions
diff --git a/deps/v8/src/arm64/simulator-arm64.cc b/deps/v8/src/arm64/simulator-arm64.cc
index b536fd5e9c..fb0e614982 100644
--- a/deps/v8/src/arm64/simulator-arm64.cc
+++ b/deps/v8/src/arm64/simulator-arm64.cc
@@ -208,7 +208,6 @@ int64_t Simulator::CallRegExp(byte* entry,
int64_t output_size,
Address stack_base,
int64_t direct_call,
- void* return_address,
Isolate* isolate) {
CallArgument args[] = {
CallArgument(input),
@@ -219,7 +218,6 @@ int64_t Simulator::CallRegExp(byte* entry,
CallArgument(output_size),
CallArgument(stack_base),
CallArgument(direct_call),
- CallArgument(return_address),
CallArgument(isolate),
CallArgument::End()
};
@@ -540,14 +538,11 @@ void Simulator::TearDown(base::CustomMatcherHashMap* i_cache,
// uses the ObjectPair structure.
// The simulator assumes all runtime calls return two 64-bits values. If they
// don't, register x1 is clobbered. This is fine because x1 is caller-saved.
-typedef ObjectPair (*SimulatorRuntimeCall)(int64_t arg0,
- int64_t arg1,
- int64_t arg2,
- int64_t arg3,
- int64_t arg4,
- int64_t arg5,
- int64_t arg6,
- int64_t arg7);
+typedef ObjectPair (*SimulatorRuntimeCall)(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);
typedef ObjectTriple (*SimulatorRuntimeTripleCall)(int64_t arg0, int64_t arg1,
int64_t arg2, int64_t arg3,
@@ -589,6 +584,19 @@ void Simulator::DoRuntimeCall(Instruction* instr) {
FATAL("ALIGNMENT EXCEPTION");
}
+ int64_t* stack_pointer = reinterpret_cast<int64_t*>(sp());
+
+ const int64_t arg0 = xreg(0);
+ const int64_t arg1 = xreg(1);
+ const int64_t arg2 = xreg(2);
+ const int64_t arg3 = xreg(3);
+ const int64_t arg4 = xreg(4);
+ const int64_t arg5 = xreg(5);
+ const int64_t arg6 = xreg(6);
+ const int64_t arg7 = xreg(7);
+ const int64_t arg8 = stack_pointer[0];
+ STATIC_ASSERT(kMaxCParameters == 9);
+
switch (redirection->type()) {
default:
TraceSim("Type: Unknown.\n");
@@ -606,15 +614,20 @@ void Simulator::DoRuntimeCall(Instruction* instr) {
// We don't know how many arguments are being passed, but we can
// pass 8 without touching the stack. They will be ignored by the
// host function if they aren't used.
- TraceSim("Arguments: "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
- "0x%016" PRIx64 ", 0x%016" PRIx64,
- xreg(0), xreg(1), xreg(2), xreg(3),
- xreg(4), xreg(5), xreg(6), xreg(7));
- ObjectPair result = target(xreg(0), xreg(1), xreg(2), xreg(3),
- xreg(4), xreg(5), xreg(6), xreg(7));
+ TraceSim(
+ "Arguments: "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64,
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+ ObjectPair result =
+ target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
TraceSim("Returned: {%p, %p}\n", static_cast<void*>(result.x),
static_cast<void*>(result.y));
#ifdef DEBUG
@@ -636,16 +649,18 @@ void Simulator::DoRuntimeCall(Instruction* instr) {
// host function if they aren't used.
TraceSim(
"Arguments: "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
- "0x%016" PRIx64 ", 0x%016" PRIx64 ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
+ "0x%016" PRIx64 ", 0x%016" PRIx64
+ ", "
"0x%016" PRIx64 ", 0x%016" PRIx64,
- xreg(0), xreg(1), xreg(2), xreg(3), xreg(4), xreg(5), xreg(6),
- xreg(7));
+ arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
// Return location passed in x8.
ObjectTriple* sim_result = reinterpret_cast<ObjectTriple*>(xreg(8));
- ObjectTriple result = target(xreg(0), xreg(1), xreg(2), xreg(3), xreg(4),
- xreg(5), xreg(6), xreg(7));
+ ObjectTriple result =
+ target(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
TraceSim("Returned: {%p, %p, %p}\n", static_cast<void*>(result.x),
static_cast<void*>(result.y), static_cast<void*>(result.z));
#ifdef DEBUG
@@ -786,6 +801,8 @@ void Simulator::DoRuntimeCall(Instruction* instr) {
void* Simulator::RedirectExternalReference(Isolate* isolate,
void* external_function,
ExternalReference::Type type) {
+ base::LockGuard<base::Mutex> lock_guard(
+ isolate->simulator_redirection_mutex());
Redirection* redirection = Redirection::Get(isolate, external_function, type);
return redirection->address_of_redirect_call();
}