28 lines
No EOL
488 B
C++
28 lines
No EOL
488 B
C++
|
|
#pragma once
|
|
|
|
#include "OperatoinCodes.hpp"
|
|
|
|
#include "primitives/IntObject.hpp"
|
|
#include "primitives/StringObject.hpp"
|
|
|
|
#include "Buffer.hpp"
|
|
#include <string>
|
|
|
|
namespace tp::obj {
|
|
|
|
typedef Object* ConstData;
|
|
|
|
struct ByteCode {
|
|
Buffer<ConstData> mConstants;
|
|
Buffer<OpCode> mInstructions;
|
|
ualni mInstructionIdx = 0;
|
|
ualni mArgumentsLoaded = 0;
|
|
|
|
~ByteCode() {
|
|
for (auto const_obj : mConstants) {
|
|
NDO->destroy(const_obj.data());
|
|
}
|
|
}
|
|
};
|
|
} |