summaryrefslogtreecommitdiffstats
path: root/compiler/trampolines/trampoline_compiler.cc
diff options
context:
space:
mode:
authorDave Allison <dallison@google.com>2014-04-28 13:45:27 -0700
committerDave Allison <dallison@google.com>2014-06-05 12:45:20 -0700
commit65fcc2cf3c5cd97b84330c094908f3a6a7a8d4e7 (patch)
treefc0ce77d446477be37f0ec8c86d67df4941cac9b /compiler/trampolines/trampoline_compiler.cc
parente3b5cb502371aff7e7b7291facfc27b092e7803e (diff)
downloadandroid_art-65fcc2cf3c5cd97b84330c094908f3a6a7a8d4e7.tar.gz
android_art-65fcc2cf3c5cd97b84330c094908f3a6a7a8d4e7.tar.bz2
android_art-65fcc2cf3c5cd97b84330c094908f3a6a7a8d4e7.zip
Thumb2 assembler for JNI compiler and optimizing compiler
This provides a programmatic assembler for the thumb2 instruction set for ARM. The interface is the same as the ARM assembler and the ARM assembler has been moved into Arm32Assembler. The assembler handles most 16 and 32 bit instructions and also allows relocations due to branch expansion. It will also rewrite cbz/cbnz instructions if they go out of range. It also changes the JNI compiler to use the thumb2 assembler as opposed to forcing it to use ARM32. The trampoline compiler still uses ARM due to the way it returns the address of its generated code. A trampoline in thumb2 is the same size as that in ARM anyway (8 bytes). Provides gtest for testing the thumb2 instruction output. This gtest only runs on the host as it uses arm-eabi-objdump to disassemble the generated code. On the target the output is not checked but the assembler will still be run to perform all its checks. Change-Id: Icd9742b6f13541bec5b23097896727392e3a6fb6
Diffstat (limited to 'compiler/trampolines/trampoline_compiler.cc')
-rw-r--r--compiler/trampolines/trampoline_compiler.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/trampolines/trampoline_compiler.cc b/compiler/trampolines/trampoline_compiler.cc
index 24378b41aa..ac84d6ae40 100644
--- a/compiler/trampolines/trampoline_compiler.cc
+++ b/compiler/trampolines/trampoline_compiler.cc
@@ -30,6 +30,10 @@ namespace art {
namespace arm {
static const std::vector<uint8_t>* CreateTrampoline(EntryPointCallingConvention abi,
ThreadOffset<4> offset) {
+ // NOTE: the assembler used here is ARM, not Thumb. This is because the address
+ // returned by this function is a pointer and for thumb we would have to set the
+ // bottom bit. It doesn't matter since the instructions generated are the same
+ // size anyway.
std::unique_ptr<ArmAssembler> assembler(static_cast<ArmAssembler*>(Assembler::Create(kArm)));
switch (abi) {