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 except batik. Harmoy awt implementation has non-implemented methods. This project provided the critical VM level debugging tools.

Implementation details:

  1. ELF generation

    This library uses RandomAccess file to output bytes to hard disk and passes the resulting object file to native code to register with GDB. Native code is implemented as JikesRVM SysCall. It maps the object file into memory and then manages the registering and removal of the compiled method.
    To fill in length field in object file, elf4j uses placeholders. This lib updates all placeholders after content body is written out.
    ELF file sections include: ".shstrtab", ".strtab", ".symtab", ".text", ".eh_frame" | ".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 stores instrution offset of following operations for later use:push $rsp, mov $fp $rsp, pop $fp, ret. Also they will store first local offset on stack inside __local0 variable. Parameters is available for BaselineCompiled method. For OptCompiled method, first 2 parameter value stored in registers may not be available on stack. They have to be manually fetched from local stack and not parameter stack.

  2. DWARF generation

    To write dwarf symbols into object file, both place holder and reference resolution is used. .debug_info section needs 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 normalizes Java variables into following kind: I32,I64,F32,F64,Array,Reference,Void. Java parameters are displayed as the corresponding type and indicating either their address or value. Line number state program and Call frame state program is supported. Users can use bt command, next command and find line number in GDB.

  3. Exported method for GDB

    As a defect of MRP exists, 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 other 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 methods. Eclipse plugin and GUI support may be added.

Posted by Da Feng 2011-10-29 Labels: internals

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.