Changeset 237059 in webkit
- Timestamp:
- Oct 11, 2018, 6:32:19 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r237054 r237059 1 2018-10-11 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 3 Use currentStackPointer more 4 https://bugs.webkit.org/show_bug.cgi?id=190503 5 6 Reviewed by Saam Barati. 7 8 * runtime/VM.cpp: 9 (JSC::VM::committedStackByteCount): 10 1 11 2018-10-08 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 12 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r236381 r237059 1158 1158 // committed. So, we use the current stack usage as an estimate. 1159 1159 ASSERT(Thread::current().stack().isGrowingDownward()); 1160 int8_t* current = reinterpret_cast<int8_t*>(¤t);1161 int8_t* high = reinterpret_cast<int8_t*>(Thread::current().stack().origin());1160 uint8_t* current = bitwise_cast<uint8_t*>(currentStackPointer()); 1161 uint8_t* high = bitwise_cast<uint8_t*>(Thread::current().stack().origin()); 1162 1162 return high - current; 1163 1163 #else -
trunk/Source/WTF/ChangeLog
r237052 r237059 1 2018-10-11 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 3 Use currentStackPointer more 4 https://bugs.webkit.org/show_bug.cgi?id=190503 5 6 Reviewed by Saam Barati. 7 8 Use WTF::currentStackPointer more in WebKit to adopt ASAN detect_stack_use_after_return option. 9 10 * wtf/StackBounds.cpp: 11 (WTF::testStackDirection2): 12 (WTF::testStackDirection): 13 * wtf/ThreadingPthreads.cpp: 14 (WTF::Thread::signalHandlerSuspendResume): 15 (WTF::getApproximateStackPointer): Deleted. 16 1 17 2018-10-11 Ross Kirsling <ross.kirsling@sony.com> 2 18 -
trunk/Source/WTF/wtf/StackBounds.cpp
r236962 r237059 51 51 } 52 52 #else 53 static NEVER_INLINE NOT_TAIL_CALLED StackBounds::StackDirection testStackDirection2(volatile const int* pointer)54 { 55 volatile int stackValue = 42;56 return (pointer < &stackValue) ? StackBounds::StackDirection::Upward : StackBounds::StackDirection::Downward;53 static NEVER_INLINE NOT_TAIL_CALLED StackBounds::StackDirection testStackDirection2(volatile const uint8_t* pointer) 54 { 55 volatile uint8_t* stackValue = bitwise_cast<uint8_t*>(currentStackPointer()); 56 return (pointer < stackValue) ? StackBounds::StackDirection::Upward : StackBounds::StackDirection::Downward; 57 57 } 58 58 … … 60 60 { 61 61 NO_TAIL_CALLS(); 62 volatile int stackValue = 42;63 return testStackDirection2( &stackValue);62 volatile uint8_t* stackValue = bitwise_cast<uint8_t*>(currentStackPointer()); 63 return testStackDirection2(stackValue); 64 64 } 65 65 -
trunk/Source/WTF/wtf/ThreadingPthreads.cpp
r235935 r237059 110 110 static std::atomic<Thread*> targetThread { nullptr }; 111 111 112 IGNORE_GCC_WARNINGS_BEGIN("return-local-addr")113 IGNORE_CLANG_WARNINGS_BEGIN("return-stack-address")114 115 static NEVER_INLINE void* getApproximateStackPointer()116 {117 volatile uintptr_t stackLocation;118 stackLocation = bitwise_cast<uintptr_t>(&stackLocation);119 return bitwise_cast<void*>(stackLocation);120 }121 122 IGNORE_CLANG_WARNINGS_END123 IGNORE_GCC_WARNINGS_END124 125 112 void Thread::signalHandlerSuspendResume(int, siginfo_t*, void* ucontext) 126 113 { … … 138 125 } 139 126 140 void* approximateStackPointer = getApproximateStackPointer();127 void* approximateStackPointer = currentStackPointer(); 141 128 if (!thread->m_stack.contains(approximateStackPointer)) { 142 129 // This happens if we use an alternative signal stack.
Note:
See TracChangeset
for help on using the changeset viewer.