From: Serguei Katkov Date: Fri, 29 Aug 2014 11:20:15 +0000 (+0700) Subject: ART: Fix computation of frame size for direct proxy methods X-Git-Tag: android-x86-6.0-r1~145^2~2^2~234^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=481458d4e8e9c3677249bfd82d36273bf97412fb;p=android-x86%2Fart.git ART: Fix computation of frame size for direct proxy methods Proxy method has only one direct method and it is a constructor which is cloned from java.lang.reflect.Proxy class together with code. As a result its body is a compiled quick code and frame size should be computed accordingly in contrast with other virtual methods which are invoked through stub. Change-Id: I0ac99b2f567b281c9342152bad1149dd6cd39480 Signed-off-by: Serguei Katkov (cherry picked from commit 805bab1738549b2477b3ad4d9d57fd7c681451b9) --- diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h index 58321c711..fbbe1b6b1 100644 --- a/runtime/mirror/art_method-inl.h +++ b/runtime/mirror/art_method-inl.h @@ -347,7 +347,11 @@ inline QuickMethodFrameInfo ArtMethod::GetQuickFrameInfo() { return QuickMethodFrameInfo(kStackAlignment, 0u, 0u); } Runtime* runtime = Runtime::Current(); - if (UNLIKELY(IsAbstract()) || UNLIKELY(IsProxyMethod())) { + // For Proxy method we exclude direct method (there is only one direct method - constructor). + // Direct method is cloned from original java.lang.reflect.Proxy class together with code + // and as a result it is executed as usual quick compiled method without any stubs. + // So the frame info should be returned as it is a quick method not a stub. + if (UNLIKELY(IsAbstract()) || UNLIKELY(IsProxyMethod() && !IsDirect())) { return runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsAndArgs); } if (UNLIKELY(IsRuntimeMethod())) {