blob: cd6c232b5fb59ec62a846675dbb6708a9f3023d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "wasm-interpreter.h"
namespace wasm {
#ifdef WASM_INTERPRETER_DEBUG
int Indenter::indentLevel = 0;
Indenter::Indenter(const char* entry) : entryName(entry) { ++indentLevel; }
Indenter::~Indenter() {
print();
std::cout << "exit " << entryName << '\n';
--indentLevel;
}
void Indenter::print() {
std::cout << indentLevel << ':';
for (int i = 0; i <= indentLevel; ++i) {
std::cout << ' ';
}
}
#endif // WASM_INTERPRETER_DEBUG
std::ostream& operator<<(std::ostream& o, const WasmException& exn) {
auto exnData = exn.exn.getExnData();
return o << exnData->tag << " " << exnData->payload;
}
} // namespace wasm
|