Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (215269 => 215270)
--- trunk/Source/_javascript_Core/ChangeLog 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-04-12 17:19:57 UTC (rev 215270)
@@ -1,5 +1,23 @@
2017-04-12 Yusuke Suzuki <[email protected]>
+ Use HAVE(MACHINE_CONTEXT) instead of USE(MACHINE_CONTEXT)
+ https://bugs.webkit.org/show_bug.cgi?id=170770
+
+ Rubber stamped by Mark Lam.
+
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::MachineThread::Registers::framePointer):
+ (JSC::MachineThreads::MachineThread::Registers::instructionPointer):
+ (JSC::MachineThreads::MachineThread::Registers::llintPC):
+ * runtime/MachineContext.h:
+ (JSC::MachineContext::stackPointer):
+ (JSC::MachineContext::framePointer):
+ (JSC::MachineContext::instructionPointer):
+ (JSC::MachineContext::argumentPointer<1>):
+ (JSC::MachineContext::llintInstructionPointer):
+
+2017-04-12 Yusuke Suzuki <[email protected]>
+
[JSC] Clean up heap/MachineStackMarker by introducing USE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=170770
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (215269 => 215270)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2017-04-12 17:19:57 UTC (rev 215270)
@@ -232,7 +232,7 @@
#if ENABLE(SAMPLING_PROFILER)
void* MachineThreads::MachineThread::Registers::framePointer() const
{
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
return MachineContext::framePointer(regs);
#else
#error Need a way to get the frame pointer for another thread on this platform
@@ -241,7 +241,7 @@
void* MachineThreads::MachineThread::Registers::instructionPointer() const
{
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
return MachineContext::instructionPointer(regs);
#else
#error Need a way to get the instruction pointer for another thread on this platform
@@ -251,7 +251,7 @@
void* MachineThreads::MachineThread::Registers::llintPC() const
{
// LLInt uses regT4 as PC.
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
return MachineContext::llintInstructionPointer(regs);
#else
#error Need a way to get the LLIntPC for another thread on this platform
Modified: trunk/Source/_javascript_Core/runtime/MachineContext.h (215269 => 215270)
--- trunk/Source/_javascript_Core/runtime/MachineContext.h 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/_javascript_Core/runtime/MachineContext.h 2017-04-12 17:19:57 UTC (rev 215270)
@@ -37,7 +37,7 @@
void*& stackPointer(PlatformRegisters&);
void* stackPointer(const PlatformRegisters&);
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
void*& framePointer(PlatformRegisters&);
void* framePointer(const PlatformRegisters&);
void*& instructionPointer(PlatformRegisters&);
@@ -48,7 +48,7 @@
void*& llintInstructionPointer(PlatformRegisters&);
void* llintInstructionPointer(const PlatformRegisters&);
#endif // ENABLE(JIT)
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
void*& stackPointer(mcontext_t&);
void* stackPointer(const mcontext_t&);
void*& framePointer(mcontext_t&);
@@ -61,8 +61,8 @@
void*& llintInstructionPointer(mcontext_t&);
void* llintInstructionPointer(const mcontext_t&);
#endif // ENABLE(JIT)
-#endif // USE(MACHINE_CONTEXT)
-#endif // OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
+#endif // OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
inline void*& stackPointer(PlatformRegisters& regs)
{
@@ -109,7 +109,7 @@
#error Unknown Architecture
#endif
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
return stackPointer(regs.machineContext);
#else
return regs.stackPointer;
@@ -122,7 +122,7 @@
}
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
inline void*& stackPointer(mcontext_t& machineContext)
{
#if OS(DARWIN)
@@ -165,10 +165,10 @@
{
return stackPointer(const_cast<mcontext_t&>(machineContext));
}
-#endif // USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
inline void*& framePointer(PlatformRegisters& regs)
{
#if OS(DARWIN)
@@ -215,7 +215,7 @@
#error Unknown Architecture
#endif
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
return framePointer(regs.machineContext);
#endif
}
@@ -224,10 +224,10 @@
{
return framePointer(const_cast<PlatformRegisters&>(regs));
}
-#endif // OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#endif // OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
inline void*& framePointer(mcontext_t& machineContext)
{
#if OS(DARWIN)
@@ -274,10 +274,10 @@
{
return framePointer(const_cast<mcontext_t&>(machineContext));
}
-#endif // USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
inline void*& instructionPointer(PlatformRegisters& regs)
{
#if OS(DARWIN)
@@ -318,7 +318,7 @@
#error Unknown Architecture
#endif
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
return instructionPointer(regs.machineContext);
#endif
}
@@ -327,10 +327,10 @@
{
return instructionPointer(const_cast<PlatformRegisters&>(regs));
}
-#endif // OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#endif // OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
inline void*& instructionPointer(mcontext_t& machineContext)
{
#if OS(DARWIN)
@@ -377,11 +377,11 @@
{
return instructionPointer(const_cast<mcontext_t&>(machineContext));
}
-#endif // USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
-#if USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
template<> void*& argumentPointer<1>(mcontext_t&);
#endif
@@ -429,7 +429,7 @@
#error Unknown Architecture
#endif
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
return argumentPointer<1>(regs.machineContext);
#endif
}
@@ -439,9 +439,9 @@
{
return argumentPointer<N>(const_cast<PlatformRegisters&>(regs));
}
-#endif // OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#endif // OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
template<>
inline void*& argumentPointer<1>(mcontext_t& machineContext)
{
@@ -490,10 +490,10 @@
{
return argumentPointer<N>(const_cast<mcontext_t&>(machineContext));
}
-#endif // USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
#if ENABLE(JIT)
-#if OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#if OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
inline void*& llintInstructionPointer(PlatformRegisters& regs)
{
// LLInt uses regT4 as PC.
@@ -546,7 +546,7 @@
#error Unknown Architecture
#endif
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
return llintInstructionPointer(regs.machineContext);
#endif
}
@@ -555,10 +555,10 @@
{
return llintInstructionPointer(const_cast<PlatformRegisters&>(regs));
}
-#endif // OS(WINDOWS) || USE(MACHINE_CONTEXT)
+#endif // OS(WINDOWS) || HAVE(MACHINE_CONTEXT)
-#if USE(MACHINE_CONTEXT)
+#if HAVE(MACHINE_CONTEXT)
inline void*& llintInstructionPointer(mcontext_t& machineContext)
{
// LLInt uses regT4 as PC.
@@ -606,7 +606,7 @@
{
return llintInstructionPointer(const_cast<mcontext_t&>(machineContext));
}
-#endif // USE(MACHINE_CONTEXT)
+#endif // HAVE(MACHINE_CONTEXT)
#endif // ENABLE(JIT)
}
Modified: trunk/Source/WTF/ChangeLog (215269 => 215270)
--- trunk/Source/WTF/ChangeLog 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/WTF/ChangeLog 2017-04-12 17:19:57 UTC (rev 215270)
@@ -1,5 +1,17 @@
2017-04-12 Yusuke Suzuki <[email protected]>
+ Use HAVE(MACHINE_CONTEXT) instead of USE(MACHINE_CONTEXT)
+ https://bugs.webkit.org/show_bug.cgi?id=170770
+
+ Rubber stamped by Mark Lam.
+
+ * wtf/Platform.h:
+ * wtf/PlatformRegisters.h:
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::Thread::getRegisters):
+
+2017-04-12 Yusuke Suzuki <[email protected]>
+
[JSC] Clean up heap/MachineStackMarker by introducing USE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=170770
Modified: trunk/Source/WTF/wtf/Platform.h (215269 => 215270)
--- trunk/Source/WTF/wtf/Platform.h 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/WTF/wtf/Platform.h 2017-04-12 17:19:57 UTC (rev 215270)
@@ -1215,7 +1215,7 @@
#endif
#if OS(DARWIN) || ((OS(FREEBSD) || defined(__GLIBC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
-#define USE_MACHINE_CONTEXT 1
+#define HAVE_MACHINE_CONTEXT 1
#endif
#endif /* WTF_Platform_h */
Modified: trunk/Source/WTF/wtf/PlatformRegisters.h (215269 => 215270)
--- trunk/Source/WTF/wtf/PlatformRegisters.h 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/WTF/wtf/PlatformRegisters.h 2017-04-12 17:19:57 UTC (rev 215270)
@@ -59,7 +59,7 @@
using PlatformRegisters = CONTEXT;
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
struct PlatformRegisters {
mcontext_t machineContext;
Modified: trunk/Source/WTF/wtf/ThreadingPthreads.cpp (215269 => 215270)
--- trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2017-04-12 16:59:26 UTC (rev 215269)
+++ trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2017-04-12 17:19:57 UTC (rev 215270)
@@ -387,7 +387,7 @@
CRASH();
}
return userCount * sizeof(uintptr_t);
-#elif USE(MACHINE_CONTEXT)
+#elif HAVE(MACHINE_CONTEXT)
registers.machineContext = m_suspendedMachineContext;
return sizeof(PlatformRegisters);
#elif OS(OPENBSD)