[source maps] Add support for scopes proposal call stacks #9400
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 174 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.309
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9400"
general
weight: 0.35
tlively
The scopes proposal extends source maps to add inlined call stacks and
variable bindings:
https://tc39.es/ecma426/branch/proposal-scopes/#sec-source-map-format
This PR adds support for call stacks. We can now read the "scopes" and
"ranges" additions to the spec, and write them. To support multiple call
stacks for each expression in our IR, we shift from storing a single
DebugLocation to a SmallVector of them. When we inline, we simply
push more scopes on the stack.
For convenience and for debuggability, the
;;@ src.cpp:10:5:funcnameannotations are extended to support multiple scopes. For example, if we
have
then after inlining we'd have this:
That
nopis now annotated as having a call stack of both thecaller and the inlined code, as if we never inlined. The
;;@annotations are simply the stack frames in order.
Most of the changes in this PR are simple things that fall out
of the move from a single DebugLocation to a vector of them.
Otherwise, Inlining is extended to concatenate inlined stacks,
and then there are the messy details of the source maps
format itself (which is quite complex and uses VLQ encoding).