1 / 29

Replay Compilation: Improving Debuggability of a Just-in Time Complier

Replay Compilation: Improving Debuggability of a Just-in Time Complier. Presenter: Jun Tao. Outline. Introduction Behavior of a Dynamic Compiler Overview of Replay Compilation Implementation Experimental Results. Introduction. Difficulties in debugging with a dynamic compiler

nanji
Download Presentation

Replay Compilation: Improving Debuggability of a Just-in Time Complier

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao

  2. Outline • Introduction • Behavior of a Dynamic Compiler • Overview of Replay Compilation • Implementation • Experimental Results

  3. Introduction • Difficulties in debugging with a dynamic compiler • Static compiler • Recompile and produce diagnostic output • Dynamic compiler • Recompilation may not work • Non-determinism in execution order • Applied optimization might change • Runtime information: resolution status, classes hierarchy, runtime profile

  4. Introduction • Reproducing the Compilation • Invoke a dynamic compiler as if it were a stand-alone tool • Reproduce the inputs

  5. Introduction • Solutions: trace-and-replay • Ordering-based • Record and replay the order of synchronization events • Compiler operates deterministically • Results may change because non-deterministic input • Content-based • Save and restore the values of the input • Generates prohibitively large amount of data • Significantly increases the execution time

  6. Introduction • Other Solution • First error data capture (FEDC) • Uses special hardware, firmware and software to record information • Efficient

  7. Introduction • Replay JIT compilation • Content-based trace-and-replay approach • State-saving compiler • Records information into a log, which is in main memory • Replaying compiler • Reproduce the problem by using the system dump • Confidence-based filtering • Only save inputs of methods that are likely to cause errors

  8. Behavior of a Dynamic Compiler • Static compiler • Invoked by users • Source files • Options as command line arguments • Dynamic compiler • A component of a virtual machine • Determines which methods to compile with what set of options • Inputs are provided as runtime data structures

  9. Behavior of a Dynamic Compiler • Runtime information as inputs • System configuration data • Configuration of hardware and software • Command line options and the environment variables • Virtual machine states • Set of classes that have been initialized • Address of the compiled optimizations • Class hierarchy of the loaded classes • Resolution statuses of external references • Runtime profile • Runtime profiler output • Optimization level

  10. Behavior of a Dynamic Compiler • Variable and Fixed Inputs • Variable inputs • May change after a compilation of a method • Virtual machine status • Runtime profiles • Fixed Inputs • Target methods • System configuration

  11. Overview of Replay Compilation • System Dump Based Approach • Virtual machine must be configured to generate a system dump at crashes and user interrupts • Avoids expensive I/O • Suffices to invoke the replaying compiler with the system dump • Replaying compiler can be invoked in a different platform

  12. Overview of Replay Compilation • Log Structure • Input by data structure access • Records a pair of the address and the value into a log • Retrieve the value by using the address as a key • Input in a function call • Records into a log the return value together with a list of function identifier and the parameter values • Retrieves the return value by using the list as a key • The values for fixed inputs can be saved at the time of creating the system dump

  13. Overview of Replay Compilation • Building State-saving and Replaying Compilers • Uses different macros, depending on input types

  14. Building State-saving and Replaying Compilers (continued)

  15. Building State-saving and Replaying Compilers (continued)

  16. Overview of Replay Compilation • Replaying the Compilation • User invokes the replaying compiler and specifies method signatures or addresses of compiled code • Replay compiler load the system dump into its address space • Adjust the address used in state-saving process • Can be avoid by restoring a system dump into the same address as the state-saving address

  17. Overview of Replay Compilation • Further reducing the size of log • Compress the logs • Exploit default values • Confidence-based filtering • Increase the confidence of a method, if the method is in heavily used libraries • Decrease the confidence of a method, if the control flow of the method is complex

  18. Overview of Replay Compilation • Some other topics • We can use different set of options to narrow down the cause of options • System dump will not include the data structures for unloaded classes • Ignore • Store the data structure when it is unloaded

  19. Implementation • State-Saving Compiler • Allocates a memory area as the log for each compilation of a method • Compresses each log • Associates each log with the address of the JIT-compiled code

  20. Implementation • State-Saving Compiler (continued) • Creates an anchor structure • Markers in its header and trailer • Size • Version number of the state-saving compiler • A link list of the logs • Another pointer called current log • Should not be accessible in the list of complete logs

  21. Implementation • Replaying Compiler • Restores a system dump • Scans the markers • Scans the list for the log

  22. Experiment Results

  23. Experiment Results

  24. Experiment Results

  25. Experiment Results

  26. Experiment Results

  27. Conclusion • State-saving compiler saves inputs in logs • Replaying compiler gets logs from system dump • Logs reside in main memory • Compression and filtering are used

  28. Questions ?

More Related