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/Control | |
| 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/Control')
7 files changed, 9 insertions, 22 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, ) { } |
