Implement implicit stack overflow checks
This also fixes some failing run tests due to missing
null pointer markers.
The implementation of the implicit stack overflow checks introduces
the ability to have a gap in the stack that is skipped during
stack walk backs. This gap is protected against read/write and
is used to trigger a SIGSEGV at function entry if the stack
will overflow.
Change-Id: I0c3e214c8b87dc250cf886472c6d327b5d58653e
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index 9e5f54c..c81706f 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -134,7 +134,9 @@
LOG(ERROR) << "Couldn't throw new StackOverflowError because JNI ThrowNew failed.";
CHECK(self->IsExceptionPending());
}
- self->ResetDefaultStackEnd(); // Return to default stack size.
+
+ bool explicit_overflow_check = Runtime::Current()->ExplicitStackOverflowChecks();
+ self->ResetDefaultStackEnd(!explicit_overflow_check); // Return to default stack size.
}
JValue InvokeProxyInvocationHandler(ScopedObjectAccessUnchecked& soa, const char* shorty,