summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm_vixl.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2018-06-22 02:16:08 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-06-22 02:16:08 -0700
commit5f7748b6ec5b51afe8314f2c169f99a1f93a2053 (patch)
tree25879b7002fd0601f9ed0ac9b6ef0b7d84134f55 /compiler/optimizing/code_generator_arm_vixl.cc
parent0ad09c4b396d37f57eecca8b1f841fb99a1a0baf (diff)
parent077cc1c59c32f08c752c603bf991160c22eae9bb (diff)
Merge "Implement Integer.valueOf() intrinsic for PIC." am: ccfc88af4a am: 8e73527acf
am: 077cc1c59c Change-Id: If3a8ed8679e4fa8ef851b0c92e303473ef74a910
Diffstat (limited to 'compiler/optimizing/code_generator_arm_vixl.cc')
-rw-r--r--compiler/optimizing/code_generator_arm_vixl.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index 91c13154bb3..6804340cd42 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -27,6 +27,7 @@
#include "compiled_method.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "gc/accounting/card_table.h"
+#include "gc/space/image_space.h"
#include "heap_poisoning.h"
#include "intrinsics_arm_vixl.h"
#include "linker/linker_patch.h"
@@ -9536,6 +9537,22 @@ VIXLUInt32Literal* CodeGeneratorARMVIXL::DeduplicateJitClassLiteral(const DexFil
});
}
+void CodeGeneratorARMVIXL::LoadBootImageAddress(vixl32::Register reg, uint32_t boot_image_offset) {
+ DCHECK(!GetCompilerOptions().IsBootImage());
+ if (GetCompilerOptions().GetCompilePic()) {
+ DCHECK(Runtime::Current()->IsAotCompiler());
+ CodeGeneratorARMVIXL::PcRelativePatchInfo* labels = NewBootImageRelRoPatch(boot_image_offset);
+ EmitMovwMovtPlaceholder(labels, reg);
+ __ Ldr(reg, MemOperand(reg, /* offset */ 0));
+ } else {
+ gc::Heap* heap = Runtime::Current()->GetHeap();
+ DCHECK(!heap->GetBootImageSpaces().empty());
+ uintptr_t address =
+ reinterpret_cast<uintptr_t>(heap->GetBootImageSpaces()[0]->Begin() + boot_image_offset);
+ __ Ldr(reg, DeduplicateBootImageAddressLiteral(dchecked_integral_cast<uint32_t>(address)));
+ }
+}
+
template <linker::LinkerPatch (*Factory)(size_t, const DexFile*, uint32_t, uint32_t)>
inline void CodeGeneratorARMVIXL::EmitPcRelativeLinkerPatches(
const ArenaDeque<PcRelativePatchInfo>& infos,