Changeset 196962 in webkit
- Timestamp:
- Feb 22, 2016, 3:03:26 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
heap/MachineStackMarker.cpp (modified) (5 diffs)
-
heap/MachineStackMarker.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r196959 r196962 1 2016-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 1 18 2016-02-22 Saam barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp
r195891 r196962 86 86 } 87 87 88 struct ucontext* userContext = static_cast<struct ucontext*>(ucontext);88 ucontext_t* userContext = static_cast<ucontext_t*>(ucontext); 89 89 thread->suspendedMachineContext = userContext->uc_mcontext; 90 90 … … 563 563 #endif 564 564 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 565 581 #else 566 582 void* stackBase = 0; … … 647 663 #endif 648 664 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 649 681 #else 650 682 #error Need a way to get the frame pointer for another thread on this platform … … 709 741 #elif CPU(MIPS) 710 742 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); 711 759 #else 712 760 #error Unknown Architecture … … 784 832 #elif CPU(MIPS) 785 833 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]); 786 850 #else 787 851 #error Unknown Architecture -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.h
r195891 r196962 35 35 #include <semaphore.h> 36 36 #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 37 44 #endif 38 45
Note:
See TracChangeset
for help on using the changeset viewer.