Home / Function/ print() — react Function Reference

print() — react Function Reference

Architecture documentation for the print() function in EnterSSA.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  15c5a766_a413_af71_26b0_36d96679a9d4["print()"]
  f11adc00_6af6_2575_4ee8_974e26f2a6ed["SSABuilder"]
  15c5a766_a413_af71_26b0_36d96679a9d4 -->|defined in| f11adc00_6af6_2575_4ee8_974e26f2a6ed
  073c81a5_c389_d108_5b8f_4d6dc6eece83["push()"]
  15c5a766_a413_af71_26b0_36d96679a9d4 -->|calls| 073c81a5_c389_d108_5b8f_4d6dc6eece83
  e7a01d7c_c128_be66_a07d_007952a380da["printIdentifier()"]
  15c5a766_a413_af71_26b0_36d96679a9d4 -->|calls| e7a01d7c_c128_be66_a07d_007952a380da
  bf7f1cf7_fc0e_6bac_827c_8d36d98126da["printPlace()"]
  15c5a766_a413_af71_26b0_36d96679a9d4 -->|calls| bf7f1cf7_fc0e_6bac_827c_8d36d98126da
  style 15c5a766_a413_af71_26b0_36d96679a9d4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts lines 218–237

  print(): void {
    const text: Array<string> = [];
    for (const [block, state] of this.#states) {
      text.push(`bb${block.id}:`);
      for (const [oldId, newId] of state.defs) {
        text.push(`  \$${printIdentifier(oldId)}: \$${printIdentifier(newId)}`);
      }

      for (const incompletePhi of state.incompletePhis) {
        text.push(
          `  iphi \$${printPlace(
            incompletePhi.newPlace,
          )} = \$${printPlace(incompletePhi.oldPlace)}`,
        );
      }
    }

    text.push(`current block: bb${this.#current?.id}`);
    console.log(text.join('\n'));
  }

Subdomains

Frequently Asked Questions

What does print() do?
print() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts.
Where is print() defined?
print() is defined in compiler/packages/babel-plugin-react-compiler/src/SSA/EnterSSA.ts at line 218.
What does print() call?
print() calls 3 function(s): printIdentifier, printPlace, push.

Analyze Your Own Codebase

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

Try Supermodel Free