diff options
author | Andreas Gampe <agampe@google.com> | 2014-05-28 22:43:01 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-05-29 20:50:49 -0700 |
commit | cf4035a4c41ccfcc3e89a0cee25f5218a11b0705 (patch) | |
tree | 323d9e98e6129c67e464a3e6857ee02593a2f2c2 /runtime/mirror | |
parent | 29b53d3d715b1ec19349e8cbf7c5e4ff529bd5fe (diff) | |
download | art-cf4035a4c41ccfcc3e89a0cee25f5218a11b0705.tar.gz art-cf4035a4c41ccfcc3e89a0cee25f5218a11b0705.tar.bz2 art-cf4035a4c41ccfcc3e89a0cee25f5218a11b0705.zip |
ART: Use StackReference in Quick Stack Frame
The method reference at the bottom of a quick frame is a stack
reference and not a native pointer. This is important for 64b
architectures, where the notions do not coincide.
Change key methods to have StackReference<mirror::ArtMethod>*
parameter instead of mirror::ArtMethod**. Make changes to
invoke stubs for 64b archs, change the frame setup for JNI code
(both generic JNI and compilers), tie up loose ends.
Tested on x86 and x86-64 with host tests. On x86-64, tests succeed
with jni compiler activated. x86-64 QCG was not tested.
Tested on ARM32 with device tests.
Fix ARM64 not saving x19 (used for wSUSPEND) on upcalls.
Tested on ARM64 in interpreter-only + generic-jni mode.
Fix ARM64 JNI Compiler to work with the CL.
Tested on ARM64 in interpreter-only + jni compiler.
Change-Id: I77931a0cbadd04d163b3eb8d6f6a6f8740578f13
Diffstat (limited to 'runtime/mirror')
-rw-r--r-- | runtime/mirror/art_method-inl.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h index 39efa58ab1..5f4619b394 100644 --- a/runtime/mirror/art_method-inl.h +++ b/runtime/mirror/art_method-inl.h @@ -296,10 +296,16 @@ inline QuickMethodFrameInfo ArtMethod::GetQuickFrameInfo() { // Generic JNI frame. DCHECK(IsNative()); uint32_t handle_refs = MethodHelper(this).GetNumberOfReferenceArgsWithoutReceiver() + 1; - size_t scope_size = HandleScope::GetAlignedHandleScopeSize(handle_refs); + size_t scope_size = HandleScope::SizeOf(handle_refs); QuickMethodFrameInfo callee_info = runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsAndArgs); - return QuickMethodFrameInfo(callee_info.FrameSizeInBytes() + scope_size, - callee_info.CoreSpillMask(), callee_info.FpSpillMask()); + + // Callee saves + handle scope + method ref + alignment + size_t frame_size = RoundUp(callee_info.FrameSizeInBytes() + scope_size + - kPointerSize // callee-save frame stores a whole method pointer + + sizeof(StackReference<mirror::ArtMethod>), + kStackAlignment); + + return QuickMethodFrameInfo(frame_size, callee_info.CoreSpillMask(), callee_info.FpSpillMask()); } const void* code_pointer = EntryPointToCodePointer(entry_point); |