Home / Function/ mapInstructionValueOperands() — react Function Reference

mapInstructionValueOperands() — react Function Reference

Architecture documentation for the mapInstructionValueOperands() function in visitors.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  402caa76_ca9e_8ed9_593f_7843cf5f0ae8["mapInstructionValueOperands()"]
  2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"]
  402caa76_ca9e_8ed9_593f_7843cf5f0ae8 -->|defined in| 2f3caf55_cc64_415c_55dd_9771ba7dc210
  54e552b5_4821_f555_a702_7c29655eb512["mapInstructionOperands()"]
  54e552b5_4821_f555_a702_7c29655eb512 -->|calls| 402caa76_ca9e_8ed9_593f_7843cf5f0ae8
  876d58c8_bfce_a9d8_22c0_b40cc7e22553["inlineJsxTransform()"]
  876d58c8_bfce_a9d8_22c0_b40cc7e22553 -->|calls| 402caa76_ca9e_8ed9_593f_7843cf5f0ae8
  cb2f7895_375d_8f9b_5b0b_8dc1e7853e1f["mapCallArguments()"]
  402caa76_ca9e_8ed9_593f_7843cf5f0ae8 -->|calls| cb2f7895_375d_8f9b_5b0b_8dc1e7853e1f
  d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"]
  402caa76_ca9e_8ed9_593f_7843cf5f0ae8 -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6
  style 402caa76_ca9e_8ed9_593f_7843cf5f0ae8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts lines 453–658

export function mapInstructionValueOperands(
  instrValue: InstructionValue,
  fn: (place: Place) => Place,
): void {
  switch (instrValue.kind) {
    case 'BinaryExpression': {
      instrValue.left = fn(instrValue.left);
      instrValue.right = fn(instrValue.right);
      break;
    }
    case 'PropertyLoad': {
      instrValue.object = fn(instrValue.object);
      break;
    }
    case 'PropertyDelete': {
      instrValue.object = fn(instrValue.object);
      break;
    }
    case 'PropertyStore': {
      instrValue.object = fn(instrValue.object);
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'ComputedLoad': {
      instrValue.object = fn(instrValue.object);
      instrValue.property = fn(instrValue.property);
      break;
    }
    case 'ComputedDelete': {
      instrValue.object = fn(instrValue.object);
      instrValue.property = fn(instrValue.property);
      break;
    }
    case 'ComputedStore': {
      instrValue.object = fn(instrValue.object);
      instrValue.property = fn(instrValue.property);
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'DeclareContext':
    case 'DeclareLocal': {
      break;
    }
    case 'LoadLocal':
    case 'LoadContext': {
      instrValue.place = fn(instrValue.place);
      break;
    }
    case 'StoreLocal': {
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'StoreContext': {
      instrValue.lvalue.place = fn(instrValue.lvalue.place);
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'StoreGlobal': {
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'Destructure': {
      instrValue.value = fn(instrValue.value);
      break;
    }
    case 'NewExpression':
    case 'CallExpression': {
      instrValue.callee = fn(instrValue.callee);
      instrValue.args = mapCallArguments(instrValue.args, fn);
      break;
    }
    case 'MethodCall': {
      instrValue.receiver = fn(instrValue.receiver);
      instrValue.property = fn(instrValue.property);
      instrValue.args = mapCallArguments(instrValue.args, fn);
      break;
    }
    case 'UnaryExpression': {
      instrValue.value = fn(instrValue.value);
      break;
    }

Subdomains

Frequently Asked Questions

What does mapInstructionValueOperands() do?
mapInstructionValueOperands() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts.
Where is mapInstructionValueOperands() defined?
mapInstructionValueOperands() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts at line 453.
What does mapInstructionValueOperands() call?
mapInstructionValueOperands() calls 2 function(s): assertExhaustive, mapCallArguments.
What calls mapInstructionValueOperands()?
mapInstructionValueOperands() is called by 2 function(s): inlineJsxTransform, mapInstructionOperands.

Analyze Your Own Codebase

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

Try Supermodel Free