diff options
| author | 2014-11-22 02:13:20 +0000 | |
|---|---|---|
| committer | 2014-11-22 02:13:21 +0000 | |
| commit | 022b46cb09a6189797fb3e77dbe7673a3d59249f (patch) | |
| tree | f3440544c000174e72508ff3561e0e984f9f09f9 | |
| parent | 124cd8f768436e082ca0dfed8f1e4f4713220e44 (diff) | |
| parent | e14f2b3047fd310c5df65cf13470aa2786522a3b (diff) | |
Merge "Fixed ArtMethod::GetQuickFrameInfo() for proxy methods"
| -rw-r--r-- | runtime/mirror/art_method.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/runtime/mirror/art_method.cc b/runtime/mirror/art_method.cc index 6d4af83058..4f5ca3fe5d 100644 --- a/runtime/mirror/art_method.cc +++ b/runtime/mirror/art_method.cc @@ -436,13 +436,27 @@ QuickMethodFrameInfo ArtMethod::GetQuickFrameInfo() { return QuickMethodFrameInfo(kStackAlignment, 0u, 0u); } Runtime* runtime = Runtime::Current(); - // 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())) { + + if (UNLIKELY(IsAbstract())) { return runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsAndArgs); } + + // For Proxy method we add special handling for the direct method case (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. However, if instrumentation stubs are installed, the + // instrumentation->GetQuickCodeFor() returns the artQuickProxyInvokeHandler instead of an + // oat code pointer, thus we have to add a special case here. + if (UNLIKELY(IsProxyMethod())) { + if (IsDirect()) { + CHECK(IsConstructor()); + return GetQuickFrameInfo(EntryPointToCodePointer(GetEntryPointFromQuickCompiledCode())); + } else { + return runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsAndArgs); + } + } + if (UNLIKELY(IsRuntimeMethod())) { return runtime->GetRuntimeMethodFrameInfo(this); } |