Skip to content

JIT on Windows #27

@trungnt2910

Description

@trungnt2910

Opening this issue to track the problems preventing JIT on Windows from happening yet.

From my own experience, the problem is due to the difference between Windows calling convention and Sys-V.

  • x86_64 Windows and x86_64 Sys-V passes arguments in different registers. A solution might be just keep using the Sys-V ABI in the JITted code and make a trampoline before returning to compiled Windows code.
  • FS - GS register differences. Although as JIT already works on macOS (which also uses different FS/GS than Linux), I guess the same can be applied to Windows?
  • x86_64 Sys-V requires a 128-byte red zone below rsp, while x86_64 Windows does not. When jumping to JIT code, the value of rsp must be 128 bytes lower than it is supposed to be, and all read/write operations involving rsp must be hooked to modify the value. Things will get tricky when dealing with opcodes such as call,...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions