![]() |
Phasor 3.3.0
Stack VM based Programming Language
|
Bytecode binary format deserializer. More...
#include <BytecodeDeserializer.hpp>
Public Member Functions | |
| Bytecode | deserialize (const std::vector< u8 > &data) |
| Deserialize bytecode from binary buffer. | |
| Bytecode | loadFromFile (const std::filesystem::path &filename) |
| Load bytecode from .phsb file. | |
Private Member Functions | |
| u8 | readUInt8 () |
| Helper method to read UInt8. | |
| u16 | readUInt16 () |
| Helper method to read UInt16. | |
| u32 | readUInt32 () |
| Helper method to read UInt32. | |
| i32 | readInt32 () |
| Helper method to read Int32. | |
| i64 | readInt64 () |
| Helper method to read Int64. | |
| f64 | readDouble () |
| Helper method to read Double. | |
| std::string | readString () |
| Helper method to read String. | |
| Value | readValue () |
| Read a single Value (recursive — handles nested structs/arrays). | |
| void | readHeader (u32 &checksum) |
| Helper method to read Header. | |
| void | readConstantPool (Bytecode &bytecode) |
| Helper method to read Constants Table. | |
| void | readVariableMapping (Bytecode &bytecode) |
| Helper method to read Variable Table. | |
| void | readInstructions (Bytecode &bytecode) |
| Helper method to read Instructions Table. | |
| void | readFunctionEntries (Bytecode &bytecode) |
| Helper method to read Function Entries. | |
| void | readStructSection (Bytecode &bytecode) |
| Helper method to read Struct Section. | |
Static Private Member Functions | |
| static u32 | calculateCRC32 (const u8 *data, size_t size) |
| Calculate CRC32 checksum. | |
Private Attributes | |
| const u8 * | _data |
| size_t | position |
| size_t | dataSize |
Bytecode binary format deserializer.
Definition at line 18 of file BytecodeDeserializer.hpp.
Calculate CRC32 checksum.
Definition at line 38 of file BytecodeDeserializer.cpp.
Deserialize bytecode from binary buffer.
Definition at line 282 of file BytecodeDeserializer.cpp.
| Bytecode Phasor::BytecodeDeserializer::loadFromFile | ( | const std::filesystem::path & | filename | ) |
Load bytecode from .phsb file.
Definition at line 308 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Constants Table.
Definition at line 186 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Double.
Definition at line 91 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Function Entries.
Definition at line 232 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Header.
Definition at line 170 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Instructions Table.
Definition at line 214 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Int32.
Definition at line 78 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Int64.
Definition at line 83 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read String.
Definition at line 101 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Struct Section.
Read struct type definitions section (0x05).
Reconstructs bytecode.structs and bytecode.structEntries.
Definition at line 252 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read UInt16.
Definition at line 60 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read UInt32.
Definition at line 68 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read UInt8.
Definition at line 53 of file BytecodeDeserializer.cpp.
|
private |
Read a single Value (recursive — handles nested structs/arrays).
Definition at line 114 of file BytecodeDeserializer.cpp.
|
private |
Helper method to read Variable Table.
Definition at line 198 of file BytecodeDeserializer.cpp.
|
private |
Definition at line 28 of file BytecodeDeserializer.hpp.
|
private |
Definition at line 30 of file BytecodeDeserializer.hpp.
|
private |
Definition at line 29 of file BytecodeDeserializer.hpp.