summaryrefslogtreecommitdiffstats
path: root/runtime/thread.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-06-18 17:01:15 -0700
committerAndreas Gampe <agampe@google.com>2014-06-18 17:11:51 -0700
commit7cd26f355ba83be75b72ed628ed5ee84a3245c4f (patch)
tree94152cdd06143bec8c5491dba354cb78214b48c3 /runtime/thread.cc
parent0c29909cbde112bc9c04da4ce81421e1a0b39f36 (diff)
downloadart-7cd26f355ba83be75b72ed628ed5ee84a3245c4f.tar.gz
art-7cd26f355ba83be75b72ed628ed5ee84a3245c4f.tar.bz2
art-7cd26f355ba83be75b72ed628ed5ee84a3245c4f.zip
ART: Target-dependent stack overflow, less check elision
Refactor the separate stack overflow reserved sizes from thread.h into instruction_set.h and make sure they're used in the compiler. Refactor the decision on when to elide stack overflow checks: especially with large interpreter stack frames, it is not a good idea to elide checks when the frame size is even close to the reserved size. Currently enforce checks when the frame size is >= 2KB, but make sure that frame sizes 1KB and below will elide the checks (number from experience). Bug: 15728765 Change-Id: I016bfd3d8218170cbccbd123ed5e2203db167c06
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r--runtime/thread.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 698053062..3f8f4a3dc 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -220,7 +220,7 @@ static size_t FixStackSize(size_t stack_size) {
// It's likely that callers are trying to ensure they have at least a certain amount of
// stack space, so we should add our reserved space on top of what they requested, rather
// than implicitly take it away from them.
- stack_size += Thread::kStackOverflowReservedBytes;
+ stack_size += kRuntimeStackOverflowReservedBytes;
} else {
// If we are going to use implicit stack checks, allocate space for the protected
// region at the bottom of the stack.
@@ -489,7 +489,7 @@ void Thread::InitStackHwm() {
tlsPtr_.stack_begin = reinterpret_cast<byte*>(read_stack_base);
tlsPtr_.stack_size = read_stack_size;
- if (read_stack_size <= kStackOverflowReservedBytes) {
+ if (read_stack_size <= kRuntimeStackOverflowReservedBytes) {
LOG(FATAL) << "Attempt to attach a thread with a too-small stack (" << read_stack_size
<< " bytes)";
}
@@ -2200,7 +2200,7 @@ void Thread::SetStackEndForStackOverflow() {
if (tlsPtr_.stack_end == tlsPtr_.stack_begin) {
// However, we seem to have already extended to use the full stack.
LOG(ERROR) << "Need to increase kStackOverflowReservedBytes (currently "
- << kStackOverflowReservedBytes << ")?";
+ << kRuntimeStackOverflowReservedBytes << ")?";
DumpStack(LOG(ERROR));
LOG(FATAL) << "Recursive stack overflow.";
}