diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-03-13 22:42:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-03-13 22:42:58 +0900 |
| commit | 814e5197439fbf2b404e8e66f3c6dd6e5ed39776 (patch) | |
| tree | 72901a7e2f1641366d2cfd57b883929989c68328 /src/Structure/Instructions/Instrs | |
| parent | 7348999caf3ce1e0be64697319581d52f1d7f8ea (diff) | |
| download | php-waddiwasi-814e5197439fbf2b404e8e66f3c6dd6e5ed39776.tar.gz php-waddiwasi-814e5197439fbf2b404e8e66f3c6dd6e5ed39776.tar.zst php-waddiwasi-814e5197439fbf2b404e8e66f3c6dd6e5ed39776.zip | |
perf: make *Addr/*Idx to primitive int
Diffstat (limited to 'src/Structure/Instructions/Instrs')
23 files changed, 27 insertions, 57 deletions
diff --git a/src/Structure/Instructions/Instrs/Control/BlockType.php b/src/Structure/Instructions/Instrs/Control/BlockType.php index c2fe106..a90389b 100644 --- a/src/Structure/Instructions/Instrs/Control/BlockType.php +++ b/src/Structure/Instructions/Instrs/Control/BlockType.php @@ -4,12 +4,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; -use Nsfisis\Waddiwasi\Structure\Types\TypeIdx; use Nsfisis\Waddiwasi\Structure\Types\ValType; abstract readonly class BlockType { - final public static function TypeIdx(TypeIdx $type): BlockTypes\TypeIdx + final public static function TypeIdx(int $type): BlockTypes\TypeIdx { return new BlockTypes\TypeIdx($type); } diff --git a/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php b/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php index bb798e4..564eaf4 100644 --- a/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php +++ b/src/Structure/Instructions/Instrs/Control/BlockTypes/TypeIdx.php @@ -5,16 +5,10 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockTypes; use Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control\BlockType; -use Nsfisis\Waddiwasi\Structure\Types\TypeIdx as OrigTypeIdx; final readonly class TypeIdx extends BlockType { - protected function __construct(public OrigTypeIdx $inner) + protected function __construct(public int $inner) { } - - public static function opName(): string - { - return "hoge"; - } } diff --git a/src/Structure/Instructions/Instrs/Control/Br.php b/src/Structure/Instructions/Instrs/Control/Br.php index 26af157..7fe3415 100644 --- a/src/Structure/Instructions/Instrs/Control/Br.php +++ b/src/Structure/Instructions/Instrs/Control/Br.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LabelIdx; final readonly class Br extends Instr { protected function __construct( - public LabelIdx $label, + public int $label, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/BrIf.php b/src/Structure/Instructions/Instrs/Control/BrIf.php index c6a4b3c..5fb622e 100644 --- a/src/Structure/Instructions/Instrs/Control/BrIf.php +++ b/src/Structure/Instructions/Instrs/Control/BrIf.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LabelIdx; final readonly class BrIf extends Instr { protected function __construct( - public LabelIdx $label, + public int $label, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/BrTable.php b/src/Structure/Instructions/Instrs/Control/BrTable.php index c7685f6..a9c37e8 100644 --- a/src/Structure/Instructions/Instrs/Control/BrTable.php +++ b/src/Structure/Instructions/Instrs/Control/BrTable.php @@ -5,16 +5,15 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LabelIdx; final readonly class BrTable extends Instr { /** - * @param list<LabelIdx> $labelTable + * @param list<int> $labelTable */ protected function __construct( public array $labelTable, - public LabelIdx $defaultLabel, + public int $defaultLabel, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/Call.php b/src/Structure/Instructions/Instrs/Control/Call.php index ba73037..9ee14be 100644 --- a/src/Structure/Instructions/Instrs/Control/Call.php +++ b/src/Structure/Instructions/Instrs/Control/Call.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\FuncIdx; final readonly class Call extends Instr { protected function __construct( - public FuncIdx $func, + public int $func, ) { } diff --git a/src/Structure/Instructions/Instrs/Control/CallIndirect.php b/src/Structure/Instructions/Instrs/Control/CallIndirect.php index d6fcea4..11617ce 100644 --- a/src/Structure/Instructions/Instrs/Control/CallIndirect.php +++ b/src/Structure/Instructions/Instrs/Control/CallIndirect.php @@ -5,14 +5,12 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Control; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; -use Nsfisis\Waddiwasi\Structure\Types\TypeIdx; final readonly class CallIndirect extends Instr { protected function __construct( - public TableIdx $funcTable, - public TypeIdx $type, + public int $funcTable, + public int $type, ) { } diff --git a/src/Structure/Instructions/Instrs/Memory/DataDrop.php b/src/Structure/Instructions/Instrs/Memory/DataDrop.php index 90cea96..acf337b 100644 --- a/src/Structure/Instructions/Instrs/Memory/DataDrop.php +++ b/src/Structure/Instructions/Instrs/Memory/DataDrop.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\DataIdx; final readonly class DataDrop extends Instr { protected function __construct( - public DataIdx $data, + public int $data, ) { } diff --git a/src/Structure/Instructions/Instrs/Memory/MemoryInit.php b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php index 5538234..8bf762b 100644 --- a/src/Structure/Instructions/Instrs/Memory/MemoryInit.php +++ b/src/Structure/Instructions/Instrs/Memory/MemoryInit.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Memory; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\DataIdx; final readonly class MemoryInit extends Instr { protected function __construct( - public DataIdx $data, + public int $data, ) { } diff --git a/src/Structure/Instructions/Instrs/Reference/RefFunc.php b/src/Structure/Instructions/Instrs/Reference/RefFunc.php index 0ccbc36..97f11b5 100644 --- a/src/Structure/Instructions/Instrs/Reference/RefFunc.php +++ b/src/Structure/Instructions/Instrs/Reference/RefFunc.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Reference; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\FuncIdx; final readonly class RefFunc extends Instr { protected function __construct( - public FuncIdx $func, + public int $func, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/ElemDrop.php b/src/Structure/Instructions/Instrs/Table/ElemDrop.php index bbf4586..65ea56a 100644 --- a/src/Structure/Instructions/Instrs/Table/ElemDrop.php +++ b/src/Structure/Instructions/Instrs/Table/ElemDrop.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\ElemIdx; final readonly class ElemDrop extends Instr { protected function __construct( - public ElemIdx $elem, + public int $elem, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableCopy.php b/src/Structure/Instructions/Instrs/Table/TableCopy.php index 85aa9fc..b756d28 100644 --- a/src/Structure/Instructions/Instrs/Table/TableCopy.php +++ b/src/Structure/Instructions/Instrs/Table/TableCopy.php @@ -5,13 +5,12 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableCopy extends Instr { protected function __construct( - public TableIdx $to, - public TableIdx $from, + public int $to, + public int $from, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableFill.php b/src/Structure/Instructions/Instrs/Table/TableFill.php index 84c6e13..fea7bb9 100644 --- a/src/Structure/Instructions/Instrs/Table/TableFill.php +++ b/src/Structure/Instructions/Instrs/Table/TableFill.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableFill extends Instr { protected function __construct( - public TableIdx $table, + public int $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableGet.php b/src/Structure/Instructions/Instrs/Table/TableGet.php index e10dd5a..bb7b58f 100644 --- a/src/Structure/Instructions/Instrs/Table/TableGet.php +++ b/src/Structure/Instructions/Instrs/Table/TableGet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableGet extends Instr { protected function __construct( - public TableIdx $table, + public int $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableGrow.php b/src/Structure/Instructions/Instrs/Table/TableGrow.php index 4f224fc..026a09b 100644 --- a/src/Structure/Instructions/Instrs/Table/TableGrow.php +++ b/src/Structure/Instructions/Instrs/Table/TableGrow.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableGrow extends Instr { protected function __construct( - public TableIdx $table, + public int $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableInit.php b/src/Structure/Instructions/Instrs/Table/TableInit.php index 2c834c0..b728de3 100644 --- a/src/Structure/Instructions/Instrs/Table/TableInit.php +++ b/src/Structure/Instructions/Instrs/Table/TableInit.php @@ -5,14 +5,12 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\ElemIdx; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableInit extends Instr { protected function __construct( - public TableIdx $to, - public ElemIdx $from, + public int $to, + public int $from, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableSet.php b/src/Structure/Instructions/Instrs/Table/TableSet.php index f02c375..5e5bb1b 100644 --- a/src/Structure/Instructions/Instrs/Table/TableSet.php +++ b/src/Structure/Instructions/Instrs/Table/TableSet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableSet extends Instr { protected function __construct( - public TableIdx $table, + public int $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Table/TableSize.php b/src/Structure/Instructions/Instrs/Table/TableSize.php index 321c8f7..3357f48 100644 --- a/src/Structure/Instructions/Instrs/Table/TableSize.php +++ b/src/Structure/Instructions/Instrs/Table/TableSize.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Table; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\TableIdx; final readonly class TableSize extends Instr { protected function __construct( - public TableIdx $table, + public int $table, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php index 542a805..8ee9f09 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalGet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx; final readonly class GlobalGet extends Instr { protected function __construct( - public GlobalIdx $var, + public int $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php index 1540dd3..3dbc5ec 100644 --- a/src/Structure/Instructions/Instrs/Variable/GlobalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/GlobalSet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\GlobalIdx; final readonly class GlobalSet extends Instr { protected function __construct( - public GlobalIdx $var, + public int $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalGet.php b/src/Structure/Instructions/Instrs/Variable/LocalGet.php index 4fc0ced..c9ba7e7 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalGet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalGet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalGet extends Instr { protected function __construct( - public LocalIdx $var, + public int $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalSet.php b/src/Structure/Instructions/Instrs/Variable/LocalSet.php index 4a21ca3..eb79baa 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalSet.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalSet.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalSet extends Instr { protected function __construct( - public LocalIdx $var, + public int $var, ) { } diff --git a/src/Structure/Instructions/Instrs/Variable/LocalTee.php b/src/Structure/Instructions/Instrs/Variable/LocalTee.php index 97fb46a..862b4d2 100644 --- a/src/Structure/Instructions/Instrs/Variable/LocalTee.php +++ b/src/Structure/Instructions/Instrs/Variable/LocalTee.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Nsfisis\Waddiwasi\Structure\Instructions\Instrs\Variable; use Nsfisis\Waddiwasi\Structure\Instructions\Instr; -use Nsfisis\Waddiwasi\Structure\Types\LocalIdx; final readonly class LocalTee extends Instr { protected function __construct( - public LocalIdx $var, + public int $var, ) { } |
