summaryrefslogtreecommitdiff
path: root/runtime/art_method.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-10-20 11:41:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-20 11:41:49 +0000
commit94e24ac0e9e2bad74e9beecbd068f2b87798b815 (patch)
treead07cc96f633bdae839ff2f1553d84b9c864a930 /runtime/art_method.cc
parentb697c447eb61c2e14315166ec3b0d16375ae403c (diff)
parent524e7ea8cd17bad17bd9f3e0ccbb19ad0d4d9c02 (diff)
Merge "Remove ArtCode."
Diffstat (limited to 'runtime/art_method.cc')
-rw-r--r--runtime/art_method.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index f9d9077261..f5befdfc07 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -384,4 +384,28 @@ const uint8_t* ArtMethod::GetQuickenedInfo() {
return oat_method.GetVmapTable();
}
+const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) {
+ if (IsRuntimeMethod() || IsProxyMethod()) {
+ return nullptr;
+ }
+
+ Runtime* runtime = Runtime::Current();
+ const void* code = runtime->GetInstrumentation()->GetQuickCodeFor(this, sizeof(void*));
+ DCHECK(code != nullptr);
+
+ if (runtime->GetClassLinker()->IsQuickGenericJniStub(code)) {
+ // The generic JNI does not have any method header.
+ return nullptr;
+ }
+
+ code = EntryPointToCodePointer(code);
+ OatQuickMethodHeader* method_header = reinterpret_cast<OatQuickMethodHeader*>(
+ reinterpret_cast<uintptr_t>(code) - sizeof(OatQuickMethodHeader));
+
+ // TODO(ngeoffray): validate the pc. Note that unit tests can give unrelated pcs (for
+ // example arch_test).
+ UNUSED(pc);
+ return method_header;
+}
+
} // namespace art