Menu

1.0 source code uploaded

MRP with harmony lib can now pass all dacapo-2006 test cases, and all dacapo-9.12-bach test cases with one exception as batik. Harmoy awt implementation has non-implemented methods.
Implementation details:
1. ELF generation
This library uses RandomAccess file to output bytes to hard disk and pass the object to native code to register with GDB. Native code implemented as JikesRVM SysCall. It will map the object file into memory and then manage register and remove of the compiled method.
To fill in length field in object file, elf4j uses placeholders. This lib will update all placeholders after written out content body.
ELF file sections include: ".shstrtab", ".strtab", ".symtab", ".text", ".eh_frame" or ".debug_frame", ".debug_line", ".debug_str", ".debug_abbrev", ".debug_info", ".debug_aranges", ".debug_pubnames", ".debug_pubtypes".
.text section is filled with RVM binary code.
.debug_line is extracted from BaseLineCompiler byteCodeMap or OptCompiler _mcMap.
.eh_frame is extracted from recorded information in CompiledMethod. Enhanced BaseLineCompiler, OptCompiler and JNICompiler will store push $rsp, mov $fp $rsp, pop $fp, ret instrution offset for later use. Also they will store first local offset on stack with __local0 variable. Parameters may be available for BaselineCompiled method. For OptCompiled method, first 2 parameter value stored in registers may not be on stack. They have to be manually obtained from local stack and not parameter stack.
2. DWARF generation
To write symbols into object file, both place holder and reference resolution is used. .debug_info need to reference user defined types, and the target object is cached for writer to obtain actual location in object file. ELF4j works with stack and registers, so it normalize Java variables into following kind: I32,I64,F32,F64,Array,Reference,Void. Java parameters will be displayed as the corresponding type and indicate either address or value. Line number state program and Call frame state program has been used. Users can use bt, next and see line number in GDB.
3. Exported method for GDB
As a defect of MRP exists (http://jira.codehaus.org/browse/MRP-110), functions to inspect VM is limited. Exported C method currently can't start new thread and call back into VM, the thread state is incorrect. Also if GC or certain kind of frame traversal is triggered, VM will report ip within unexpected method.
A workaround is used, a Uninterruptible method is used to avoid GC and traversal, and instance field is used to avoid Calling convention transform. In future releases, more powerful inspection method will be provided. Those method will be able to show Java frame information and dynamically register method.

Posted by Da Feng 2011-10-29 | Draft

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.