SIGN IN SIGN UP

perf(packages/codegen): split recording mappings into multiple functions (#25978)

Optimization to sourcemap builds.

Previously one `recordSourceMapping` function handled all types of mappings, and branched on `location` to decide how to behave.

Instead, break it into separate `markMapStart`, `markMapEnd`, `markMapAfter`, `markMapAtStartOffset`, and `markMapNamed` functions which each select the right point to make the mapping. The main functionality that was in `recordSourceMapping` is moved into 2 helper functions `hasMappableSpan` and `recordMapping`.

This removes branches, and removes the heavy code for named mappings from all the paths which don't produce named mappings. `markMapStart` and the rest become minimal and are more likely to be inlined.
O
overlookmotel committed
5b43c603866da8f226169fb86b3248e6365cf0d7
Parent: 8a353a7