diff options
Diffstat (limited to 'runtime/thread-inl.h')
| -rw-r--r-- | runtime/thread-inl.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h index 0c00fb93ac..00f882e3e0 100644 --- a/runtime/thread-inl.h +++ b/runtime/thread-inl.h @@ -19,6 +19,7 @@ #include "thread.h" +#include "arch/instruction_set.h" #include "base/aborting.h" #include "base/casts.h" #include "base/mutex-inl.h" @@ -393,6 +394,26 @@ inline ShadowFrame* Thread::PopShadowFrame() { return tlsPtr_.managed_stack.PopShadowFrame(); } +inline uint8_t* Thread::GetStackEndForInterpreter(bool implicit_overflow_check) const { + uint8_t* end = tlsPtr_.stack_end + (implicit_overflow_check + ? GetStackOverflowReservedBytes(kRuntimeISA) + : 0); + if (kIsDebugBuild) { + // In a debuggable build, but especially under ASAN, the access-checks interpreter has a + // potentially humongous stack size. We don't want to take too much of the stack regularly, + // so do not increase the regular reserved size (for compiled code etc) and only report the + // virtually smaller stack to the interpreter here. + end += GetStackOverflowReservedBytes(kRuntimeISA); + } + return end; +} + +inline void Thread::ResetDefaultStackEnd() { + // Our stacks grow down, so we want stack_end_ to be near there, but reserving enough room + // to throw a StackOverflowError. + tlsPtr_.stack_end = tlsPtr_.stack_begin + GetStackOverflowReservedBytes(kRuntimeISA); +} + } // namespace art #endif // ART_RUNTIME_THREAD_INL_H_ |