ART tests: do not retrieve OatQuickMethodHeader for bridge methods

Some ART tests (e.g. 604-hot-static-interface) call
OatQuickMethodHeader::FromEntryPoint() for a method's quick compiled
code entry. If the entry has not been set to a compiled code then it
can be set to art_quick_to_interpreter_bridge. This method does not
have a OatQuickMethodHeader and FromEntryPoint() must not be called.

This patch fixes ART tests to retrieve OAT header only for methods
that reside in the JIT code cache.

Change-Id: I21105735f146e6c67c24c970a42451e3300c067c
Test: test-art-host-run-test-debug-prebuild-jit-relocate-ntrace-cms-checkjni-picimage-npictest-ndebuggable-604-hot-static-interface32
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
diff --git a/test/566-polymorphic-inlining/polymorphic_inline.cc b/test/566-polymorphic-inlining/polymorphic_inline.cc
index 00c1b02..b75becf 100644
--- a/test/566-polymorphic-inlining/polymorphic_inline.cc
+++ b/test/566-polymorphic-inlining/polymorphic_inline.cc
@@ -35,8 +35,9 @@
   OatQuickMethodHeader* header = nullptr;
   // Infinite loop... Test harness will have its own timeout.
   while (true) {
-    header = OatQuickMethodHeader::FromEntryPoint(method->GetEntryPointFromQuickCompiledCode());
-    if (code_cache->ContainsPc(header->GetCode())) {
+    const void* pc = method->GetEntryPointFromQuickCompiledCode();
+    if (code_cache->ContainsPc(pc)) {
+      header = OatQuickMethodHeader::FromEntryPoint(pc);
       break;
     } else {
       // Sleep to yield to the compiler thread.
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 4248148..d23c895 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -139,10 +139,9 @@
   }
 
   jit::JitCodeCache* code_cache = jit->GetCodeCache();
-  OatQuickMethodHeader* header = nullptr;
   while (true) {
-    header = OatQuickMethodHeader::FromEntryPoint(method->GetEntryPointFromQuickCompiledCode());
-    if (code_cache->ContainsPc(header->GetCode())) {
+    const void* pc = method->GetEntryPointFromQuickCompiledCode();
+    if (code_cache->ContainsPc(pc)) {
       break;
     } else {
       // Sleep to yield to the compiler thread.