34 lines
684 B
C++
34 lines
684 B
C++
#include "vm_provider.hpp"
|
|
#include "vm.hpp"
|
|
|
|
using namespace sliger::rpc::vm_provider;
|
|
|
|
auto VmProvider::load_and_run(std::vector<uint32_t> instructions) -> void
|
|
{
|
|
auto vm = VM(instructions,
|
|
{
|
|
.flame_graph = true,
|
|
.code_coverage = true,
|
|
});
|
|
vm.run_until_done();
|
|
this->vm = vm;
|
|
}
|
|
|
|
auto VmProvider::flame_graph_json() -> std::optional<std::string>
|
|
{
|
|
if (this->vm) {
|
|
return this->vm->flame_graph_json();
|
|
} else {
|
|
return {};
|
|
}
|
|
}
|
|
|
|
auto VmProvider::code_coverage_json() -> std::optional<std::string>
|
|
{
|
|
if (this->vm) {
|
|
return this->vm->code_coverage_json();
|
|
} else {
|
|
return {};
|
|
}
|
|
}
|