How to use the @glimmer/interfaces.MachineOp.InvokeStatic function in @glimmer/interfaces

To help you get started, we’ve selected a few @glimmer/interfaces examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glimmerjs / glimmer-vm / packages / @glimmer / opcode-compiler / lib / syntax / push-compile.ts View on Github external
function invokeStatic(
  context: SyntaxCompilationContext,
  action: InvokeStaticOp
): StatementCompileActions {
  let compilable = action.op1;

  if (context.program.mode === CompileMode.aot) {
    let handle = compilable.compile(context);

    // If the handle for the invoked component is not yet known (for example,
    // because this is a recursive invocation and we're still compiling), push a
    // function that will produce the correct handle when the heap is
    // serialized.
    if (handle === PLACEHOLDER_HANDLE) {
      return op(MachineOp.InvokeStatic, () => compilable.compile(context));
    } else {
      return op(MachineOp.InvokeStatic, handle);
    }
  } else {
    return [op(Op.Constant, other(action.op1)), op(Op.CompileBlock), op(MachineOp.InvokeVirtual)];
  }
}
github glimmerjs / glimmer-vm / packages / @glimmer / opcode-compiler / lib / syntax / statements.ts View on Github external
ifUnhandled: () => [
      op(MachineOp.PushFrame),
      op(HighLevelResolutionOpcode.Expr, value),
      op(MachineOp.InvokeStatic, {
        type: 'stdlib',
        value: trusted ? 'trusting-append' : 'cautious-append',
      }),
      op(MachineOp.PopFrame),
    ],
  });
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / vm / low-level.ts View on Github external
evaluateMachine(opcode: RuntimeOp) {
    switch (opcode.type) {
      case MachineOp.PushFrame:
        return this.pushFrame();
      case MachineOp.PopFrame:
        return this.popFrame();
      case MachineOp.InvokeStatic:
        return this.call(opcode.op1);
      case MachineOp.InvokeVirtual:
        return this.call(this.stack.pop());
      case MachineOp.Jump:
        return this.goto(opcode.op1);
      case MachineOp.Return:
        return this.return();
      case MachineOp.ReturnTo:
        return this.returnTo(opcode.op1);
    }
  }
github glimmerjs / glimmer-vm / packages / @glimmer / debug / lib / opcode-metadata.ts View on Github external
ops: [],
  operands: 0,
  check: false,
};

MACHINE_METADATA[MachineOp.InvokeVirtual] = {
  name: 'InvokeVirtual',
  mnemonic: 'vcall',
  before: null,
  stackChange: -1,
  ops: [],
  operands: 0,
  check: true,
};

MACHINE_METADATA[MachineOp.InvokeStatic] = {
  name: 'InvokeStatic',
  mnemonic: 'scall',
  before: null,
  stackChange: 0,
  ops: [
    {
      name: 'offset',
      type: 'u32',
    },
  ],
  operands: 1,
  check: true,
};

MACHINE_METADATA[MachineOp.Jump] = {
  name: 'Jump',