Skip to content

Dynamic recompiler #82

@MarkMcCaskey

Description

@MarkMcCaskey

This is an issue for figuring out the plans for the dynamic recompiler. We'll plan here then file issues or make a milestone to track the progress.

  • Implement full streaming opcode parsing in gameboy-rom-parser
  • Come up with name for dynamic recompiler project
  • Design IR (look at LLVM, look at Rust's MIR, look up algorithms for SSA)
  • Implement IR backend for x86_64
  • Map gameboy opcodes to IR
  • Implement basic-block detector (research tracing JITs)
  • Design trapping or otherwise handle bad memory accesses (switching ROM banks, self-modifying code)
  • Design and create Rust -> generated code transition and generated code -> Rust transition
  • Design and implement efficient caching mechanism (does compiled code for this basic block exist)
  • Design and implement metering (do some analysis on worst cases of falling back to interpreter when a basic-block exceeds the gas budget)
  • Design, research, and implement optimizing loops as a single chunk of generated code when possible
  • Design and implement memory access flow tracking, preventing slow memory checks when we know what part of memory will be accessed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions