Skip to main content

specialize

Function specialize 

Source
pub fn specialize(program: &Program, shape: &Shape) -> Program
Expand description

Specialize a program against a known document Shape. Current rewrites:

  • OptField(k)GetField(k) when shape guarantees the field exists (removes per-access None-check branch).
  • KindCheck folded to a PushBool when shape at that path is known.

Returns a new Program with the same source/id.