Modules/Objects/public/interpreter/bytecode.h
2024-11-24 22:41:14 +03:00

28 lines
No EOL
488 B
C++

#pragma once
#include "opcodes.h"
#include "primitives/intobject.h"
#include "primitives/stringobject.h"
#include "Buffer.hpp"
#include <string>
namespace obj {
typedef Object* ConstData;
struct ByteCode {
tp::Buffer<ConstData> mConstants;
tp::Buffer<OpCode> mInstructions;
tp::ualni mInstructionIdx = 0;
tp::ualni mArgumentsLoaded = 0;
~ByteCode() {
for (auto const_obj : mConstants) {
NDO->destroy(const_obj.data());
}
}
};
};