maxStack = $this->readUnsignedShort(); $this->maxLocals = $this->readUnsignedShort(); $this->codeLength = $this->readUnsignedInt(); // read Mnemonics $this->code = []; for ($i = 0; $i < $this->codeLength; $i++) { $this->code[$i] = $this->readUnsignedByte(); $this->rawCode .= chr($this->code[$i]); } // read exception table $this->exceptionTableLength = $this->readUnsignedShort(); for ($i = 0; $i < $this->exceptionTableLength; $i++) { $exceptionTable = new \PHPJava\Kernel\Structures\ExceptionTable($this->reader); $exceptionTable->setConstantPool($this->getConstantPool()); $exceptionTable->setDebugTool($this->getDebugTool()); $exceptionTable->execute(); $this->exceptionTables[] = $exceptionTable; } $this->attributeCount = $this->readUnsignedShort(); for ($i = 0; $i < $this->attributeCount; $i++) { $attributeInfo = new \PHPJava\Kernel\Attributes\AttributeInfo($this->reader); $attributeInfo->setConstantPool($this->getConstantPool()); $attributeInfo->setDebugTool($this->getDebugTool()); $attributeInfo->execute(); $this->attributeInfo[] = $attributeInfo; } } /** * @return \PHPJava\Kernel\Structures\ExceptionTable[] */ public function getExceptionTables(): array { return $this->exceptionTables; } public function getCode(): string { return $this->rawCode; } public function getOpCodes(): int { return $this->code; } public function getOpCodeLength(): int { return (int) $this->codeLength; } }