Index: src/base/macros.h |
diff --git a/src/base/macros.h b/src/base/macros.h |
index cb5bf7965cae5bbecbb28041d552a8335252ca5b..543c074e5c877b06e79484c1ae2389c143049b3b 100644 |
--- a/src/base/macros.h |
+++ b/src/base/macros.h |
@@ -246,4 +246,14 @@ inline uint32_t RoundDownToPowerOf2(uint32_t x) { |
return rounded_up; |
} |
+ |
+// Returns current value of top of the stack. Works correctly with ASAN. |
+DISABLE_ASAN |
+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; |
+} |
+ |
#endif // V8_BASE_MACROS_H_ |