Implement StackOverflow check.
Change-Id: I981afe85ace84749f2e194e6df902c8ede947828
diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc
index 7349647..ccc8639 100644
--- a/src/compiler_llvm/runtime_support_llvm.cc
+++ b/src/compiler_llvm/runtime_support_llvm.cc
@@ -113,12 +113,17 @@
thread->ThrowNewException("Ljava/lang/NullPointerException;", NULL);
}
-void art_throw_stack_overflow_from_code(void*) {
+void art_throw_stack_overflow_from_code() {
Thread* thread = Thread::Current();
+ if (Runtime::Current()->IsMethodTracingActive()) {
+ TraceMethodUnwindFromCode(thread);
+ }
+ thread->SetStackEndForStackOverflow(); // Allow space on the stack for constructor to execute
thread->ThrowNewExceptionF("Ljava/lang/StackOverflowError;",
"stack size %zdkb; default stack size: %zdkb",
thread->GetStackSize() / KB,
Runtime::Current()->GetDefaultStackSize() / KB);
+ thread->ResetDefaultStackEnd(); // Return to default stack size
}
void art_throw_exception_from_code(Object* exception) {