diff options
author | Andreas Gampe <agampe@google.com> | 2014-03-10 14:18:35 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-03-10 15:10:05 -0700 |
commit | 5b417b97bd0e89ecd16d2215e0ff2eca5284e013 (patch) | |
tree | ebcbe66aa85c1813ff795e9274f9add38e8190ee /runtime/stack.cc | |
parent | e4bf2b84c61c6109dc4dda4952aa2ca29c52edd3 (diff) | |
download | art-5b417b97bd0e89ecd16d2215e0ff2eca5284e013.zip art-5b417b97bd0e89ecd16d2215e0ff2eca5284e013.tar.gz art-5b417b97bd0e89ecd16d2215e0ff2eca5284e013.tar.bz2 |
Fix old stack frame size check
The test underestimates the frame size for JNI frames, as not enough
overhead is accounted for.
Cherry-picked from commit 291088a2983ff954c137dddcc2ba7cb1c4cc95d2
Change-Id: I6ad96bc9b8eaecd6c888b91b3ffcfc4aeddc5eb8
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r-- | runtime/stack.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index abaea6f..15b288e 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -280,10 +280,12 @@ void StackVisitor::SanityCheckFrame() const { // Frame sanity. size_t frame_size = method->GetFrameSizeInBytes(); CHECK_NE(frame_size, 0u); - // A rough guess at an upper size we expect to see for a frame. The 256 is - // a dex register limit. The 16 incorporates callee save spills and - // outgoing argument set up. - const size_t kMaxExpectedFrameSize = 256 * sizeof(word) + 16; + // A rough guess at an upper size we expect to see for a frame. + // 256 registers + // 2 words Sirt overhead + // 3+3 register spills + // TODO: this seems architecture specific for the case of JNI frames. + const size_t kMaxExpectedFrameSize = (256 + 2 + 3 + 3) * sizeof(word); CHECK_LE(frame_size, kMaxExpectedFrameSize); size_t return_pc_offset = method->GetReturnPcOffsetInBytes(); CHECK_LT(return_pc_offset, frame_size); |