Use HAVE(MACHINE_CONTEXT) instead of USE(MACHINE_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=170770

Rubber stamped by Mark Lam.

Source/JavaScriptCore:

* 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):

Source/WTF:

* wtf/Platform.h:
* wtf/PlatformRegisters.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::getRegisters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@215270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 757e84c..a711467 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,5 +1,23 @@
 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
 
+        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  <utatane.tea@gmail.com>
+
         [JSC] Clean up heap/MachineStackMarker by introducing USE(MACHINE_CONTEXT)
         https://bugs.webkit.org/show_bug.cgi?id=170770
 
diff --git a/Source/JavaScriptCore/heap/MachineStackMarker.cpp b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
index ec29c8f..48fc96a 100644
--- a/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+++ b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
@@ -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
diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h
index 440d9f9..7654044 100644
--- a/Source/JavaScriptCore/runtime/MachineContext.h
+++ b/Source/JavaScriptCore/runtime/MachineContext.h
@@ -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)
 
 }