Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
m3m0r7 committed Dec 29, 2023
1 parent a568cab commit 32d5572
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 6 additions & 0 deletions src/VM/Core/Runtime/Kernel/Ruby3/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ protected function setupHeaders(): KernelInterface
$this->magic = $this->stream()->read(4);
$this->majorVersion = $this->stream()->readAsUnsignedLong();
$this->minorVersion = $this->stream()->readAsUnsignedLong();
$this->size = $this->stream()->readAsUnsignedLong();
$this->extraSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListSize = $this->stream()->readAsUnsignedLong();
$this->globalObjectListSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListOffset = $this->stream()->readAsUnsignedLong();
$this->globalObjectListOffset = $this->stream()->readAsUnsignedLong();

return $this;
}
Expand Down
6 changes: 0 additions & 6 deletions src/VM/Core/Runtime/Kernel/Ruby3_2/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ protected function setupHeaders(): KernelInterface
{
parent::setupHeaders();

$this->size = $this->stream()->readAsUnsignedLong();
$this->extraSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListSize = $this->stream()->readAsUnsignedLong();
$this->globalObjectListSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListOffset = $this->stream()->readAsUnsignedLong();
$this->globalObjectListOffset = $this->stream()->readAsUnsignedLong();
$this->rubyPlatform = $this->stream()->readAsString();

return $this;
Expand Down
10 changes: 2 additions & 8 deletions src/VM/Core/Runtime/Kernel/Ruby3_3/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ protected function setupHeaders(): KernelInterface
{
parent::setupHeaders();

$this->size = $this->stream()->readAsUnsignedLong();
$this->extraSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListSize = $this->stream()->readAsUnsignedLong();
$this->globalObjectListSize = $this->stream()->readAsUnsignedLong();
$this->instructionSequenceListOffset = $this->stream()->readAsUnsignedLong();
$this->globalObjectListOffset = $this->stream()->readAsUnsignedLong();
$this->endian = $this->stream()->readAsShort();
$this->wordSize = $this->stream()->readAsShort();
$this->endian = $this->stream()->readAsUnsignedShort();
$this->wordSize = $this->stream()->readAsUnsignedShort();

return $this;
}
Expand Down

0 comments on commit 32d5572

Please sign in to comment.