⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 197099 in webkit


Ignore:
Timestamp:
Feb 25, 2016, 5:05:30 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r196962 - Fix build and implement functions to retrieve registers on FreeBSD
​https://bugs.webkit.org/show_bug.cgi?id=152258

Patch by Ting-Wei Lan <Ting-Wei Lan> on 2016-02-22
Reviewed by Michael Catanzaro.

  • heap/MachineStackMarker.cpp:

(pthreadSignalHandlerSuspendResume):
struct ucontext is not specified in POSIX and it is not available on
FreeBSD. Replacing it with ucontext_t fixes the build problem.
(JSC::MachineThreads::Thread::Registers::stackPointer):
(JSC::MachineThreads::Thread::Registers::framePointer):
(JSC::MachineThreads::Thread::Registers::instructionPointer):
(JSC::MachineThreads::Thread::Registers::llintPC):

  • heap/MachineStackMarker.h:
Location:
releases/WebKitGTK/webkit-2.12/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.12/Source/JavaScriptCore/ChangeLog

    r197095 r197099  
     12016-02-22  Ting-Wei Lan  <lantw44@gmail.com>
     2
     3        Fix build and implement functions to retrieve registers on FreeBSD
     4        https://bugs.webkit.org/show_bug.cgi?id=152258
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * heap/MachineStackMarker.cpp:
     9        (pthreadSignalHandlerSuspendResume):
     10        struct ucontext is not specified in POSIX and it is not available on
     11        FreeBSD. Replacing it with ucontext_t fixes the build problem.
     12        (JSC::MachineThreads::Thread::Registers::stackPointer):
     13        (JSC::MachineThreads::Thread::Registers::framePointer):
     14        (JSC::MachineThreads::Thread::Registers::instructionPointer):
     15        (JSC::MachineThreads::Thread::Registers::llintPC):
     16        * heap/MachineStackMarker.h:
     17
    1182016-02-21  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • releases/WebKitGTK/webkit-2.12/Source/JavaScriptCore/heap/MachineStackMarker.cpp

    r195891 r197099  
    8686    }
    8787
    88     struct ucontext* userContext = static_cast<struct ucontext*>(ucontext);
     88    ucontext_t* userContext = static_cast<ucontext_t*>(ucontext);
    8989    thread->suspendedMachineContext = userContext->uc_mcontext;
    9090
    … …  
    563563#endif
    564564
     565#elif OS(FREEBSD) && ENABLE(JIT)
     566
     567#if CPU(X86)
     568    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_esp);
     569#elif CPU(X86_64)
     570    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_rsp);
     571#elif CPU(ARM)
     572    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.__gregs[_REG_SP]);
     573#elif CPU(ARM64)
     574    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_gpregs.gp_sp);
     575#elif CPU(MIPS)
     576    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_regs[29]);
     577#else
     578#error Unknown Architecture
     579#endif
     580
    565581#else
    566582    void* stackBase = 0;
    … …  
    647663#endif
    648664
     665#elif OS(FREEBSD)
     666
     667#if CPU(X86)
     668    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_ebp);
     669#elif CPU(X86_64)
     670    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_rbp);
     671#elif CPU(ARM)
     672    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.__gregs[_REG_FP]);
     673#elif CPU(ARM64)
     674    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_gpregs.gp_x[29]);
     675#elif CPU(MIPS)
     676    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_regs[30]);
     677#else
     678#error Unknown Architecture
     679#endif
     680
    649681#else
    650682#error Need a way to get the frame pointer for another thread on this platform
    … …  
    709741#elif CPU(MIPS)
    710742    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.pc);
     743#else
     744#error Unknown Architecture
     745#endif
     746
     747#elif OS(FREEBSD)
     748
     749#if CPU(X86)
     750    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_eip);
     751#elif CPU(X86_64)
     752    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_rip);
     753#elif CPU(ARM)
     754    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.__gregs[_REG_PC]);
     755#elif CPU(ARM64)
     756    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_gpregs.gp_elr);
     757#elif CPU(MIPS)
     758    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_pc);
    711759#else
    712760#error Unknown Architecture
    … …  
    784832#elif CPU(MIPS)
    785833    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.gregs[12]);
     834#else
     835#error Unknown Architecture
     836#endif
     837
     838#elif OS(FREEBSD)
     839
     840#if CPU(X86)
     841    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_esi);
     842#elif CPU(X86_64)
     843    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_r8);
     844#elif CPU(ARM)
     845    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.__gregs[_REG_R8]);
     846#elif CPU(ARM64)
     847    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_gpregs.gp_x[4]);
     848#elif CPU(MIPS)
     849    return reinterpret_cast<void*>((uintptr_t) regs.machineContext.mc_regs[12]);
    786850#else
    787851#error Unknown Architecture
  • releases/WebKitGTK/webkit-2.12/Source/JavaScriptCore/heap/MachineStackMarker.h

    r195891 r197099  
    3535#include <semaphore.h>
    3636#include <signal.h>
     37// Using signal.h didn't make mcontext_t and ucontext_t available on FreeBSD.
     38// This bug has been fixed in FreeBSD 11.0-CURRENT, so this workaround can be
     39// removed after FreeBSD 10.x goes EOL.
     40// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207079
     41#if OS(FREEBSD)
     42#include <ucontext.h>
     43#endif
    3744#endif
    3845
Note: See TracChangeset for help on using the changeset viewer.