aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Execution/StackEntry.php
blob: bba31dffee6fb6b4d66d793251466894bcf4b975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

declare(strict_types=1);

namespace Nsfisis\Waddiwasi\Execution;

abstract class StackEntry
{
    final public static function Value(Val $inner): StackEntries\Value
    {
        return new StackEntries\Value($inner);
    }

    /**
     * @param int<0, max> $arity
     */
    final public static function Label(
        int $arity,
    ): StackEntries\Label {
        return new StackEntries\Label($arity);
    }

    /**
     * @param int<0, max> $arity
     * @param list<Val> $locals
     */
    final public static function Frame(
        int $arity,
        array $locals,
        ModuleInst $module,
        string $debugName,
    ): StackEntries\Frame {
        return new StackEntries\Frame($arity, $locals, $module, $debugName);
    }
}