Home / Function/ inferPhi() — react Function Reference

inferPhi() — react Function Reference

Architecture documentation for the inferPhi() function in InferMutationAliasingEffects.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4731f41f_7c10_ab87_ad4e_bf2ac6809c5b["inferPhi()"]
  7f9a06c8_8e18_76fc_0edd_1f0d608aae44["InferenceState"]
  4731f41f_7c10_ab87_ad4e_bf2ac6809c5b -->|defined in| 7f9a06c8_8e18_76fc_0edd_1f0d608aae44
  ac82e9ee_09bc_b58c_f2ac_86bf2d552540["inferBlock()"]
  ac82e9ee_09bc_b58c_f2ac_86bf2d552540 -->|calls| 4731f41f_7c10_ab87_ad4e_bf2ac6809c5b
  style 4731f41f_7c10_ab87_ad4e_bf2ac6809c5b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts lines 1653–1667

  inferPhi(phi: Phi): void {
    const values: Set<InstructionValue> = new Set();
    for (const [_, operand] of phi.operands) {
      const operandValues = this.#variables.get(operand.identifier.id);
      // This is a backedge that will be handled later by State.merge
      if (operandValues === undefined) continue;
      for (const v of operandValues) {
        values.add(v);
      }
    }

    if (values.size > 0) {
      this.#variables.set(phi.place.identifier.id, values);
    }
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does inferPhi() do?
inferPhi() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts.
Where is inferPhi() defined?
inferPhi() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts at line 1653.
What calls inferPhi()?
inferPhi() is called by 1 function(s): inferBlock.

Analyze Your Own Codebase

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

Try Supermodel Free