diff options
author | 2014-07-14 16:21:44 -0700 | |
---|---|---|
committer | 2014-07-21 23:36:31 -0700 | |
commit | 7ea6f79bbddd69d5db86a8656a31aaaf64ae2582 (patch) | |
tree | c64f89b15ca71e87317f6dd405ef4a5560b73e01 /runtime/instruction_set.h | |
parent | e72ff8022968b23efedc56c0afdc1d24e8a928c2 (diff) |
ART: Throw StackOverflowError in native code
Initialize stack-overflow errors in native code to be able to reduce
the preserved area size of the stack.
Includes a refactoring away from constexpr in instruction_set.h to allow
for easy changing of the values.
Change-Id: I117cc8485f43da5f0a470f0f5e5b3dc3b5a06246
Diffstat (limited to 'runtime/instruction_set.h')
-rw-r--r-- | runtime/instruction_set.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/runtime/instruction_set.h b/runtime/instruction_set.h index dce1c150ba..f212811e32 100644 --- a/runtime/instruction_set.h +++ b/runtime/instruction_set.h @@ -169,33 +169,7 @@ static inline size_t GetBytesPerFprSpillLocation(InstructionSet isa) { } } -static constexpr size_t kDefaultStackOverflowReservedBytes = 16 * KB; -static constexpr size_t kArmStackOverflowReservedBytes = kDefaultStackOverflowReservedBytes; -static constexpr size_t kMipsStackOverflowReservedBytes = kDefaultStackOverflowReservedBytes; - -// TODO: shrink reserved space, in particular for 64bit. - -// Worst-case, we would need about 2.6x the amount of x86_64 for many more registers. -// But this one works rather well. -static constexpr size_t kArm64StackOverflowReservedBytes = 32 * KB; -// TODO: Bumped to workaround regression (http://b/14982147) Specifically to fix: -// test-art-host-run-test-interpreter-018-stack-overflow -// test-art-host-run-test-interpreter-107-int-math2 -static constexpr size_t kX86StackOverflowReservedBytes = (kIsDebugBuild ? 32 : 24) * KB; -static constexpr size_t kX86_64StackOverflowReservedBytes = 32 * KB; - -static constexpr size_t GetStackOverflowReservedBytes(InstructionSet isa) { - return (isa == kArm || isa == kThumb2) ? kArmStackOverflowReservedBytes : - isa == kArm64 ? kArm64StackOverflowReservedBytes : - isa == kMips ? kMipsStackOverflowReservedBytes : - isa == kX86 ? kX86StackOverflowReservedBytes : - isa == kX86_64 ? kX86_64StackOverflowReservedBytes : - isa == kNone ? (LOG(FATAL) << "kNone has no stack overflow size", 0) : - (LOG(FATAL) << "Unknown instruction set" << isa, 0); -} - -static constexpr size_t kRuntimeStackOverflowReservedBytes = - GetStackOverflowReservedBytes(kRuntimeISA); +size_t GetStackOverflowReservedBytes(InstructionSet isa); enum InstructionFeatures { kHwDiv = 0x1, // Supports hardware divide. |