summaryrefslogtreecommitdiffstats
path: root/compiler/jni
diff options
context:
space:
mode:
authorTong Shen <endlessroad@google.com>2014-08-05 01:54:19 -0700
committerTong Shen <endlessroad@google.com>2014-08-05 11:11:33 -0700
commit547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52 (patch)
tree078d52b6025fc1e42b7343550b0dbbdad69eafac /compiler/jni
parent8b62dc0f993d0445401655fc274e5225498fa81c (diff)
downloadandroid_art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.tar.gz
android_art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.tar.bz2
android_art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.zip
Emit CFI for x86 & x86_64 JNI compiler.
Now for host-side x86 & x86_64 ART, we are able to get complete stacktrace with even mixed C/C++ & Java stack frames. Testing: 1. art/test/run-test --host --gdb [--64] --no-relocate 005 2. In gdb, run 'b art::Class_classForName' which is implementation of a Java native method, then 'r' 3. In gdb, run 'bt'. You should see stack frames down to main() Change-Id: I2d17e9aa0f6d42d374b5362a15ea35a2fce96302
Diffstat (limited to 'compiler/jni')
-rw-r--r--compiler/jni/quick/jni_compiler.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index c38cfaf746..1a35da071c 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -90,6 +90,7 @@ CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver* driver,
// Assembler that holds generated instructions
std::unique_ptr<Assembler> jni_asm(Assembler::Create(instruction_set));
+ jni_asm->InitializeFrameDescriptionEntry();
// Offsets into data structures
// TODO: if cross compiling these offsets are for the host not the target
@@ -432,12 +433,14 @@ CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver* driver,
std::vector<uint8_t> managed_code(cs);
MemoryRegion code(&managed_code[0], managed_code.size());
__ FinalizeInstructions(code);
+ jni_asm->FinalizeFrameDescriptionEntry();
return new CompiledMethod(driver,
instruction_set,
managed_code,
frame_size,
main_jni_conv->CoreSpillMask(),
- main_jni_conv->FpSpillMask());
+ main_jni_conv->FpSpillMask(),
+ jni_asm->GetFrameDescriptionEntry());
}
// Copy a single parameter from the managed to the JNI calling convention