Commit 97d130f5 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC: fix aix function descriptor issue on builtins

bug: v8:8828
Change-Id: I271f8cd4282f52fbcc573f6ccbe67b1111f62c7f
Reviewed-on: https://chromium-review.googlesource.com/c/1448711
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59556}
parent b73d9414
......@@ -554,9 +554,6 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Label invoke, handler_entry, exit;
// Called from C
__ function_descriptor();
{
NoRootArrayScope no_root_array(masm);
......@@ -2603,16 +2600,6 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
__ Move(isolate_reg, ExternalReference::isolate_address(masm->isolate()));
Register target = r15;
if (ABI_USES_FUNCTION_DESCRIPTORS) {
// AIX/PPC64BE Linux use a function descriptor.
__ LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(r15, kPointerSize));
__ LoadP(ip, MemOperand(r15, 0)); // Instruction address
target = ip;
} else if (ABI_CALL_VIA_IP) {
__ Move(ip, r15);
target = ip;
}
__ StoreReturnAddressAndCall(target);
// If return value is on the stack, pop it to registers.
......
......@@ -2287,7 +2287,6 @@ void CodeGenerator::AssembleConstructFrame() {
auto call_descriptor = linkage()->GetIncomingDescriptor();
if (frame_access_state()->has_frame()) {
if (call_descriptor->IsCFunctionCall()) {
__ function_descriptor();
__ mflr(r0);
if (FLAG_enable_embedded_constant_pool) {
__ Push(r0, fp, kConstantPoolRegister);
......
......@@ -109,9 +109,6 @@ RegExpMacroAssemblerPPC::RegExpMacroAssemblerPPC(Isolate* isolate, Zone* zone,
internal_failure_label_() {
DCHECK_EQ(0, registers_to_save % 2);
// Called from C
__ function_descriptor();
__ b(&entry_label_); // We'll write the entry code later.
// If the code gets too big or corrupted, an internal exception will be
// raised, and we will exit right away.
......
......@@ -121,7 +121,19 @@ class GeneratedCode {
#else
DISABLE_CFI_ICALL Return Call(Args... args) {
// When running without a simulator we call the entry directly.
#if V8_OS_AIX
// AIX ABI requires function descriptors (FD). Artificially create a pseudo
// FD to ensure correct dispatch to generated code. The 'volatile'
// declaration is required to avoid the compiler from not observing the
// alias of the pseudo FD to the function pointer, and hence, optimizing the
// pseudo FD declaration/initialization away.
volatile Address function_desc[] = {reinterpret_cast<Address>(fn_ptr_), 0,
0};
Signature* fn = reinterpret_cast<Signature*>(function_desc);
return fn(args...);
#else
return fn_ptr_(args...);
#endif // V8_OS_AIX
}
#endif
......
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