Fix races in small mode compiler filters setup
Fixes host tests in small art mode.
Change-Id: I2579f872583f425607f91c1e58df68b05b5098bb
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 1e21736..bd36a6c 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -70,10 +70,6 @@
namespace art {
-extern "C" void artInterpreterToCompiledCodeBridge(Thread* self, MethodHelper& mh,
- const DexFile::CodeItem* code_item,
- ShadowFrame* shadow_frame, JValue* result);
-
static void ThrowNoClassDefFoundError(const char* fmt, ...)
__attribute__((__format__(__printf__, 1, 2)))
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
diff --git a/runtime/common_test.h b/runtime/common_test.h
index ced2af9..e2dda86 100644
--- a/runtime/common_test.h
+++ b/runtime/common_test.h
@@ -35,6 +35,7 @@
#include "gc/heap.h"
#include "gtest/gtest.h"
#include "instruction_set.h"
+#include "interpreter/interpreter.h"
#include "mirror/class_loader.h"
#include "oat_file.h"
#include "object_utils.h"
@@ -192,7 +193,6 @@
compiled_method =
compiler_driver_->GetCompiledMethod(MethodReference(&dex_file,
method->GetDexMethodIndex()));
- CHECK(compiled_method != NULL) << PrettyMethod(method);
}
if (compiled_method != NULL) {
const std::vector<uint8_t>& code = compiled_method->GetCode();
@@ -208,6 +208,7 @@
&compiled_method->GetVmapTable()[0],
NULL);
oat_method.LinkMethod(method);
+ method->SetEntryPointFromInterpreter(artInterpreterToCompiledCodeBridge);
} else {
const void* method_code;
// No code? You must mean to go into the interpreter.
@@ -221,6 +222,7 @@
NULL,
NULL);
oat_method.LinkMethod(method);
+ method->SetEntryPointFromInterpreter(interpreter::artInterpreterToInterpreterBridge);
}
}
diff --git a/runtime/entrypoints/interpreter/interpreter_entrypoints.cc b/runtime/entrypoints/interpreter/interpreter_entrypoints.cc
index f319a00..ecf98bc 100644
--- a/runtime/entrypoints/interpreter/interpreter_entrypoints.cc
+++ b/runtime/entrypoints/interpreter/interpreter_entrypoints.cc
@@ -27,8 +27,7 @@
extern "C" void artInterpreterToCompiledCodeBridge(Thread* self, MethodHelper& mh,
const DexFile::CodeItem* code_item,
- ShadowFrame* shadow_frame, JValue* result)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ ShadowFrame* shadow_frame, JValue* result) {
mirror::ArtMethod* method = shadow_frame->GetMethod();
// Ensure static methods are initialized.
if (method->IsStatic()) {
diff --git a/runtime/interpreter/interpreter.h b/runtime/interpreter/interpreter.h
index 49e8de0..efe11fc 100644
--- a/runtime/interpreter/interpreter.h
+++ b/runtime/interpreter/interpreter.h
@@ -53,6 +53,12 @@
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
} // namespace interpreter
+
+extern "C" void artInterpreterToCompiledCodeBridge(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame* shadow_frame, JValue* result)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
} // namespace art
#endif // ART_RUNTIME_INTERPRETER_INTERPRETER_H_
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index cc0559d..dcc9f90 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -4095,13 +4095,10 @@
DCHECK(Runtime::Current()->IsCompiler());
ReaderMutexLock mu(Thread::Current(), *dex_gc_maps_lock_);
DexGcMapTable::const_iterator it = dex_gc_maps_->find(ref);
- if (it == dex_gc_maps_->end()) {
- LOG(WARNING) << "Didn't find GC map for: " << PrettyMethod(ref.dex_method_index, *ref.dex_file);
- return NULL;
- } else {
- CHECK(it->second != NULL);
- return it->second;
- }
+ CHECK(it != dex_gc_maps_->end())
+ << "Didn't find GC map for: " << PrettyMethod(ref.dex_method_index, *ref.dex_file);
+ CHECK(it->second != NULL);
+ return it->second;
}
void MethodVerifier::SetDevirtMap(MethodReference ref,