Commit ab6462e8 authored by Vasili Skurydzin's avatar Vasili Skurydzin Committed by Commit Bot

ppc64,aix: fixed Abort() calling sequence on Aix

fixed Abort() calling sequence on platforms with function descriptors by taking
function descriptor of the External Reference object into account when calling
C code.

Change-Id: I54c04a5f1774f2768380cc5c95b1b807204335ce
Reviewed-on: https://chromium-review.googlesource.com/c/1258186Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#56356}
parent 99791dc5
......@@ -1764,11 +1764,8 @@ void TurboAssembler::Abort(AbortReason reason) {
// We don't care if we constructed a frame. Just pretend we did.
FrameScope assume_frame(this, StackFrame::NONE);
mov(r3, Operand(static_cast<int>(reason)));
PrepareCallCFunction(1, 0, r4);
Move(ip, ExternalReference::abort_with_reason());
// Use Call directly to avoid any unneeded overhead. The function won't
// return anyway.
Call(ip);
PrepareCallCFunction(1, r4);
CallCFunction(ExternalReference::abort_with_reason(), 1);
return;
}
......
......@@ -25,6 +25,9 @@ TEST_F(TurboAssemblerTest, TestHardAbort) {
byte* buffer = AllocateAssemblerBuffer(&allocated);
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
static_cast<int>(allocated), CodeObjectRequired::kNo);
// Called from C
__ function_descriptor();
__ set_abort_hard(true);
__ Abort(AbortReason::kNoReason);
......@@ -43,6 +46,9 @@ TEST_F(TurboAssemblerTest, TestCheck) {
byte* buffer = AllocateAssemblerBuffer(&allocated);
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
static_cast<int>(allocated), CodeObjectRequired::kNo);
// Called from C
__ function_descriptor();
__ set_abort_hard(true);
// Fail if the first parameter is 17.
......
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