Home / Function/ markInstructionIds() — react Function Reference

markInstructionIds() — react Function Reference

Architecture documentation for the markInstructionIds() function in HIRBuilder.ts from the react codebase.

Function typescript MIRInfrastructure HIR calls 3 called by 11

Entity Profile

Dependency Diagram

graph TD
  0c09df5a_6c07_11e5_1a6b_9253007463b8["markInstructionIds()"]
  df6865e0_b573_e905_84d6_4eb6b419a888["HIRBuilder.ts"]
  0c09df5a_6c07_11e5_1a6b_9253007463b8 -->|defined in| df6865e0_b573_e905_84d6_4eb6b419a888
  67879f67_c0fc_dc2d_b736_b9213153bc4a["buildReactiveScopeTerminalsHIR()"]
  67879f67_c0fc_dc2d_b736_b9213153bc4a -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  5dec5bb8_e0f9_d79d_1c1d_65a05ff57391["build()"]
  5dec5bb8_e0f9_d79d_1c1d_65a05ff57391 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  dad92af5_71c7_94b3_8cce_ac3af87f3e61["dropManualMemoization()"]
  dad92af5_71c7_94b3_8cce_ac3af87f3e61 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  3522f83b_2dff_3c9f_920f_3e428eb62b31["inferEffectDependencies()"]
  3522f83b_2dff_3c9f_920f_3e428eb62b31 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  d77babff_42d3_5fdf_4059_c0b9e7cfaeb0["inlineImmediatelyInvokedFunctionExpressions()"]
  d77babff_42d3_5fdf_4059_c0b9e7cfaeb0 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  fbdc3953_3621_331c_a5b1_d3199bea5254["constantPropagationImpl()"]
  fbdc3953_3621_331c_a5b1_d3199bea5254 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  876d58c8_bfce_a9d8_22c0_b40cc7e22553["inlineJsxTransform()"]
  876d58c8_bfce_a9d8_22c0_b40cc7e22553 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  d3225c91_4858_fca4_72c5_c74a4f05f299["lowerContextAccess()"]
  d3225c91_4858_fca4_72c5_c74a4f05f299 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  c059451e_3ed5_62a9_6995_a4adbca6d62c["emitSelectorFn()"]
  c059451e_3ed5_62a9_6995_a4adbca6d62c -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  82b1d221_48c8_7d34_669c_abce4ff71f21["pruneMaybeThrows()"]
  82b1d221_48c8_7d34_669c_abce4ff71f21 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  38224692_55f3_a937_63fd_e0266e855650["replaceFireFunctions()"]
  38224692_55f3_a937_63fd_e0266e855650 -->|calls| 0c09df5a_6c07_11e5_1a6b_9253007463b8
  041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"]
  0c09df5a_6c07_11e5_1a6b_9253007463b8 -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e
  1bdf9e01_ffb0_1422_a451_e62965a1969b["printInstruction()"]
  0c09df5a_6c07_11e5_1a6b_9253007463b8 -->|calls| 1bdf9e01_ffb0_1422_a451_e62965a1969b
  style 0c09df5a_6c07_11e5_1a6b_9253007463b8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts lines 812–826

export function markInstructionIds(func: HIR): void {
  let id = 0;
  const visited = new Set<Instruction>();
  for (const [_, block] of func.blocks) {
    for (const instr of block.instructions) {
      CompilerError.invariant(!visited.has(instr), {
        reason: `${printInstruction(instr)} already visited!`,
        loc: instr.loc,
      });
      visited.add(instr);
      instr.id = makeInstructionId(++id);
    }
    block.terminal.id = makeInstructionId(++id);
  }
}

Subdomains

Frequently Asked Questions

What does markInstructionIds() do?
markInstructionIds() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts.
Where is markInstructionIds() defined?
markInstructionIds() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIRBuilder.ts at line 812.
What does markInstructionIds() call?
markInstructionIds() calls 3 function(s): invariant, makeInstructionId, printInstruction.
What calls markInstructionIds()?
markInstructionIds() is called by 11 function(s): build, buildReactiveScopeTerminalsHIR, constantPropagationImpl, dropManualMemoization, emitSelectorFn, inferEffectDependencies, inlineImmediatelyInvokedFunctionExpressions, inlineJsxTransform, and 3 more.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free