Make ART compile with GCC -O0 again.
Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on
architecture.
Add to instruction_set_test to warn when InstructionSetFeatures don't agree
with ones from system properties, AT_HWCAP and /proc/cpuinfo.
Clean-up class linker entry point logic to not return entry points but to
test whether the passed code is the particular entrypoint. This works around
image trampolines that replicate entrypoints.
Bug: 17993736
Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc
index 3fcc369..a9d30b6 100644
--- a/compiler/oat_test.cc
+++ b/compiler/oat_test.cc
@@ -95,7 +95,10 @@
: Compiler::kQuick;
InstructionSet insn_set = kIsTargetBuild ? kThumb2 : kX86;
- InstructionSetFeatures insn_features;
+ std::string error_msg;
+ std::unique_ptr<const InstructionSetFeatures> insn_features(
+ InstructionSetFeatures::FromFeatureString(insn_set, "default", &error_msg));
+ ASSERT_TRUE(insn_features.get() != nullptr) << error_msg;
compiler_options_.reset(new CompilerOptions);
verification_results_.reset(new VerificationResults(compiler_options_.get()));
method_inliner_map_.reset(new DexFileToMethodInlinerMap);
@@ -106,7 +109,7 @@
verification_results_.get(),
method_inliner_map_.get(),
compiler_kind, insn_set,
- insn_features, false, NULL, 2, true, true,
+ insn_features.get(), false, NULL, 2, true, true,
timer_.get()));
jobject class_loader = NULL;
if (kCompile) {
@@ -135,7 +138,6 @@
if (kCompile) { // OatWriter strips the code, regenerate to compare
compiler_driver_->CompileAll(class_loader, class_linker->GetBootClassPath(), &timings);
}
- std::string error_msg;
std::unique_ptr<OatFile> oat_file(OatFile::Open(tmp.GetFilename(), tmp.GetFilename(), NULL, false,
&error_msg));
ASSERT_TRUE(oat_file.get() != nullptr) << error_msg;
@@ -193,13 +195,16 @@
}
TEST_F(OatTest, OatHeaderIsValid) {
- InstructionSet instruction_set = kX86;
- InstructionSetFeatures instruction_set_features;
+ InstructionSet insn_set = kX86;
+ std::string error_msg;
+ std::unique_ptr<const InstructionSetFeatures> insn_features(
+ InstructionSetFeatures::FromFeatureString(insn_set, "default", &error_msg));
+ ASSERT_TRUE(insn_features.get() != nullptr) << error_msg;
std::vector<const DexFile*> dex_files;
uint32_t image_file_location_oat_checksum = 0;
uint32_t image_file_location_oat_begin = 0;
- std::unique_ptr<OatHeader> oat_header(OatHeader::Create(instruction_set,
- instruction_set_features,
+ std::unique_ptr<OatHeader> oat_header(OatHeader::Create(insn_set,
+ insn_features.get(),
&dex_files,
image_file_location_oat_checksum,
image_file_location_oat_begin,