Home / File/ todo-merge-ssa-phi-access-nodes.ts — react Source File

todo-merge-ssa-phi-access-nodes.ts — react Source File

Architecture documentation for todo-merge-ssa-phi-access-nodes.ts, a typescript file in the react codebase. 1 imports, 0 dependents.

File typescript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  43de443c_00e3_355b_dba8_17cde3efd2e8["todo-merge-ssa-phi-access-nodes.ts"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  43de443c_00e3_355b_dba8_17cde3efd2e8 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 43de443c_00e3_355b_dba8_17cde3efd2e8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {
  identity,
  makeObject_Primitives,
  setPropertyByKey,
} from 'shared-runtime';

/**
 * A bit of an edge case, but we could further optimize here by merging
 * re-orderability of nodes across phis.
 */
function useFoo(cond) {
  let x;
  if (cond) {
    /** start of scope for x_@0 */
    x = {};
    setPropertyByKey(x, 'a', {b: 2});
    /** end of scope for x_@0 */
    Math.max(x.a.b, 0);
  } else {
    /** start of scope for x_@1 */
    x = makeObject_Primitives();
    setPropertyByKey(x, 'a', {b: 3});
    /** end of scope for x_@1 */
    Math.max(x.a.b, 0);
  }
  /**
   * At this point, we have a phi node.
   * x_@2 = phi(x_@0, x_@1)
   *
   * We can assume that both x_@0 and x_@1 both have non-null `x.a` properties,
   * so we can infer that x_@2 does as well.
   */

  // Here, y should take a dependency on `x.a.b`
  const y = [];
  if (identity(cond)) {
    y.push(x.a.b);
  }
  return y;
}

export const FIXTURE_ENTRYPOINT = {
  fn: useFoo,
  params: [true],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does todo-merge-ssa-phi-access-nodes.ts do?
todo-merge-ssa-phi-access-nodes.ts is a source file in the react codebase, written in typescript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in todo-merge-ssa-phi-access-nodes.ts?
todo-merge-ssa-phi-access-nodes.ts defines 1 function(s): useFoo.
What does todo-merge-ssa-phi-access-nodes.ts depend on?
todo-merge-ssa-phi-access-nodes.ts imports 1 module(s): shared-runtime.
Where is todo-merge-ssa-phi-access-nodes.ts in the architecture?
todo-merge-ssa-phi-access-nodes.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/todo-merge-ssa-phi-access-nodes.ts (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps).

Analyze Your Own Codebase

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

Try Supermodel Free