From 900377463a8264871ee42e488112b076b7973b6a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jan 2024 13:22:56 +0900 Subject: feat: partially implement execution --- src/BinaryFormat/Decoder.php | 15 +- src/Execution/Allocator.php | 162 ++++++ src/Execution/DataAddr.php | 13 + src/Execution/DataInst.php | 16 + src/Execution/ElemAddr.php | 13 + src/Execution/ElemInst.php | 19 + src/Execution/ExportInst.php | 17 + src/Execution/ExternAddr.php | 13 + src/Execution/ExternVal.php | 28 + src/Execution/ExternVals/Func.php | 16 + src/Execution/ExternVals/Global_.php | 16 + src/Execution/ExternVals/Mem.php | 16 + src/Execution/ExternVals/Table.php | 16 + src/Execution/FuncAddr.php | 13 + src/Execution/FuncInst.php | 21 + src/Execution/FuncInsts/Host.php | 20 + src/Execution/FuncInsts/Wasm.php | 20 + src/Execution/GlobalAddr.php | 13 + src/Execution/GlobalInst.php | 16 + src/Execution/MemAddr.php | 13 + src/Execution/MemInst.php | 19 + src/Execution/ModuleInst.php | 32 ++ src/Execution/Num.php | 40 ++ src/Execution/Nums/F32_.php | 18 + src/Execution/Nums/F64_.php | 18 + src/Execution/Nums/I32.php | 18 + src/Execution/Nums/I64.php | 18 + src/Execution/Ref.php | 25 + src/Execution/Refs/RefExtern.php | 16 + src/Execution/Refs/RefFunc.php | 16 + src/Execution/Refs/RefNull.php | 16 + src/Execution/Result.php | 21 + src/Execution/Results/Trap.php | 11 + src/Execution/Results/Values.php | 19 + src/Execution/Runtime.php | 561 +++++++++++++++++++++ src/Execution/Stack.php | 42 ++ src/Execution/StackEntries/Frame.php | 23 + src/Execution/StackEntries/Label.php | 21 + src/Execution/StackEntries/Value.php | 16 + src/Execution/StackEntry.php | 38 ++ src/Execution/Store.php | 31 ++ src/Execution/TableAddr.php | 13 + src/Execution/TableInst.php | 19 + src/Execution/Val.php | 18 + src/Execution/Vals/Num.php | 16 + src/Execution/Vals/Ref.php | 16 + .../Instructions/Instrs/Control/Block.php | 2 +- src/Structure/Instructions/Instrs/Control/Br.php | 2 +- src/Structure/Instructions/Instrs/Control/BrIf.php | 2 +- .../Instructions/Instrs/Control/BrTable.php | 2 +- src/Structure/Instructions/Instrs/Control/Call.php | 2 +- .../Instructions/Instrs/Control/CallIndirect.php | 2 +- src/Structure/Instructions/Instrs/Control/If_.php | 2 +- src/Structure/Instructions/Instrs/Control/Loop.php | 2 +- .../Instructions/Instrs/Memory/DataDrop.php | 2 +- .../Instructions/Instrs/Memory/F32Load.php | 2 +- .../Instructions/Instrs/Memory/F32Store.php | 2 +- .../Instructions/Instrs/Memory/F64Load.php | 2 +- .../Instructions/Instrs/Memory/F64Store.php | 2 +- .../Instructions/Instrs/Memory/I32Load.php | 2 +- .../Instructions/Instrs/Memory/I32Load16S.php | 2 +- .../Instructions/Instrs/Memory/I32Load16U.php | 2 +- .../Instructions/Instrs/Memory/I32Load8S.php | 2 +- .../Instructions/Instrs/Memory/I32Load8U.php | 2 +- .../Instructions/Instrs/Memory/I32Store.php | 2 +- .../Instructions/Instrs/Memory/I32Store16.php | 2 +- .../Instructions/Instrs/Memory/I32Store8.php | 2 +- .../Instructions/Instrs/Memory/I64Load.php | 2 +- .../Instructions/Instrs/Memory/I64Load16S.php | 2 +- .../Instructions/Instrs/Memory/I64Load16U.php | 2 +- .../Instructions/Instrs/Memory/I64Load32S.php | 2 +- .../Instructions/Instrs/Memory/I64Load32U.php | 2 +- .../Instructions/Instrs/Memory/I64Load8S.php | 2 +- .../Instructions/Instrs/Memory/I64Load8U.php | 2 +- .../Instructions/Instrs/Memory/I64Store.php | 2 +- .../Instructions/Instrs/Memory/I64Store16.php | 2 +- .../Instructions/Instrs/Memory/I64Store32.php | 2 +- .../Instructions/Instrs/Memory/I64Store8.php | 2 +- .../Instructions/Instrs/Memory/MemoryInit.php | 2 +- .../Instructions/Instrs/Numeric/F32Const.php | 2 +- .../Instructions/Instrs/Numeric/F64Const.php | 2 +- .../Instructions/Instrs/Numeric/I32Const.php | 2 +- .../Instructions/Instrs/Numeric/I64Const.php | 2 +- .../Instructions/Instrs/Parametric/Select.php | 2 +- .../Instructions/Instrs/Reference/RefFunc.php | 2 +- .../Instructions/Instrs/Reference/RefNull.php | 2 +- .../Instructions/Instrs/Table/ElemDrop.php | 2 +- .../Instructions/Instrs/Table/TableCopy.php | 2 +- .../Instructions/Instrs/Table/TableFill.php | 2 +- .../Instructions/Instrs/Table/TableGet.php | 2 +- .../Instructions/Instrs/Table/TableGrow.php | 2 +- .../Instructions/Instrs/Table/TableInit.php | 2 +- .../Instructions/Instrs/Table/TableSet.php | 2 +- .../Instructions/Instrs/Table/TableSize.php | 2 +- .../Instructions/Instrs/Variable/GlobalGet.php | 2 +- .../Instructions/Instrs/Variable/GlobalSet.php | 2 +- .../Instructions/Instrs/Variable/LocalGet.php | 2 +- .../Instructions/Instrs/Variable/LocalSet.php | 2 +- .../Instructions/Instrs/Variable/LocalTee.php | 2 +- 99 files changed, 1624 insertions(+), 59 deletions(-) create mode 100644 src/Execution/Allocator.php create mode 100644 src/Execution/DataAddr.php create mode 100644 src/Execution/DataInst.php create mode 100644 src/Execution/ElemAddr.php create mode 100644 src/Execution/ElemInst.php create mode 100644 src/Execution/ExportInst.php create mode 100644 src/Execution/ExternAddr.php create mode 100644 src/Execution/ExternVal.php create mode 100644 src/Execution/ExternVals/Func.php create mode 100644 src/Execution/ExternVals/Global_.php create mode 100644 src/Execution/ExternVals/Mem.php create mode 100644 src/Execution/ExternVals/Table.php create mode 100644 src/Execution/FuncAddr.php create mode 100644 src/Execution/FuncInst.php create mode 100644 src/Execution/FuncInsts/Host.php create mode 100644 src/Execution/FuncInsts/Wasm.php create mode 100644 src/Execution/GlobalAddr.php create mode 100644 src/Execution/GlobalInst.php create mode 100644 src/Execution/MemAddr.php create mode 100644 src/Execution/MemInst.php create mode 100644 src/Execution/ModuleInst.php create mode 100644 src/Execution/Num.php create mode 100644 src/Execution/Nums/F32_.php create mode 100644 src/Execution/Nums/F64_.php create mode 100644 src/Execution/Nums/I32.php create mode 100644 src/Execution/Nums/I64.php create mode 100644 src/Execution/Ref.php create mode 100644 src/Execution/Refs/RefExtern.php create mode 100644 src/Execution/Refs/RefFunc.php create mode 100644 src/Execution/Refs/RefNull.php create mode 100644 src/Execution/Result.php create mode 100644 src/Execution/Results/Trap.php create mode 100644 src/Execution/Results/Values.php create mode 100644 src/Execution/Runtime.php create mode 100644 src/Execution/Stack.php create mode 100644 src/Execution/StackEntries/Frame.php create mode 100644 src/Execution/StackEntries/Label.php create mode 100644 src/Execution/StackEntries/Value.php create mode 100644 src/Execution/StackEntry.php create mode 100644 src/Execution/Store.php create mode 100644 src/Execution/TableAddr.php create mode 100644 src/Execution/TableInst.php create mode 100644 src/Execution/Val.php create mode 100644 src/Execution/Vals/Num.php create mode 100644 src/Execution/Vals/Ref.php (limited to 'src') diff --git a/src/BinaryFormat/Decoder.php b/src/BinaryFormat/Decoder.php index f95c26e..be1b44d 100644 --- a/src/BinaryFormat/Decoder.php +++ b/src/BinaryFormat/Decoder.php @@ -132,12 +132,12 @@ final class Decoder { assert($this->pos === 4); $this->ensureNBytesRemains(4); - $b1 = ord($this->input[0]); - $b2 = ord($this->input[1]); - $b3 = ord($this->input[2]); - $b4 = ord($this->input[3]); + $b1 = ord($this->input[4]); + $b2 = ord($this->input[5]); + $b3 = ord($this->input[6]); + $b4 = ord($this->input[7]); if ([$b1, $b2, $b3, $b4] !== [0x01, 0x00, 0x00, 0x00]) { - throw new InvalidBinaryFormatException("version"); + throw new InvalidBinaryFormatException(sprintf("version: [%x, %x, %x, %x]", $b1, $b2, $b3, $b4)); } $this->pos += 4; } @@ -150,6 +150,9 @@ final class Decoder private function decodeSection(SectionId $sectionId, callable $decoder): mixed { $this->skipCustomSections(); + if ($this->eof()) { + return null; + } $idValue = $this->peekByte(); $id = SectionId::tryFrom($idValue); @@ -983,7 +986,7 @@ final class Decoder private function ensureNBytesRemains(int $n): void { if ($this->inputSize < $this->pos + $n) { - throw new InvalidBinaryFormatException("ensureNBytesRemains"); + throw new InvalidBinaryFormatException("ensureNBytesRemains: $this->inputSize < $this->pos + $n"); } } diff --git a/src/Execution/Allocator.php b/src/Execution/Allocator.php new file mode 100644 index 0000000..ad62fc7 --- /dev/null +++ b/src/Execution/Allocator.php @@ -0,0 +1,162 @@ + $externVals + */ + public function allocPreInitModule( + Module $module, + array $externVals, + ): ModuleInst { + $m = new ModuleInst($module->types, [], [], [], [], [], [], []); + + foreach ($externVals as $externVal) { + if ($externVal instanceof ExternVals\Global_) { + $m->globalAddrs[] = $externVal->addr; + } + } + foreach ($module->funcs as $func) { + $m->funcAddrs[] = $this->allocFunc($func, $m); + } + + return $m; + } + + /** + * @param list $externVals + * @param list $vals + * @param list> $refsList + * @param list $preAllocatedFuncs + */ + public function allocModule( + Module $module, + array $externVals, + array $vals, + array $refsList, + array $preAllocatedFuncs, + ): ModuleInst { + $m = new ModuleInst($module->types, [], [], [], [], [], [], []); + + foreach ($externVals as $externVal) { + match ($externVal::class) { + ExternVals\Func::class => $m->funcAddrs[] = $externVal->addr, + 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"), + }; + } + + foreach ($preAllocatedFuncs as $funcAddr) { + $m->funcAddrs[] = $funcAddr; + $funcInst = $this->store->funcs[$funcAddr->value]; + assert($funcInst instanceof FuncInsts\Wasm); + // @phpstan-ignore-next-line + $this->store->funcs[$funcAddr->value] = FuncInst::Wasm( + $funcInst->type, + $m, + $funcInst->code, + ); + } + foreach ($module->tables as $table) { + $m->tableAddrs[] = $this->allocTable($table->type, Ref::RefNull($table->type->refType)); + } + foreach ($module->mems as $mem) { + $m->memAddrs[] = $this->allocMem($mem->type); + } + foreach ($module->datas as $data) { + $m->dataAddrs[] = $this->allocData($data->init); + } + + foreach ($module->globals as $i => $global) { + $m->globalAddrs[] = $this->allocGlobal($global->type, $vals[$i]); + } + foreach ($module->elems as $i => $elem) { + $m->elemAddrs[] = $this->allocElem($elem->type, $refsList[$i]); + } + + foreach ($module->exports as $export) { + $value = match ($export->desc::class) { + ExportDescs\Func::class => ExternVal::Func($m->funcAddrs[$export->desc->func->value]), + ExportDescs\Table::class => ExternVal::Table($m->tableAddrs[$export->desc->table->value]), + ExportDescs\Mem::class => ExternVal::Mem($m->memAddrs[$export->desc->mem->value]), + ExportDescs\Global_::class => ExternVal::Global_($m->globalAddrs[$export->desc->global->value]), + default => throw new \RuntimeException("unreachable"), + }; + $m->exports[] = new ExportInst($export->name, $value); + } + + return $m; + } + + private function allocFunc(Func $func, ModuleInst $moduleInst): FuncAddr + { + $funcType = $moduleInst->types[$func->type->value]; + $funcInst = FuncInst::Wasm($funcType, $moduleInst, $func); + $this->store->funcs[] = $funcInst; + return new FuncAddr(count($this->store->funcs) - 1); + } + + private function allocTable(TableType $tableType, Ref $ref): TableAddr + { + $minSize = $tableType->limits->min; + $elem = array_fill(0, $minSize, $ref); + $tableInst = new TableInst($tableType, $elem); + $this->store->tables[] = $tableInst; + return new TableAddr(count($this->store->tables) - 1); + } + + private function allocMem(MemType $memType): MemAddr + { + $minSize = $memType->limits->min; + $data = array_fill(0, $minSize * 64 * 1024, 0); + $memInst = new MemInst($memType, $data); + $this->store->mems[] = $memInst; + return new MemAddr(count($this->store->mems) - 1); + } + + private function allocGlobal(GlobalType $globalType, Val $val): GlobalAddr + { + $globalInst = new GlobalInst($globalType, $val); + $this->store->globals[] = $globalInst; + return new GlobalAddr(count($this->store->globals) - 1); + } + + /** + * @param list $elem + */ + private function allocElem(RefType $refType, array $elem): ElemAddr + { + $elemInst = new ElemInst($refType, $elem); + $this->store->elems[] = $elemInst; + return new ElemAddr(count($this->store->elems) - 1); + } + + /** + * @param list $data + */ + private function allocData(array $data): DataAddr + { + $dataInst = new DataInst($data); + $this->store->datas[] = $dataInst; + return new DataAddr(count($this->store->datas) - 1); + } +} diff --git a/src/Execution/DataAddr.php b/src/Execution/DataAddr.php new file mode 100644 index 0000000..b3c4516 --- /dev/null +++ b/src/Execution/DataAddr.php @@ -0,0 +1,13 @@ + $data + */ + public function __construct( + public array $data, + ) { + } +} diff --git a/src/Execution/ElemAddr.php b/src/Execution/ElemAddr.php new file mode 100644 index 0000000..e46b54f --- /dev/null +++ b/src/Execution/ElemAddr.php @@ -0,0 +1,13 @@ + $elem + */ + public function __construct( + public RefType $type, + public array $elem, + ) { + } +} diff --git a/src/Execution/ExportInst.php b/src/Execution/ExportInst.php new file mode 100644 index 0000000..e4521b4 --- /dev/null +++ b/src/Execution/ExportInst.php @@ -0,0 +1,17 @@ + $data + */ + public function __construct( + public MemType $type, + public array $data, + ) { + } +} diff --git a/src/Execution/ModuleInst.php b/src/Execution/ModuleInst.php new file mode 100644 index 0000000..2cd7f08 --- /dev/null +++ b/src/Execution/ModuleInst.php @@ -0,0 +1,32 @@ + $types + * @param list $funcAddrs + * @param list $tableAddrs + * @param list $memAddrs + * @param list $globalAddrs + * @param list $elemAddrs + * @param list $dataAddrs + * @param list $exports + */ + public function __construct( + public array $types, + public array $funcAddrs, + public array $tableAddrs, + public array $memAddrs, + public array $globalAddrs, + public array $elemAddrs, + public array $dataAddrs, + public array $exports, + ) { + } +} diff --git a/src/Execution/Num.php b/src/Execution/Num.php new file mode 100644 index 0000000..03fec4f --- /dev/null +++ b/src/Execution/Num.php @@ -0,0 +1,40 @@ + $values + */ + final public static function Values(array $values): Results\Values + { + return new Results\Values($values); + } + + final public static function Trap(): Results\Trap + { + return new Results\Trap(); + } +} diff --git a/src/Execution/Results/Trap.php b/src/Execution/Results/Trap.php new file mode 100644 index 0000000..eb676b2 --- /dev/null +++ b/src/Execution/Results/Trap.php @@ -0,0 +1,11 @@ + $values + */ + protected function __construct( + public array $values, + ) { + } +} diff --git a/src/Execution/Runtime.php b/src/Execution/Runtime.php new file mode 100644 index 0000000..030c46e --- /dev/null +++ b/src/Execution/Runtime.php @@ -0,0 +1,561 @@ + $externVals + */ + public static function instantiate( + Store $store, + Module $module, + array $externVals, + ): self { + $allocator = new Allocator($store); + + $moduleInstInit = $allocator->allocPreInitModule($module, $externVals); + + $stack = new Stack([]); + $frameInit = StackEntry::Frame(0, [], $moduleInstInit); + $stack->push($frameInit); + + $runtimeInit = new self($store, $stack, $moduleInstInit); + + $vals = []; + foreach ($module->globals as $global) { + $instrs = $global->init->instrs; + array_pop($instrs); // drop "end" + $vals[] = $runtimeInit->evalInstrs($instrs); + assert($stack->top() === $frameInit); + } + + $refsList = []; + foreach ($module->elems as $elem) { + $refs = []; + foreach ($elem->init as $expr) { + $instrs = $expr->instrs; + array_pop($instrs); // drop "end" + $result = $runtimeInit->evalInstrs($instrs); + assert($result instanceof Vals\Ref); + $refs[] = $result->inner; + } + $refsList[] = $refs; + } + + assert($stack->top() === $frameInit); + $stack->pop(); + + $moduleInst = $allocator->allocModule( + $module, + $externVals, + $vals, + $refsList, + $moduleInstInit->funcAddrs, + ); + + $runtime = new self($store, $stack, $moduleInst); + + $frame = StackEntry::Frame(0, [], $moduleInst); + $stack->push($frame); + + foreach ($module->elems as $i => $elem) { + if ($elem->mode instanceof ElemModes\Active) { + $n = count($elem->init); + $instrs = $elem->mode->offset->instrs; + array_pop($instrs); // drop "end" + $instrs[] = Instr::I32Const(0); + $instrs[] = Instr::I32Const($n); + $instrs[] = Instr::TableInit($elem->mode->table, new ElemIdx($i)); + $instrs[] = Instr::ElemDrop(new ElemIdx($i)); + $runtime->execInstrs($instrs); + } elseif ($elem->mode instanceof ElemModes\Declarative) { + $runtime->execInstrs([Instr::ElemDrop(new ElemIdx($i))]); + } + } + foreach ($module->datas as $i => $data) { + if ($data->mode instanceof DataModes\Active) { + assert($data->mode->memory->value === 0); + $n = count($data->init); + $instrs = $data->mode->offset->instrs; + array_pop($instrs); // drop "end" + $instrs[] = Instr::I32Const(0); + $instrs[] = Instr::I32Const($n); + $instrs[] = Instr::MemoryInit(new DataIdx($i)); + $instrs[] = Instr::DataDrop(new DataIdx($i)); + $runtime->execInstrs($instrs); + } + } + + if ($module->start !== null) { + $runtime->execInstrs([Instr::Call($module->start->func)]); + } + + assert($stack->top() === $frame); + $stack->pop(); + + return new self($store, $stack, $moduleInst); + } + + public function invoke(): void + { + } + + /** + * @param list $instrs + */ + private function execInstrs(array $instrs): void + { + foreach ($instrs as $i) { + $this->interpret($i); + } + } + + /** + * @param list $instrs + */ + private function evalInstrs(array $instrs): Val + { + $this->execInstrs($instrs); + $result = $this->stack->pop(); + assert($result instanceof StackEntries\Value); + return $result->inner; + } + + private function interpret(Instr $instr): void + { + if ($instr instanceof Instrs\Numeric\F32Abs) { + $v = $this->stack->pop(); + assert($v instanceof StackEntries\Value); + assert($v->inner instanceof Vals\Num); + assert($v->inner->inner instanceof Nums\F32_); + $this->stack->push(StackEntry::Value(Val::Num(Num::F32($v->inner->inner)))); + } elseif ($instr instanceof Instrs\Numeric\F32Add) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Ceil) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Const) { + $this->stack->push(StackEntry::Value(Val::Num(Num::F32($instr->value)))); + } elseif ($instr instanceof Instrs\Numeric\F32ConvertI32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32ConvertI32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32ConvertI64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32ConvertI64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32CopySign) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32DemoteF64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Div) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Eq) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Floor) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Ge) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Gt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Le) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Lt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Max) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Min) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Mul) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Ne) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Nearest) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Neg) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32ReinterpretI32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32ReinterpretI64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Sqrt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Sub) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F32Trunc) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Abs) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Add) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Ceil) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Const) { + $this->stack->push(StackEntry::Value(Val::Num(Num::F64($instr->value)))); + } elseif ($instr instanceof Instrs\Numeric\F64ConvertI32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64ConvertI32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64ConvertI64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64ConvertI64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64CopySign) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Div) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Eq) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Floor) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Ge) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Gt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Le) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Lt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Max) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Min) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Mul) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Ne) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Nearest) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Neg) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64PromoteF32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64ReinterpretI32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64ReinterpretI64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Sqrt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Sub) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\F64Trunc) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Add) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32And) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Clz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Const) { + $this->stack->push(StackEntry::Value(Val::Num(Num::I32($instr->value)))); + } elseif ($instr instanceof Instrs\Numeric\I32Ctz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32DivS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32DivU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Eq) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Eqz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Extend16S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Extend8S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32GeS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32GeU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32GtS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32GtU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32LeS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32LeU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32LtS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32LtU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Mul) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Ne) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Or) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Popcnt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32ReinterpretF32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32ReinterpretF64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32RemS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32RemU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32RotL) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32RotR) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Shl) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32ShrS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32ShrU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Sub) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncF32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncF32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncF64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncF64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncSatF32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncSatF32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncSatF64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32TruncSatF64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32WrapI64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I32Xor) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Add) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64And) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Clz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Const) { + $this->stack->push(StackEntry::Value(Val::Num(Num::I64($instr->value)))); + } elseif ($instr instanceof Instrs\Numeric\I64Ctz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64DivS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64DivU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Eq) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Eqz) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Extend16S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Extend32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Extend8S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ExtendI32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ExtendI32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64GeS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64GeU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64GtS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64GtU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64LeS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64LeU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64LtS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64LtU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Mul) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Ne) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Or) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Popcnt) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ReinterpretF32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ReinterpretF64) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64RemS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64RemU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64RotL) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64RotR) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Shl) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ShrS) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64ShrU) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Sub) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncF32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncF32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncF64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncF64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncSatF32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncSatF32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncSatF64S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64TruncSatF64U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Numeric\I64Xor) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Reference\RefFunc) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Reference\RefIsNull) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Reference\RefNull) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Parametric\Drop) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Parametric\Select) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Variable\GlobalGet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Variable\GlobalSet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Variable\LocalGet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Variable\LocalSet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Variable\LocalTee) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\ElemDrop) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableCopy) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableFill) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableGet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableGrow) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableInit) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableSet) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Table\TableSize) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\DataDrop) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\F32Load) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\F32Store) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\F64Load) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\F64Store) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Load) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Load16S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Load16U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Load8S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Load8U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Store) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Store16) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I32Store8) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load16S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load16U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load32S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load32U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load8S) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Load8U) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Store) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Store16) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Store32) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\I64Store8) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\MemoryCopy) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\MemoryFill) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\MemoryGrow) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\MemoryInit) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Memory\MemorySize) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Block) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Br) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\BrIf) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\BrTable) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Call) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\CallIndirect) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Else_) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\End) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\If_) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Loop) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Nop) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Return_) { + assert(false, "not implemented " . $instr::class); + } elseif ($instr instanceof Instrs\Control\Unreachable) { + assert(false, "not implemented " . $instr::class); + } else { + assert(false); + } + } +} diff --git a/src/Execution/Stack.php b/src/Execution/Stack.php new file mode 100644 index 0000000..1fa2dae --- /dev/null +++ b/src/Execution/Stack.php @@ -0,0 +1,42 @@ + $entries + */ + public function __construct( + private array $entries, + ) { + } + + public function push(StackEntry $entry): void + { + $this->entries[] = $entry; + } + + public function pop(): ?StackEntry + { + return array_pop($this->entries); + } + + public function top(): ?StackEntry + { + $n = array_key_last($this->entries); + return $n === null ? null : $this->entries[$n]; + } + + public function count(): int + { + return count($this->entries); + } + + public function isEmpty(): bool + { + return $this->count() === 0; + } +} diff --git a/src/Execution/StackEntries/Frame.php b/src/Execution/StackEntries/Frame.php new file mode 100644 index 0000000..f8bd68e --- /dev/null +++ b/src/Execution/StackEntries/Frame.php @@ -0,0 +1,23 @@ + $arity + * @param list $locals + */ + public function __construct( + public int $arity, + public array $locals, + public ModuleInst $module, + ) { + } +} diff --git a/src/Execution/StackEntries/Label.php b/src/Execution/StackEntries/Label.php new file mode 100644 index 0000000..b83fb0f --- /dev/null +++ b/src/Execution/StackEntries/Label.php @@ -0,0 +1,21 @@ + $arity + * @param list $target + */ + public function __construct( + public int $arity, + public array $target, + ) { + } +} diff --git a/src/Execution/StackEntries/Value.php b/src/Execution/StackEntries/Value.php new file mode 100644 index 0000000..1cd1146 --- /dev/null +++ b/src/Execution/StackEntries/Value.php @@ -0,0 +1,16 @@ + $arity + * @param list $target + */ + final public static function Label( + int $arity, + array $target, + ): StackEntries\Label { + return new StackEntries\Label($arity, $target); + } + + /** + * @param int<0, max> $arity + * @param list $locals + */ + final public static function Frame( + int $arity, + array $locals, + ModuleInst $module, + ): StackEntries\Frame { + return new StackEntries\Frame($arity, $locals, $module); + } +} diff --git a/src/Execution/Store.php b/src/Execution/Store.php new file mode 100644 index 0000000..b7b0dfc --- /dev/null +++ b/src/Execution/Store.php @@ -0,0 +1,31 @@ + $funcs + * @param list $tables + * @param list $mems + * @param list $globals + * @param list $elems + * @param list $datas + */ + public function __construct( + public array $funcs, + public array $tables, + public array $mems, + public array $globals, + public array $elems, + public array $datas, + ) { + } + + public static function empty(): self + { + return new self([], [], [], [], [], []); + } +} diff --git a/src/Execution/TableAddr.php b/src/Execution/TableAddr.php new file mode 100644 index 0000000..e41eef1 --- /dev/null +++ b/src/Execution/TableAddr.php @@ -0,0 +1,13 @@ + $elem + */ + public function __construct( + public TableType $type, + public array $elem, + ) { + } +} diff --git a/src/Execution/Val.php b/src/Execution/Val.php new file mode 100644 index 0000000..287f441 --- /dev/null +++ b/src/Execution/Val.php @@ -0,0 +1,18 @@ + $body */ - public function __construct( + protected function __construct( public BlockType $type, public array $body, ) { diff --git a/src/Structure/Instructions/Instrs/Control/Br.php b/src/Structure/Instructions/Instrs/Control/Br.php index 836f3f1..b8564a0 100644 --- a/src/Structure/Instructions/Instrs/Control/Br.php +++ b/src/Structure/Instructions/Instrs/Control/Br.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\LabelIdx; final readonly class Br extends Instr { - public function __construct( + protected function __construct( public LabelIdx $label, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/BrIf.php b/src/Structure/Instructions/Instrs/Control/BrIf.php index a15a716..980c76e 100644 --- a/src/Structure/Instructions/Instrs/Control/BrIf.php +++ b/src/Structure/Instructions/Instrs/Control/BrIf.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\LabelIdx; final readonly class BrIf extends Instr { - public function __construct( + protected function __construct( public LabelIdx $label, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/BrTable.php b/src/Structure/Instructions/Instrs/Control/BrTable.php index 57a08f3..37f61ed 100644 --- a/src/Structure/Instructions/Instrs/Control/BrTable.php +++ b/src/Structure/Instructions/Instrs/Control/BrTable.php @@ -12,7 +12,7 @@ final readonly class BrTable extends Instr /** * @param list $labelTable */ - public function __construct( + protected function __construct( public array $labelTable, public LabelIdx $defaultLabel, ) { diff --git a/src/Structure/Instructions/Instrs/Control/Call.php b/src/Structure/Instructions/Instrs/Control/Call.php index c8702d3..472752b 100644 --- a/src/Structure/Instructions/Instrs/Control/Call.php +++ b/src/Structure/Instructions/Instrs/Control/Call.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\FuncIdx; final readonly class Call extends Instr { - public function __construct( + protected function __construct( public FuncIdx $func, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/CallIndirect.php b/src/Structure/Instructions/Instrs/Control/CallIndirect.php index 2cf28a5..6f43e06 100644 --- a/src/Structure/Instructions/Instrs/Control/CallIndirect.php +++ b/src/Structure/Instructions/Instrs/Control/CallIndirect.php @@ -10,7 +10,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TypeIdx; final readonly class CallIndirect extends Instr { - public function __construct( + protected function __construct( public TableIdx $funcTable, public TypeIdx $type, ) { diff --git a/src/Structure/Instructions/Instrs/Control/If_.php b/src/Structure/Instructions/Instrs/Control/If_.php index 0536be0..1eeee47 100644 --- a/src/Structure/Instructions/Instrs/Control/If_.php +++ b/src/Structure/Instructions/Instrs/Control/If_.php @@ -12,7 +12,7 @@ final readonly class If_ extends Instr * @param list $thenBody * @param list $elseBody */ - public function __construct( + protected function __construct( public BlockType $type, public array $thenBody, public array $elseBody, diff --git a/src/Structure/Instructions/Instrs/Control/Loop.php b/src/Structure/Instructions/Instrs/Control/Loop.php index 30c85ef..839f75d 100644 --- a/src/Structure/Instructions/Instrs/Control/Loop.php +++ b/src/Structure/Instructions/Instrs/Control/Loop.php @@ -11,7 +11,7 @@ final readonly class Loop extends Instr /** * @param list $body */ - public function __construct( + protected function __construct( public BlockType $type, public array $body, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/DataDrop.php b/src/Structure/Instructions/Instrs/Memory/DataDrop.php index 4d08ef8..1764ce9 100644 --- a/src/Structure/Instructions/Instrs/Memory/DataDrop.php +++ b/src/Structure/Instructions/Instrs/Memory/DataDrop.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\DataIdx; final readonly class DataDrop extends Instr { - public function __construct( + protected function __construct( public DataIdx $data, ) { } diff --git a/src/Structure/Instructions/Instrs/Memory/F32Load.php b/src/Structure/Instructions/Instrs/Memory/F32Load.php index d315ffc..4b06021 100644 --- a/src/Structure/Instructions/Instrs/Memory/F32Load.php +++ b/src/Structure/Instructions/Instrs/Memory/F32Load.php @@ -12,7 +12,7 @@ final readonly class F32Load extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/F32Store.php b/src/Structure/Instructions/Instrs/Memory/F32Store.php index 702698d..7c1c212 100644 --- a/src/Structure/Instructions/Instrs/Memory/F32Store.php +++ b/src/Structure/Instructions/Instrs/Memory/F32Store.php @@ -12,7 +12,7 @@ final readonly class F32Store extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/F64Load.php b/src/Structure/Instructions/Instrs/Memory/F64Load.php index 8ea4742..55778a6 100644 --- a/src/Structure/Instructions/Instrs/Memory/F64Load.php +++ b/src/Structure/Instructions/Instrs/Memory/F64Load.php @@ -12,7 +12,7 @@ final readonly class F64Load extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/F64Store.php b/src/Structure/Instructions/Instrs/Memory/F64Store.php index 3cda981..d324365 100644 --- a/src/Structure/Instructions/Instrs/Memory/F64Store.php +++ b/src/Structure/Instructions/Instrs/Memory/F64Store.php @@ -12,7 +12,7 @@ final readonly class F64Store extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load.php b/src/Structure/Instructions/Instrs/Memory/I32Load.php index 98e5e35..a5925bc 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Load.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Load.php @@ -12,7 +12,7 @@ final readonly class I32Load extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load16S.php b/src/Structure/Instructions/Instrs/Memory/I32Load16S.php index f4fa975..78a15fc 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Load16S.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Load16S.php @@ -12,7 +12,7 @@ final readonly class I32Load16S extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load16U.php b/src/Structure/Instructions/Instrs/Memory/I32Load16U.php index 8d6d772..475dff8 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Load16U.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Load16U.php @@ -12,7 +12,7 @@ final readonly class I32Load16U extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load8S.php b/src/Structure/Instructions/Instrs/Memory/I32Load8S.php index 3d93375..ef8912a 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Load8S.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Load8S.php @@ -12,7 +12,7 @@ final readonly class I32Load8S extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Load8U.php b/src/Structure/Instructions/Instrs/Memory/I32Load8U.php index dcc94bc..0c05360 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Load8U.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Load8U.php @@ -12,7 +12,7 @@ final readonly class I32Load8U extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store.php b/src/Structure/Instructions/Instrs/Memory/I32Store.php index c65e9c1..e104861 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Store.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Store.php @@ -12,7 +12,7 @@ final readonly class I32Store extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store16.php b/src/Structure/Instructions/Instrs/Memory/I32Store16.php index 01401df..8deb592 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Store16.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Store16.php @@ -12,7 +12,7 @@ final readonly class I32Store16 extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I32Store8.php b/src/Structure/Instructions/Instrs/Memory/I32Store8.php index 07f0f90..349f78f 100644 --- a/src/Structure/Instructions/Instrs/Memory/I32Store8.php +++ b/src/Structure/Instructions/Instrs/Memory/I32Store8.php @@ -12,7 +12,7 @@ final readonly class I32Store8 extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load.php b/src/Structure/Instructions/Instrs/Memory/I64Load.php index ccb8069..89bc32a 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load.php @@ -12,7 +12,7 @@ final readonly class I64Load extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load16S.php b/src/Structure/Instructions/Instrs/Memory/I64Load16S.php index 34f9a9d..f8202a7 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load16S.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load16S.php @@ -12,7 +12,7 @@ final readonly class I64Load16S extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load16U.php b/src/Structure/Instructions/Instrs/Memory/I64Load16U.php index 171ed96..f93b42b 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load16U.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load16U.php @@ -12,7 +12,7 @@ final readonly class I64Load16U extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load32S.php b/src/Structure/Instructions/Instrs/Memory/I64Load32S.php index e26fbc8..6aaa5e3 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load32S.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load32S.php @@ -12,7 +12,7 @@ final readonly class I64Load32S extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load32U.php b/src/Structure/Instructions/Instrs/Memory/I64Load32U.php index 6568d25..8561919 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load32U.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load32U.php @@ -12,7 +12,7 @@ final readonly class I64Load32U extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load8S.php b/src/Structure/Instructions/Instrs/Memory/I64Load8S.php index 7f4a8ef..3fff762 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load8S.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load8S.php @@ -12,7 +12,7 @@ final readonly class I64Load8S extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Load8U.php b/src/Structure/Instructions/Instrs/Memory/I64Load8U.php index 1982714..1d12c24 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Load8U.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Load8U.php @@ -12,7 +12,7 @@ final readonly class I64Load8U extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store.php b/src/Structure/Instructions/Instrs/Memory/I64Store.php index 75e0303..db974db 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Store.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Store.php @@ -12,7 +12,7 @@ final readonly class I64Store extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store16.php b/src/Structure/Instructions/Instrs/Memory/I64Store16.php index 66ecec6..4cb48a2 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Store16.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Store16.php @@ -12,7 +12,7 @@ final readonly class I64Store16 extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store32.php b/src/Structure/Instructions/Instrs/Memory/I64Store32.php index 8307efd..4d3e894 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Store32.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Store32.php @@ -12,7 +12,7 @@ final readonly class I64Store32 extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/I64Store8.php b/src/Structure/Instructions/Instrs/Memory/I64Store8.php index dd52475..aaac79b 100644 --- a/src/Structure/Instructions/Instrs/Memory/I64Store8.php +++ b/src/Structure/Instructions/Instrs/Memory/I64Store8.php @@ -12,7 +12,7 @@ final readonly class I64Store8 extends Instr * @param U32 $offset * @param U32 $align */ - public function __construct( + protected function __construct( public int $offset, public int $align, ) { diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryInit.php b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php index 72f7ee9..cce52c2 100644 --- a/src/Structure/Instructions/Instrs/Memory/MemoryInit.php +++ b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\DataIdx; final readonly class MemoryInit extends Instr { - public function __construct( + protected function __construct( public DataIdx $data, ) { } diff --git a/src/Structure/Instructions/Instrs/Numeric/F32Const.php b/src/Structure/Instructions/Instrs/Numeric/F32Const.php index d9ce335..0b69861 100644 --- a/src/Structure/Instructions/Instrs/Numeric/F32Const.php +++ b/src/Structure/Instructions/Instrs/Numeric/F32Const.php @@ -11,7 +11,7 @@ final readonly class F32Const extends Instr /** * @param F32 $value */ - public function __construct( + protected function __construct( public float $value, ) { } diff --git a/src/Structure/Instructions/Instrs/Numeric/F64Const.php b/src/Structure/Instructions/Instrs/Numeric/F64Const.php index dcfa9e8..540e6f4 100644 --- a/src/Structure/Instructions/Instrs/Numeric/F64Const.php +++ b/src/Structure/Instructions/Instrs/Numeric/F64Const.php @@ -11,7 +11,7 @@ final readonly class F64Const extends Instr /** * @param F64 $value */ - public function __construct( + protected function __construct( public float $value, ) { } diff --git a/src/Structure/Instructions/Instrs/Numeric/I32Const.php b/src/Structure/Instructions/Instrs/Numeric/I32Const.php index 7beaae0..d9f1aea 100644 --- a/src/Structure/Instructions/Instrs/Numeric/I32Const.php +++ b/src/Structure/Instructions/Instrs/Numeric/I32Const.php @@ -11,7 +11,7 @@ final readonly class I32Const extends Instr /** * @param U32 $value */ - public function __construct( + protected function __construct( public int $value, ) { } diff --git a/src/Structure/Instructions/Instrs/Numeric/I64Const.php b/src/Structure/Instructions/Instrs/Numeric/I64Const.php index 59f34f3..59ca0f8 100644 --- a/src/Structure/Instructions/Instrs/Numeric/I64Const.php +++ b/src/Structure/Instructions/Instrs/Numeric/I64Const.php @@ -11,7 +11,7 @@ final readonly class I64Const extends Instr /** * @param U64 $value */ - public function __construct( + protected function __construct( public int $value, ) { } diff --git a/src/Structure/Instructions/Instrs/Parametric/Select.php b/src/Structure/Instructions/Instrs/Parametric/Select.php index 5e5b5ad..dd09ef3 100644 --- a/src/Structure/Instructions/Instrs/Parametric/Select.php +++ b/src/Structure/Instructions/Instrs/Parametric/Select.php @@ -12,7 +12,7 @@ final readonly class Select extends Instr /** * @param list $types */ - public function __construct( + protected function __construct( public array $types, ) { } diff --git a/src/Structure/Instructions/Instrs/Reference/RefFunc.php b/src/Structure/Instructions/Instrs/Reference/RefFunc.php index 2849f5f..9924de1 100644 --- a/src/Structure/Instructions/Instrs/Reference/RefFunc.php +++ b/src/Structure/Instructions/Instrs/Reference/RefFunc.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\FuncIdx; final readonly class RefFunc extends Instr { - public function __construct( + protected function __construct( public FuncIdx $func, ) { } diff --git a/src/Structure/Instructions/Instrs/Reference/RefNull.php b/src/Structure/Instructions/Instrs/Reference/RefNull.php index b3727c6..06e339c 100644 --- a/src/Structure/Instructions/Instrs/Reference/RefNull.php +++ b/src/Structure/Instructions/Instrs/Reference/RefNull.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\RefType; final readonly class RefNull extends Instr { - public function __construct( + protected function __construct( public RefType $type, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/ElemDrop.php b/src/Structure/Instructions/Instrs/Table/ElemDrop.php index fcaf9ea..5b96fcd 100644 --- a/src/Structure/Instructions/Instrs/Table/ElemDrop.php +++ b/src/Structure/Instructions/Instrs/Table/ElemDrop.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\ElemIdx; final readonly class ElemDrop extends Instr { - public function __construct( + protected function __construct( public ElemIdx $elem, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableCopy.php b/src/Structure/Instructions/Instrs/Table/TableCopy.php index 04a50c8..4c5d008 100644 --- a/src/Structure/Instructions/Instrs/Table/TableCopy.php +++ b/src/Structure/Instructions/Instrs/Table/TableCopy.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableCopy extends Instr { - public function __construct( + protected function __construct( public TableIdx $to, public TableIdx $from, ) { diff --git a/src/Structure/Instructions/Instrs/Table/TableFill.php b/src/Structure/Instructions/Instrs/Table/TableFill.php index 4128657..43d1f57 100644 --- a/src/Structure/Instructions/Instrs/Table/TableFill.php +++ b/src/Structure/Instructions/Instrs/Table/TableFill.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableFill extends Instr { - public function __construct( + protected function __construct( public TableIdx $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableGet.php b/src/Structure/Instructions/Instrs/Table/TableGet.php index bc1b35f..77ebf4a 100644 --- a/src/Structure/Instructions/Instrs/Table/TableGet.php +++ b/src/Structure/Instructions/Instrs/Table/TableGet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableGet extends Instr { - public function __construct( + protected function __construct( public TableIdx $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableGrow.php b/src/Structure/Instructions/Instrs/Table/TableGrow.php index ddd9b2a..2ac222d 100644 --- a/src/Structure/Instructions/Instrs/Table/TableGrow.php +++ b/src/Structure/Instructions/Instrs/Table/TableGrow.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableGrow extends Instr { - public function __construct( + protected function __construct( public TableIdx $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableInit.php b/src/Structure/Instructions/Instrs/Table/TableInit.php index d4666ae..7617809 100644 --- a/src/Structure/Instructions/Instrs/Table/TableInit.php +++ b/src/Structure/Instructions/Instrs/Table/TableInit.php @@ -10,7 +10,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableInit extends Instr { - public function __construct( + protected function __construct( public TableIdx $to, public ElemIdx $from, ) { diff --git a/src/Structure/Instructions/Instrs/Table/TableSet.php b/src/Structure/Instructions/Instrs/Table/TableSet.php index 8aaf11e..7ac7c8e 100644 --- a/src/Structure/Instructions/Instrs/Table/TableSet.php +++ b/src/Structure/Instructions/Instrs/Table/TableSet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableSet extends Instr { - public function __construct( + protected function __construct( public TableIdx $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableSize.php b/src/Structure/Instructions/Instrs/Table/TableSize.php index 00200a6..1c63e34 100644 --- a/src/Structure/Instructions/Instrs/Table/TableSize.php +++ b/src/Structure/Instructions/Instrs/Table/TableSize.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableSize extends Instr { - public function __construct( + protected function __construct( public TableIdx $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php index 7d25650..a3bd2c6 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx; final readonly class GlobalGet extends Instr { - public function __construct( + protected function __construct( public GlobalIdx $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php index 2f32855..080e15a 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx; final readonly class GlobalSet extends Instr { - public function __construct( + protected function __construct( public GlobalIdx $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalGet.php b/src/Structure/Instructions/Instrs/Variable/LocalGet.php index 4c4f794..bc764c2 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalGet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalGet extends Instr { - public function __construct( + protected function __construct( public LocalIdx $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalSet.php b/src/Structure/Instructions/Instrs/Variable/LocalSet.php index d103c22..9b107e8 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalSet.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalSet extends Instr { - public function __construct( + protected function __construct( public LocalIdx $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalTee.php b/src/Structure/Instructions/Instrs/Variable/LocalTee.php index 89e253b..3e48e8e 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalTee.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalTee.php @@ -9,7 +9,7 @@ use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalTee extends Instr { - public function __construct( + protected function __construct( public LocalIdx $var, ) { } -- cgit v1.2.3-70-g09d2