From 547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52 Mon Sep 17 00:00:00 2001 From: Tong Shen Date: Tue, 5 Aug 2014 01:54:19 -0700 Subject: 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 --- compiler/jni/quick/jni_compiler.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/jni') 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 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 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 -- cgit v1.2.3