Skip to content

JIT: compile general resumable baseline regions with precise stack maps #466

Description

@chrisbbreuer

Parent: #459
Depends on: #465, #461

Goal

Turn the baseline JIT into a general resumable native region tier with precise stack maps, rather than rejecting whole chunks or relying on VM quick kernels for most nonnumeric work.

Current boundary

#52 completed the safe numeric/control baseline. Arithmetic profiles at 93.3% generated leaves, but the saved baseline profile attributes properties and arrays largely to VM kernels/residual dispatch. docs/baseline-jit.md still identifies resumable side exits and precise native stack maps as future work.

Scope

  • Compile maximal supported bytecode regions and emit exact side exits at unsupported/effectful boundaries instead of rejecting an otherwise profitable chunk.
  • Extend NativeFrame recovery state for operand stack, accumulator, locals/environments, handler stack, call/construct state, and precise source IP.
  • Generate precise stack maps at calls, backedges, allocation points, traps, and debugger/termination checkpoints so managed values may safely remain in registers between safepoints.
  • Cover ordinary calls, property/index access, allocations, typed operations, exceptions, and structured control through direct code or narrow rooted runtime stubs.
  • Add per-opcode/region admission and side-exit counters plus symbolized attribution.
  • Preserve immutable publication, W^X, cached rejection, context teardown, epoch retirement, and shared-realm safety.

No-workaround rules

  • No benchmark-shaped quick kernel, source recognition, unsafe register root, restart-after-observable-effect exit, or silent step/watchdog undercount.
  • A runtime stub must be a narrow semantic operation, not the entire bytecode interpreter hidden behind one native call.

Acceptance

Foundation

#52; baseline design; numeric register work began at 79e6ba92.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjitBytecode, baseline JIT, optimizer, and code generationperformanceMeasured runtime, memory, scaling, or build performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions