aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/Ref.php
blob: f9791d24d34edb226fe620f879c57db00e73c577 (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
<?php

declare(strict_types=1);

namespace Nsfisis\Waddiwasi\WebAssembly\Execution;

use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType;

abstract readonly class Ref
{
    /**
     * @param ValType::FuncRef|ValType::ExternRef $type
     */
    final public static function RefNull(ValType $type): Refs\RefNull
    {
        return new Refs\RefNull($type);
    }

    final public static function RefFunc(int $addr): Refs\RefFunc
    {
        return new Refs\RefFunc($addr);
    }

    final public static function RefExtern(int $addr): Refs\RefExtern
    {
        return new Refs\RefExtern($addr);
    }
}