@samitouri / QOS-React / commits / 7c7087811e

[compiler] printTerminal always prints instruction id

Doing some debugging I noticed that a few of the newer terminals kinds weren't printing the instruction id. ghstack-source-id: e0e4c96aeefdfe09d3be1527fd7103b4e506eb8e Pull Request resolved: https://github.com/facebook/react/pull/30397

Joe Savona committed Jul 23, 2024 at 10:07 UTC 7c7087811eaf7db5e783c35527be73bfb35b599e
1 file changed +9 -7
compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts
+9 -7
@@ -276,27 +276,29 @@ export function printTerminal(terminal: Terminal): Array<string> | string {
276 break;
277 }
278 case 'unsupported': {
279 - value = `Unsupported`;
279 + value = `[${terminal.id}] Unsupported`;
280 break;
281 }
282 case 'maybe-throw': {
283 - value = `MaybeThrow continuation=bb${terminal.continuation} handler=bb${terminal.handler}`;
283 + value = `[${terminal.id}] MaybeThrow continuation=bb${terminal.continuation} handler=bb${terminal.handler}`;
284 break;
285 }
286 case 'scope': {
287 - value = `Scope ${printReactiveScopeSummary(terminal.scope)} block=bb${
288 - terminal.block
289 - } fallthrough=bb${terminal.fallthrough}`;
287 + value = `[${terminal.id}] Scope ${printReactiveScopeSummary(
288 + terminal.scope,
289 + )} block=bb${terminal.block} fallthrough=bb${terminal.fallthrough}`;
290 break;
291 }
292 case 'pruned-scope': {
293 - value = `<pruned> Scope ${printReactiveScopeSummary(
293 + value = `[${terminal.id}] <pruned> Scope ${printReactiveScopeSummary(
294 terminal.scope,
295 )} block=bb${terminal.block} fallthrough=bb${terminal.fallthrough}`;
296 break;
297 }
298 case 'try': {
299 - value = `Try block=bb${terminal.block} handler=bb${terminal.handler}${
299 + value = `[${terminal.id}] Try block=bb${terminal.block} handler=bb${
300 + terminal.handler
301 + }${
302 terminal.handlerBinding !== null
303 ? ` handlerBinding=(${printPlace(terminal.handlerBinding)})`
304 : ''