How to use the @glimmer/interfaces.MachineOp.PopFrame 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 / opcode-builder / helpers / conditional.ts View on Github external
// they are done. It is executed both during initial execution
    // and during updating execution.
    op('Label', 'FINALLY'),

    // Finalize the DOM.
    op(Op.Exit),

    // In initial execution, this is a noop: it returns to the
    // immediately following opcode. In updating execution, this
    // exits the updating routine.
    op(MachineOp.Return),

    // Cleanup code for the block. Runs on initial execution
    // but not on updating.
    op('Label', 'ENDINITIAL'),
    op(MachineOp.PopFrame),
    op('StopLabels'),
  ] as T;
}
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 / opcode-compiler / lib / syntax / statements.ts View on Github external
ifTrue() {
      return [
        op(
          Op.InvokePartial,
          serializable(meta.referrer),
          strArray(meta.evalSymbols!),
          arr(evalInfo)
        ),
        op(Op.PopScope),
        op(MachineOp.PopFrame),
      ];
    },
  })
github glimmerjs / glimmer-vm / packages / @glimmer / debug / lib / opcode-metadata.ts View on Github external
return value || null;
}

const METADATA: Option[] = fillNulls(Op.Size);
const MACHINE_METADATA: Option[] = fillNulls(MachineOp.Size);
MACHINE_METADATA[MachineOp.PushFrame] = {
  name: 'PushFrame',
  mnemonic: 'pushf',
  before: null,
  stackChange: 2,
  ops: [],
  operands: 0,
  check: true,
};

MACHINE_METADATA[MachineOp.PopFrame] = {
  name: 'PopFrame',
  mnemonic: 'popf',
  before: null,
  stackChange: -2,
  ops: [],
  operands: 0,
  check: false,
};

MACHINE_METADATA[MachineOp.InvokeVirtual] = {
  name: 'InvokeVirtual',
  mnemonic: 'vcall',
  before: null,
  stackChange: -1,
  ops: [],
  operands: 0,
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 / opcode-compiler / lib / opcode-builder / helpers / components.ts View on Github external
out.push(
    op(Op.RegisterComponentDestructor, $s0),
    op(Op.GetComponentSelf, $s0),

    op(Op.VirtualRootScope, $s0),
    op(Op.SetVariable, 0),
    op(Op.SetupForEval, $s0),

    bindableAtNames ? op(Op.SetNamedVariables, $s0) : NONE,
    bindableBlocks ? op(Op.SetBlocks, $s0) : NONE,

    op(Op.Pop, 1),
    op(Op.InvokeComponentLayout, $s0),
    op(Op.DidRenderLayout, $s0),
    op(MachineOp.PopFrame),

    op(Op.PopScope),
    op(Op.PopDynamicScope),
    op(Op.CommitComponentTransaction)
  );

  return out as T;
}
github glimmerjs / glimmer-vm / packages / @glimmer / opcode-compiler / lib / syntax / builtins.ts View on Github external
let out: StatementCompileActions = [
          op(Op.PutIterator),
          op(Op.JumpUnless, label('ELSE')),
          op(MachineOp.PushFrame),
          op(Op.Dup, $fp, 1),
          op(MachineOp.ReturnTo, label('ITER')),
          op(Op.EnterList, label('BODY')),
          op('Label', 'ITER'),
          op(Op.Iterate, label('BREAK')),
          op('Label', 'BODY'),
          invokeStaticBlockWithStack(unwrap(blocks.get('default')), 2),
          op(Op.Pop, 2),
          op(MachineOp.Jump, label('FINALLY')),
          op('Label', 'BREAK'),
          op(Op.ExitList),
          op(MachineOp.PopFrame),
          op(MachineOp.Jump, label('FINALLY')),
          op('Label', 'ELSE'),
        ];

        if (blocks.has('else')) {
          out.push(invokeStaticBlock(blocks.get('else')!));
        }

        return out;
      },
    });
github glimmerjs / glimmer-vm / packages / @glimmer / opcode-compiler / lib / opcode-builder / helpers / blocks.ts View on Github external
export function InvokeStaticBlock(block: CompilableBlock): StatementCompileActions {
  return [
    op(MachineOp.PushFrame),
    op('PushCompilable', block),
    op('JitCompileBlock'),
    op(MachineOp.InvokeVirtual),
    op(MachineOp.PopFrame),
  ];
}
github glimmerjs / glimmer-vm / packages / @glimmer / opcode-compiler / lib / opcode-builder / helpers / vm.ts View on Github external
export function Call({ handle, params, hash }: CompileHelper): ExpressionCompileActions {
  return [
    op(MachineOp.PushFrame),
    op('SimpleArgs', { params, hash, atNames: false }),
    op(Op.Helper, handle),
    op(MachineOp.PopFrame),
    op(Op.Fetch, $v0),
  ];
}