#include "mirror/class_loader.h"
#include "mirror/dex_cache.h"
#include "nodes.h"
+#include "optimizing_compiler.h"
#include "reference_type_propagation.h"
#include "register_allocator.h"
#include "ssa_phi_elimination.h"
// We use the original invoke type to ensure the resolution of the called method
// works properly.
if (!TryInline(call, call->GetDexMethodIndex())) {
- if (kIsDebugBuild) {
+ if (kIsDebugBuild && IsCompilingWithCoreImage()) {
std::string callee_name =
PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile());
bool should_inline = callee_name.find("$inline$") != std::string::npos;
CHECK(!should_inline) << "Could not inline " << callee_name;
}
} else {
- if (kIsDebugBuild) {
+ if (kIsDebugBuild && IsCompilingWithCoreImage()) {
std::string callee_name =
PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile());
bool must_not_inline = callee_name.find("$noinline$") != std::string::npos;
{
PassScope scope(HGraphBuilder::kBuilderPassName, &pass_observer);
if (!builder.BuildGraph(*code_item)) {
- CHECK(!shouldCompile) << "Could not build graph in optimizing compiler";
+ DCHECK(!(IsCompilingWithCoreImage() && shouldCompile))
+ << "Could not build graph in optimizing compiler";
pass_observer.SetGraphInBadState();
return nullptr;
}
return new OptimizingCompiler(driver);
}
+bool IsCompilingWithCoreImage() {
+ const std::string& image = Runtime::Current()->GetImageLocation();
+ return EndsWith(image, "core.art") || EndsWith(image, "core-optimizing.art");
+}
+
} // namespace art
Compiler* CreateOptimizingCompiler(CompilerDriver* driver);
+// Returns whether we are compiling against a "core" image, which
+// is an indicative we are running tests. The compiler will use that
+// information for checking invariants.
+bool IsCompilingWithCoreImage();
+
} // namespace art
#endif // ART_COMPILER_OPTIMIZING_OPTIMIZING_COMPILER_H_