aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-03-14 11:13:15 +0900
committernsfisis <nsfisis@gmail.com>2024-03-14 11:13:15 +0900
commitbae8cf7a0287442e7e822a194d2b6eba8c32552c (patch)
treeca89f59bc432bfc4d8b07f14c8e95373ca8f0321 /src
parentf4edb19f21c4777a95a5a8705d0e5f602103eb44 (diff)
downloadphp-waddiwasi-bae8cf7a0287442e7e822a194d2b6eba8c32552c.tar.gz
php-waddiwasi-bae8cf7a0287442e7e822a194d2b6eba8c32552c.tar.zst
php-waddiwasi-bae8cf7a0287442e7e822a194d2b6eba8c32552c.zip
perf: use global functions
Diffstat (limited to 'src')
-rw-r--r--src/BinaryFormat/Decoder.php7
-rw-r--r--src/Execution/Allocator.php6
-rw-r--r--src/Execution/MemInst.php4
-rw-r--r--src/Execution/Runtime.php136
-rw-r--r--src/Execution/Stack.php4
-rw-r--r--src/Structure/Types/ResultType.php2
6 files changed, 91 insertions, 68 deletions
diff --git a/src/BinaryFormat/Decoder.php b/src/BinaryFormat/Decoder.php
index 5d24cd3..24089d0 100644
--- a/src/BinaryFormat/Decoder.php
+++ b/src/BinaryFormat/Decoder.php
@@ -34,6 +34,13 @@ use Nsfisis\Waddiwasi\Structure\Types\ResultType;
use Nsfisis\Waddiwasi\Structure\Types\TableType;
use Nsfisis\Waddiwasi\Structure\Types\ValType;
use Nsfisis\Waddiwasi\Structure\Types\VecType;
+use function assert;
+use function count;
+use function get_class;
+use function in_array;
+use function is_float;
+use function ord;
+use function strlen;
final class Decoder
{
diff --git a/src/Execution/Allocator.php b/src/Execution/Allocator.php
index 299e761..f808174 100644
--- a/src/Execution/Allocator.php
+++ b/src/Execution/Allocator.php
@@ -11,6 +11,8 @@ use Nsfisis\Waddiwasi\Structure\Types\GlobalType;
use Nsfisis\Waddiwasi\Structure\Types\MemType;
use Nsfisis\Waddiwasi\Structure\Types\RefType;
use Nsfisis\Waddiwasi\Structure\Types\TableType;
+use RuntimeException;
+use function count;
final readonly class Allocator
{
@@ -63,7 +65,7 @@ final readonly class Allocator
ExternVals\Table::class => $m->tableAddrs[] = $externVal->addr,
ExternVals\Mem::class => $m->memAddrs[] = $externVal->addr,
ExternVals\Global_::class => $m->globalAddrs[] = $externVal->addr,
- default => throw new \RuntimeException("unreachable"),
+ default => throw new RuntimeException("unreachable"),
};
}
@@ -102,7 +104,7 @@ final readonly class Allocator
ExportDescs\Table::class => ExternVal::Table($m->tableAddrs[$export->desc->table]),
ExportDescs\Mem::class => ExternVal::Mem($m->memAddrs[$export->desc->mem]),
ExportDescs\Global_::class => ExternVal::Global_($m->globalAddrs[$export->desc->global]),
- default => throw new \RuntimeException("unreachable"),
+ default => throw new RuntimeException("unreachable"),
};
$m->exports[] = new ExportInst($export->name, $value);
}
diff --git a/src/Execution/MemInst.php b/src/Execution/MemInst.php
index 338c1a0..e37bcd0 100644
--- a/src/Execution/MemInst.php
+++ b/src/Execution/MemInst.php
@@ -5,6 +5,10 @@ declare(strict_types=1);
namespace Nsfisis\Waddiwasi\Execution;
use Nsfisis\Waddiwasi\Structure\Types\MemType;
+use function assert;
+use function chr;
+use function count;
+use function ord;
final class MemInst
{
diff --git a/src/Execution/Runtime.php b/src/Execution/Runtime.php
index d608239..1efaacc 100644
--- a/src/Execution/Runtime.php
+++ b/src/Execution/Runtime.php
@@ -16,6 +16,10 @@ use Nsfisis\Waddiwasi\Structure\Types\NumType;
use Nsfisis\Waddiwasi\Structure\Types\ResultType;
use Nsfisis\Waddiwasi\Structure\Types\ValType;
use Nsfisis\Waddiwasi\Structure\Types\ValTypes;
+use RuntimeException;
+use function assert;
+use function count;
+use function is_int;
final class Runtime
{
@@ -176,7 +180,7 @@ final class Runtime
$paramTypes = $funcInst->type->params->types;
$resultTypes = $funcInst->type->results->types;
if (count($paramTypes) !== count($vals)) {
- throw new \RuntimeException("invoke($name) invalid function arity: expected " . count($paramTypes) . ", got " . count($vals));
+ throw new RuntimeException("invoke($name) invalid function arity: expected " . count($paramTypes) . ", got " . count($vals));
}
$f = new Frame(0, [], new ModuleInst([], [], [], [], [], [], [], []), "export: $name");
$this->stack->pushFrame($f);
@@ -206,7 +210,7 @@ final class Runtime
} elseif ($fn instanceof FuncInsts\Host) {
$this->doInvokeHostFunc($fn);
} else {
- throw new \RuntimeException("doInvokeFunc: unreachable");
+ throw new RuntimeException("doInvokeFunc: unreachable");
}
// echo "Return: $funcAddr\n";
}
@@ -531,7 +535,7 @@ final class Runtime
Instrs\Control\Nop::class => $this->execInstrControlNop($instr),
Instrs\Control\Return_::class => $this->execInstrControlReturn_($instr),
Instrs\Control\Unreachable::class => $this->execInstrControlUnreachable($instr),
- default => throw new \RuntimeException("invalid instruction"),
+ default => throw new RuntimeException("invalid instruction"),
};
// $this->instrMetrics[$instr::opName()] ??= 0;
@@ -566,32 +570,32 @@ final class Runtime
private function execInstrNumericF32ConvertI32S(Instrs\Numeric\F32ConvertI32S $instr): void
{
- throw new \RuntimeException("F32ConvertI32S: not implemented");
+ throw new RuntimeException("F32ConvertI32S: not implemented");
}
private function execInstrNumericF32ConvertI32U(Instrs\Numeric\F32ConvertI32U $instr): void
{
- throw new \RuntimeException("F32ConvertI32U: not implemented");
+ throw new RuntimeException("F32ConvertI32U: not implemented");
}
private function execInstrNumericF32ConvertI64S(Instrs\Numeric\F32ConvertI64S $instr): void
{
- throw new \RuntimeException("F32ConvertI64S: not implemented");
+ throw new RuntimeException("F32ConvertI64S: not implemented");
}
private function execInstrNumericF32ConvertI64U(Instrs\Numeric\F32ConvertI64U $instr): void
{
- throw new \RuntimeException("F32ConvertI64U: not implemented");
+ throw new RuntimeException("F32ConvertI64U: not implemented");
}
private function execInstrNumericF32CopySign(Instrs\Numeric\F32CopySign $instr): void
{
- throw new \RuntimeException("F32CopySign: not implemented");
+ throw new RuntimeException("F32CopySign: not implemented");
}
private function execInstrNumericF32DemoteF64(Instrs\Numeric\F32DemoteF64 $instr): void
{
- throw new \RuntimeException("F32DemoteF64: not implemented");
+ throw new RuntimeException("F32DemoteF64: not implemented");
}
private function execInstrNumericF32Div(Instrs\Numeric\F32Div $instr): void
@@ -603,12 +607,12 @@ final class Runtime
private function execInstrNumericF32Eq(Instrs\Numeric\F32Eq $instr): void
{
- throw new \RuntimeException("F32Eq: not implemented");
+ throw new RuntimeException("F32Eq: not implemented");
}
private function execInstrNumericF32Floor(Instrs\Numeric\F32Floor $instr): void
{
- throw new \RuntimeException("F32Floor: not implemented");
+ throw new RuntimeException("F32Floor: not implemented");
}
private function execInstrNumericF32Ge(Instrs\Numeric\F32Ge $instr): void
@@ -662,12 +666,12 @@ final class Runtime
private function execInstrNumericF32Ne(Instrs\Numeric\F32Ne $instr): void
{
- throw new \RuntimeException("F32Ne: not implemented");
+ throw new RuntimeException("F32Ne: not implemented");
}
private function execInstrNumericF32Nearest(Instrs\Numeric\F32Nearest $instr): void
{
- throw new \RuntimeException("F32Nearest: not implemented");
+ throw new RuntimeException("F32Nearest: not implemented");
}
private function execInstrNumericF32Neg(Instrs\Numeric\F32Neg $instr): void
@@ -678,12 +682,12 @@ final class Runtime
private function execInstrNumericF32ReinterpretI32(Instrs\Numeric\F32ReinterpretI32 $instr): void
{
- throw new \RuntimeException("F32ReinterpretI32: not implemented");
+ throw new RuntimeException("F32ReinterpretI32: not implemented");
}
private function execInstrNumericF32ReinterpretI64(Instrs\Numeric\F32ReinterpretI64 $instr): void
{
- throw new \RuntimeException("F32ReinterpretI64: not implemented");
+ throw new RuntimeException("F32ReinterpretI64: not implemented");
}
private function execInstrNumericF32Sqrt(Instrs\Numeric\F32Sqrt $instr): void
@@ -701,7 +705,7 @@ final class Runtime
private function execInstrNumericF32Trunc(Instrs\Numeric\F32Trunc $instr): void
{
- throw new \RuntimeException("F32Trunc: not implemented");
+ throw new RuntimeException("F32Trunc: not implemented");
}
private function execInstrNumericF64Abs(Instrs\Numeric\F64Abs $instr): void
@@ -754,7 +758,7 @@ final class Runtime
private function execInstrNumericF64CopySign(Instrs\Numeric\F64CopySign $instr): void
{
- throw new \RuntimeException("F64CopySign: not implemented");
+ throw new RuntimeException("F64CopySign: not implemented");
}
private function execInstrNumericF64Div(Instrs\Numeric\F64Div $instr): void
@@ -766,12 +770,12 @@ final class Runtime
private function execInstrNumericF64Eq(Instrs\Numeric\F64Eq $instr): void
{
- throw new \RuntimeException("F64Eq: not implemented");
+ throw new RuntimeException("F64Eq: not implemented");
}
private function execInstrNumericF64Floor(Instrs\Numeric\F64Floor $instr): void
{
- throw new \RuntimeException("F64Floor: not implemented");
+ throw new RuntimeException("F64Floor: not implemented");
}
private function execInstrNumericF64Ge(Instrs\Numeric\F64Ge $instr): void
@@ -825,12 +829,12 @@ final class Runtime
private function execInstrNumericF64Ne(Instrs\Numeric\F64Ne $instr): void
{
- throw new \RuntimeException("F64Ne: not implemented");
+ throw new RuntimeException("F64Ne: not implemented");
}
private function execInstrNumericF64Nearest(Instrs\Numeric\F64Nearest $instr): void
{
- throw new \RuntimeException("F64Nearest: not implemented");
+ throw new RuntimeException("F64Nearest: not implemented");
}
private function execInstrNumericF64Neg(Instrs\Numeric\F64Neg $instr): void
@@ -841,17 +845,17 @@ final class Runtime
private function execInstrNumericF64PromoteF32(Instrs\Numeric\F64PromoteF32 $instr): void
{
- throw new \RuntimeException("F64PromoteF32: not implemented");
+ throw new RuntimeException("F64PromoteF32: not implemented");
}
private function execInstrNumericF64ReinterpretI32(Instrs\Numeric\F64ReinterpretI32 $instr): void
{
- throw new \RuntimeException("F64ReinterpretI32: not implemented");
+ throw new RuntimeException("F64ReinterpretI32: not implemented");
}
private function execInstrNumericF64ReinterpretI64(Instrs\Numeric\F64ReinterpretI64 $instr): void
{
- throw new \RuntimeException("F64ReinterpretI64: not implemented");
+ throw new RuntimeException("F64ReinterpretI64: not implemented");
}
private function execInstrNumericF64Sqrt(Instrs\Numeric\F64Sqrt $instr): void
@@ -869,7 +873,7 @@ final class Runtime
private function execInstrNumericF64Trunc(Instrs\Numeric\F64Trunc $instr): void
{
- throw new \RuntimeException("F64Trunc: not implemented");
+ throw new RuntimeException("F64Trunc: not implemented");
}
private function execInstrNumericI32Add(Instrs\Numeric\I32Add $instr): void
@@ -921,7 +925,7 @@ final class Runtime
private function execInstrNumericI32DivS(Instrs\Numeric\I32DivS $instr): void
{
- throw new \RuntimeException("I32DivS: not implemented");
+ throw new RuntimeException("I32DivS: not implemented");
}
private function execInstrNumericI32DivU(Instrs\Numeric\I32DivU $instr): void
@@ -1044,22 +1048,22 @@ final class Runtime
private function execInstrNumericI32Popcnt(Instrs\Numeric\I32Popcnt $instr): void
{
- throw new \RuntimeException("I32Popcnt: not implemented");
+ throw new RuntimeException("I32Popcnt: not implemented");
}
private function execInstrNumericI32ReinterpretF32(Instrs\Numeric\I32ReinterpretF32 $instr): void
{
- throw new \RuntimeException("I32ReinterpretF32: not implemented");
+ throw new RuntimeException("I32ReinterpretF32: not implemented");
}
private function execInstrNumericI32ReinterpretF64(Instrs\Numeric\I32ReinterpretF64 $instr): void
{
- throw new \RuntimeException("I32ReinterpretF64: not implemented");
+ throw new RuntimeException("I32ReinterpretF64: not implemented");
}
private function execInstrNumericI32RemS(Instrs\Numeric\I32RemS $instr): void
{
- throw new \RuntimeException("I32RemS: not implemented");
+ throw new RuntimeException("I32RemS: not implemented");
}
private function execInstrNumericI32RemU(Instrs\Numeric\I32RemU $instr): void
@@ -1082,7 +1086,7 @@ final class Runtime
private function execInstrNumericI32RotR(Instrs\Numeric\I32RotR $instr): void
{
- throw new \RuntimeException("I32RotR: not implemented");
+ throw new RuntimeException("I32RotR: not implemented");
}
private function execInstrNumericI32Shl(Instrs\Numeric\I32Shl $instr): void
@@ -1123,42 +1127,42 @@ final class Runtime
private function execInstrNumericI32TruncF32S(Instrs\Numeric\I32TruncF32S $instr): void
{
- throw new \RuntimeException("I32TruncF32S: not implemented");
+ throw new RuntimeException("I32TruncF32S: not implemented");
}
private function execInstrNumericI32TruncF32U(Instrs\Numeric\I32TruncF32U $instr): void
{
- throw new \RuntimeException("I32TruncF32U: not implemented");
+ throw new RuntimeException("I32TruncF32U: not implemented");
}
private function execInstrNumericI32TruncF64S(Instrs\Numeric\I32TruncF64S $instr): void
{
- throw new \RuntimeException("I32TruncF64S: not implemented");
+ throw new RuntimeException("I32TruncF64S: not implemented");
}
private function execInstrNumericI32TruncF64U(Instrs\Numeric\I32TruncF64U $instr): void
{
- throw new \RuntimeException("I32TruncF64U: not implemented");
+ throw new RuntimeException("I32TruncF64U: not implemented");
}
private function execInstrNumericI32TruncSatF32S(Instrs\Numeric\I32TruncSatF32S $instr): void
{
- throw new \RuntimeException("I32TruncSatF32S: not implemented");
+ throw new RuntimeException("I32TruncSatF32S: not implemented");
}
private function execInstrNumericI32TruncSatF32U(Instrs\Numeric\I32TruncSatF32U $instr): void
{
- throw new \RuntimeException("I32TruncSatF32U: not implemented");
+ throw new RuntimeException("I32TruncSatF32U: not implemented");
}
private function execInstrNumericI32TruncSatF64S(Instrs\Numeric\I32TruncSatF64S $instr): void
{
- throw new \RuntimeException("I32TruncSatF64S: not implemented");
+ throw new RuntimeException("I32TruncSatF64S: not implemented");
}
private function execInstrNumericI32TruncSatF64U(Instrs\Numeric\I32TruncSatF64U $instr): void
{
- throw new \RuntimeException("I32TruncSatF64U: not implemented");
+ throw new RuntimeException("I32TruncSatF64U: not implemented");
}
private function execInstrNumericI32WrapI64(Instrs\Numeric\I32WrapI64 $instr): void
@@ -1399,27 +1403,27 @@ final class Runtime
private function execInstrNumericI64Popcnt(Instrs\Numeric\I64Popcnt $instr): void
{
- throw new \RuntimeException("I64Popcnt: not implemented");
+ throw new RuntimeException("I64Popcnt: not implemented");
}
private function execInstrNumericI64ReinterpretF32(Instrs\Numeric\I64ReinterpretF32 $instr): void
{
- throw new \RuntimeException("I64ReinterpretF32: not implemented");
+ throw new RuntimeException("I64ReinterpretF32: not implemented");
}
private function execInstrNumericI64ReinterpretF64(Instrs\Numeric\I64ReinterpretF64 $instr): void
{
- throw new \RuntimeException("I64ReinterpretF64: not implemented");
+ throw new RuntimeException("I64ReinterpretF64: not implemented");
}
private function execInstrNumericI64RemS(Instrs\Numeric\I64RemS $instr): void
{
- throw new \RuntimeException("I64RemS: not implemented");
+ throw new RuntimeException("I64RemS: not implemented");
}
private function execInstrNumericI64RemU(Instrs\Numeric\I64RemU $instr): void
{
- throw new \RuntimeException("I64RemU: not implemented");
+ throw new RuntimeException("I64RemU: not implemented");
}
private function execInstrNumericI64RotL(Instrs\Numeric\I64RotL $instr): void
@@ -1432,7 +1436,7 @@ final class Runtime
private function execInstrNumericI64RotR(Instrs\Numeric\I64RotR $instr): void
{
- throw new \RuntimeException("I64RotR: not implemented");
+ throw new RuntimeException("I64RotR: not implemented");
}
private function execInstrNumericI64Shl(Instrs\Numeric\I64Shl $instr): void
@@ -1468,42 +1472,42 @@ final class Runtime
private function execInstrNumericI64TruncF32S(Instrs\Numeric\I64TruncF32S $instr): void
{
- throw new \RuntimeException("I64TruncF32S: not implemented");
+ throw new RuntimeException("I64TruncF32S: not implemented");
}
private function execInstrNumericI64TruncF32U(Instrs\Numeric\I64TruncF32U $instr): void
{
- throw new \RuntimeException("I64TruncF32U: not implemented");
+ throw new RuntimeException("I64TruncF32U: not implemented");
}
private function execInstrNumericI64TruncF64S(Instrs\Numeric\I64TruncF64S $instr): void
{
- throw new \RuntimeException("I64TruncF64S: not implemented");
+ throw new RuntimeException("I64TruncF64S: not implemented");
}
private function execInstrNumericI64TruncF64U(Instrs\Numeric\I64TruncF64U $instr): void
{
- throw new \RuntimeException("I64TruncF64U: not implemented");
+ throw new RuntimeException("I64TruncF64U: not implemented");
}
private function execInstrNumericI64TruncSatF32S(Instrs\Numeric\I64TruncSatF32S $instr): void
{
- throw new \RuntimeException("I64TruncSatF32S: not implemented");
+ throw new RuntimeException("I64TruncSatF32S: not implemented");
}
private function execInstrNumericI64TruncSatF32U(Instrs\Numeric\I64TruncSatF32U $instr): void
{
- throw new \RuntimeException("I64TruncSatF32U: not implemented");
+ throw new RuntimeException("I64TruncSatF32U: not implemented");
}
private function execInstrNumericI64TruncSatF64S(Instrs\Numeric\I64TruncSatF64S $instr): void
{
- throw new \RuntimeException("I64TruncSatF64S: not implemented");
+ throw new RuntimeException("I64TruncSatF64S: not implemented");
}
private function execInstrNumericI64TruncSatF64U(Instrs\Numeric\I64TruncSatF64U $instr): void
{
- throw new \RuntimeException("I64TruncSatF64U: not implemented");
+ throw new RuntimeException("I64TruncSatF64U: not implemented");
}
private function execInstrNumericI64Xor(Instrs\Numeric\I64Xor $instr): void
@@ -1576,7 +1580,7 @@ final class Runtime
$f = $this->stack->currentFrame();
$val = $f->locals[$x] ?? null;
if ($val === null) {
- throw new \RuntimeException("local.get: local $x not found in [$f->debugName]");
+ throw new RuntimeException("local.get: local $x not found in [$f->debugName]");
}
$this->stack->pushValue($val);
}
@@ -1612,22 +1616,22 @@ final class Runtime
private function execInstrTableTableCopy(Instrs\Table\TableCopy $instr): void
{
- throw new \RuntimeException("TableCopy: not implemented");
+ throw new RuntimeException("TableCopy: not implemented");
}
private function execInstrTableTableFill(Instrs\Table\TableFill $instr): void
{
- throw new \RuntimeException("TableFill: not implemented");
+ throw new RuntimeException("TableFill: not implemented");
}
private function execInstrTableTableGet(Instrs\Table\TableGet $instr): void
{
- throw new \RuntimeException("TableGet: not implemented");
+ throw new RuntimeException("TableGet: not implemented");
}
private function execInstrTableTableGrow(Instrs\Table\TableGrow $instr): void
{
- throw new \RuntimeException("TableGrow: not implemented");
+ throw new RuntimeException("TableGrow: not implemented");
}
private function execInstrTableTableInit(Instrs\Table\TableInit $instr): void
@@ -1671,7 +1675,7 @@ final class Runtime
private function execInstrTableTableSize(Instrs\Table\TableSize $instr): void
{
- throw new \RuntimeException("TableSize: not implemented");
+ throw new RuntimeException("TableSize: not implemented");
}
private function execInstrMemoryDataDrop(Instrs\Memory\DataDrop $instr): void
@@ -2010,17 +2014,17 @@ final class Runtime
private function execInstrMemoryMemoryCopy(Instrs\Memory\MemoryCopy $instr): void
{
- throw new \RuntimeException("MemoryCopy: not implemented");
+ throw new RuntimeException("MemoryCopy: not implemented");
}
private function execInstrMemoryMemoryFill(Instrs\Memory\MemoryFill $instr): void
{
- throw new \RuntimeException("MemoryFill: not implemented");
+ throw new RuntimeException("MemoryFill: not implemented");
}
private function execInstrMemoryMemoryGrow(Instrs\Memory\MemoryGrow $instr): void
{
- throw new \RuntimeException("MemoryGrow: not implemented");
+ throw new RuntimeException("MemoryGrow: not implemented");
}
private function execInstrMemoryMemoryInit(Instrs\Memory\MemoryInit $instr): void
@@ -2076,7 +2080,7 @@ final class Runtime
return ControlFlowResult::Br($result->label - 1);
}
} else {
- throw new \RuntimeException("block: unreachable");
+ throw new RuntimeException("block: unreachable");
}
return null;
}
@@ -2203,7 +2207,7 @@ final class Runtime
return ControlFlowResult::Br($result->label - 1);
}
} else {
- throw new \RuntimeException("loop: unreachable");
+ throw new RuntimeException("loop: unreachable");
}
}
}
@@ -2261,7 +2265,7 @@ final class Runtime
NumType::F64 => 0.0,
},
ValTypes\RefType::class => Ref::RefNull($type->inner),
- default => throw new \RuntimeException("unreachable"),
+ default => throw new RuntimeException("unreachable"),
};
}
@@ -2276,7 +2280,7 @@ final class Runtime
new ResultType($t === null ? [] : [$t]),
);
} else {
- throw new \RuntimeException("expand(): invalid blocktype");
+ throw new RuntimeException("expand(): invalid blocktype");
}
}
diff --git a/src/Execution/Stack.php b/src/Execution/Stack.php
index a96a875..be4e7ec 100644
--- a/src/Execution/Stack.php
+++ b/src/Execution/Stack.php
@@ -5,6 +5,10 @@ declare(strict_types=1);
namespace Nsfisis\Waddiwasi\Execution;
use Nsfisis\Waddiwasi\Structure\Types\RefType;
+use function assert;
+use function count;
+use function is_float;
+use function is_int;
final class Stack
{
diff --git a/src/Structure/Types/ResultType.php b/src/Structure/Types/ResultType.php
index a826805..623ca3e 100644
--- a/src/Structure/Types/ResultType.php
+++ b/src/Structure/Types/ResultType.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Nsfisis\Waddiwasi\Structure\Types;
+use function count;
+
final readonly class ResultType
{
/**