diff options
Diffstat (limited to 'deps/v8/src/s390/simulator-s390.cc')
-rw-r--r-- | deps/v8/src/s390/simulator-s390.cc | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/deps/v8/src/s390/simulator-s390.cc b/deps/v8/src/s390/simulator-s390.cc index b0fa0917ad..9f41bace2a 100644 --- a/deps/v8/src/s390/simulator-s390.cc +++ b/deps/v8/src/s390/simulator-s390.cc @@ -1644,6 +1644,8 @@ void Simulator::TearDown(base::CustomMatcherHashMap* i_cache, 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(); } @@ -1934,7 +1936,9 @@ static void decodeObjectPair(ObjectPair* pair, intptr_t* x, intptr_t* y) { // Calls into the V8 runtime. typedef intptr_t (*SimulatorRuntimeCall)(intptr_t arg0, intptr_t arg1, intptr_t arg2, intptr_t arg3, - intptr_t arg4, intptr_t arg5); + intptr_t arg4, intptr_t arg5, + intptr_t arg6, intptr_t arg7, + intptr_t arg8); typedef ObjectPair (*SimulatorRuntimePairCall)(intptr_t arg0, intptr_t arg1, intptr_t arg2, intptr_t arg3, intptr_t arg4, intptr_t arg5); @@ -1971,7 +1975,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { (get_register(sp) & (::v8::internal::FLAG_sim_stack_alignment - 1)) == 0; Redirection* redirection = Redirection::FromSwiInstruction(instr); - const int kArgCount = 6; + const int kArgCount = 9; + const int kRegisterArgCount = 5; int arg0_regnum = 2; intptr_t result_buffer = 0; bool uses_result_buffer = @@ -1983,11 +1988,18 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { arg0_regnum++; } intptr_t arg[kArgCount]; - for (int i = 0; i < kArgCount - 1; i++) { + // First 5 arguments in registers r2-r6. + for (int i = 0; i < kRegisterArgCount; i++) { arg[i] = get_register(arg0_regnum + i); } + // Remaining arguments on stack intptr_t* stack_pointer = reinterpret_cast<intptr_t*>(get_register(sp)); - arg[5] = stack_pointer[kCalleeRegisterSaveAreaSize / kPointerSize]; + for (int i = kRegisterArgCount; i < kArgCount; i++) { + arg[i] = stack_pointer[(kCalleeRegisterSaveAreaSize / kPointerSize) + + (i - kRegisterArgCount)]; + } + STATIC_ASSERT(kArgCount == kRegisterArgCount + 4); + STATIC_ASSERT(kMaxCParameters == 9); bool fp_call = (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) || (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) || @@ -2165,9 +2177,10 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { PrintF( "Call to host function at %p,\n" "\t\t\t\targs %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR + ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR ", %08" V8PRIxPTR, static_cast<void*>(FUNCTION_ADDR(target)), arg[0], arg[1], arg[2], - arg[3], arg[4], arg[5]); + arg[3], arg[4], arg[5], arg[6], arg[7], arg[8]); if (!stack_aligned) { PrintF(" with unaligned stack %08" V8PRIxPTR "\n", static_cast<intptr_t>(get_register(sp))); @@ -2214,8 +2227,8 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL); SimulatorRuntimeCall target = reinterpret_cast<SimulatorRuntimeCall>(external); - intptr_t result = - target(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]); + intptr_t result = target(arg[0], arg[1], arg[2], arg[3], arg[4], + arg[5], arg[6], arg[7], arg[8]); if (::v8::internal::FLAG_trace_sim) { PrintF("Returned %08" V8PRIxPTR "\n", result); } |