summaryrefslogtreecommitdiffstats
path: root/compiler/jni
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2015-04-07 20:32:43 +0100
committerDavid Srbecky <dsrbecky@google.com>2015-04-09 16:47:50 +0100
commitc6b4dd8980350aaf250f0185f73e9c42ec17cd57 (patch)
treeef8d73e37abc04aecb430072a8bc463c73398fee /compiler/jni
parentdd97393aca1a3ff2abec4dc4f78d7724300971bc (diff)
downloadandroid_art-c6b4dd8980350aaf250f0185f73e9c42ec17cd57.tar.gz
android_art-c6b4dd8980350aaf250f0185f73e9c42ec17cd57.tar.bz2
android_art-c6b4dd8980350aaf250f0185f73e9c42ec17cd57.zip
Implement CFI for Optimizing.
CFI is necessary for stack unwinding in gdb, lldb, and libunwind. Change-Id: I1a3480e3a4a99f48bf7e6e63c4e83a80cfee40a2
Diffstat (limited to 'compiler/jni')
-rw-r--r--compiler/jni/quick/jni_compiler.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index 49b7cd1aa5..8a14038074 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -28,6 +28,7 @@
#include "compiled_method.h"
#include "dex_file-inl.h"
#include "driver/compiler_driver.h"
+#include "driver/compiler_options.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "jni_env_ext.h"
#include "mirror/art_method.h"
@@ -93,6 +94,7 @@ CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver* driver,
// Assembler that holds generated instructions
std::unique_ptr<Assembler> jni_asm(Assembler::Create(instruction_set));
+ jni_asm->cfi().SetEnabled(driver->GetCompilerOptions().GetIncludeDebugSymbols());
// Offsets into data structures
// TODO: if cross compiling these offsets are for the host not the target
@@ -435,13 +437,18 @@ CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver* driver,
MemoryRegion code(&managed_code[0], managed_code.size());
__ FinalizeInstructions(code);
- return CompiledMethod::SwapAllocCompiledMethodCFI(driver,
- instruction_set,
- ArrayRef<const uint8_t>(managed_code),
- frame_size,
- main_jni_conv->CoreSpillMask(),
- main_jni_conv->FpSpillMask(),
- ArrayRef<const uint8_t>(*jni_asm->cfi().data()));
+ return CompiledMethod::SwapAllocCompiledMethod(driver,
+ instruction_set,
+ ArrayRef<const uint8_t>(managed_code),
+ frame_size,
+ main_jni_conv->CoreSpillMask(),
+ main_jni_conv->FpSpillMask(),
+ nullptr, // src_mapping_table.
+ ArrayRef<const uint8_t>(), // mapping_table.
+ ArrayRef<const uint8_t>(), // vmap_table.
+ ArrayRef<const uint8_t>(), // native_gc_map.
+ ArrayRef<const uint8_t>(*jni_asm->cfi().data()),
+ ArrayRef<const LinkerPatch>());
}
// Copy a single parameter from the managed to the JNI calling convention