summaryrefslogtreecommitdiff
path: root/compiler/image_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2014-08-01 19:04:18 +0100
committer Vladimir Marko <vmarko@google.com> 2014-09-25 18:56:34 +0100
commitf4da675bbc4615c5f854c81964cac9dd1153baea (patch)
treeea78bafc7ee543e11e7bd824ab40d5f5f3d82f9d /compiler/image_test.cc
parentf2476d524281c6d649f5deb6d1ccccc92380c1ed (diff)
Implement method calls using relative BL on ARM.
Store the linker patches with each CompiledMethod instead of keeping them in CompilerDriver. Reorganize oat file creation to apply the patches as we're writing the method code. Add framework for platform-specific relative call patches in the OatWriter. Implement relative call patches for ARM. Change-Id: Ie2effb3d92b61ac8f356140eba09dc37d62290f8
Diffstat (limited to 'compiler/image_test.cc')
-rw-r--r--compiler/image_test.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/image_test.cc b/compiler/image_test.cc
index f2a16e509f..2a37049a1d 100644
--- a/compiler/image_test.cc
+++ b/compiler/image_test.cc
@@ -62,6 +62,8 @@ TEST_F(ImageTest, WriteRead) {
oat_filename += "oat";
ScratchFile oat_file(OS::CreateEmptyFile(oat_filename.c_str()));
+ const uintptr_t requested_image_base = ART_BASE_ADDRESS;
+ ImageWriter writer(*compiler_driver_, requested_image_base);
{
{
jobject class_loader = NULL;
@@ -79,15 +81,15 @@ TEST_F(ImageTest, WriteRead) {
compiler_driver_->CompileAll(class_loader, class_linker->GetBootClassPath(), &timings);
t.NewTiming("WriteElf");
- ScopedObjectAccess soa(Thread::Current());
SafeMap<std::string, std::string> key_value_store;
- OatWriter oat_writer(class_linker->GetBootClassPath(), 0, 0, 0, compiler_driver_.get(), &timings,
- &key_value_store);
- bool success = compiler_driver_->WriteElf(GetTestAndroidRoot(),
- !kIsTargetBuild,
- class_linker->GetBootClassPath(),
- &oat_writer,
- oat_file.GetFile());
+ OatWriter oat_writer(class_linker->GetBootClassPath(), 0, 0, 0, compiler_driver_.get(),
+ &writer, &timings, &key_value_store);
+ bool success = writer.PrepareImageAddressSpace() &&
+ compiler_driver_->WriteElf(GetTestAndroidRoot(),
+ !kIsTargetBuild,
+ class_linker->GetBootClassPath(),
+ &oat_writer,
+ oat_file.GetFile());
ASSERT_TRUE(success);
}
}
@@ -95,11 +97,9 @@ TEST_F(ImageTest, WriteRead) {
std::unique_ptr<File> dup_oat(OS::OpenFileReadWrite(oat_file.GetFilename().c_str()));
ASSERT_TRUE(dup_oat.get() != NULL);
- const uintptr_t requested_image_base = ART_BASE_ADDRESS;
{
- ImageWriter writer(*compiler_driver_.get());
- bool success_image = writer.Write(image_file.GetFilename(), requested_image_base,
- dup_oat->GetPath(), dup_oat->GetPath());
+ bool success_image =
+ writer.Write(image_file.GetFilename(), dup_oat->GetPath(), dup_oat->GetPath());
ASSERT_TRUE(success_image);
bool success_fixup = ElfFixup::Fixup(dup_oat.get(), writer.GetOatDataBegin());
ASSERT_TRUE(success_fixup);