Commit 12c81480 authored by Vlad Tsyrklevich's avatar Vlad Tsyrklevich Committed by Commit Bot

Update GetCurrentStackPosition to use built-in

By using a built-in this functions works with SafeStack and doesn't
require an attribute disabling ASan.

BUG=chromium:864705

Change-Id: I20cc818f1a0724a017a4f7f9ae3cd8fedb6245ee
Reviewed-on: https://chromium-review.googlesource.com/1141045
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54884}
parent 5d411aef
......@@ -1562,13 +1562,14 @@ bool DoubleToBoolean(double d);
template <typename Stream>
bool StringToArrayIndex(Stream* stream, uint32_t* index);
// Returns current value of top of the stack. Works correctly with ASAN.
DISABLE_ASAN
// Returns current value of top of the stack. Works correctly with ASAN and
// SafeStack.
inline uintptr_t GetCurrentStackPosition() {
// Takes the address of the limit variable in order to find out where
// the top of stack is right now.
uintptr_t limit = reinterpret_cast<uintptr_t>(&limit);
return limit;
#if V8_CC_MSVC
return reinterpret_cast<uintptr_t>(_AddressOfReturnAddress());
#else
return reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
#endif
}
template <typename V>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment