summaryrefslogtreecommitdiff
path: root/src/binary-reader-logging.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-reader-logging.cc')
-rw-r--r--src/binary-reader-logging.cc46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc
index b1896c73..f730a865 100644
--- a/src/binary-reader-logging.cc
+++ b/src/binary-reader-logging.cc
@@ -76,10 +76,18 @@ void BinaryReaderLogging::WriteIndent() {
}
}
+void BinaryReaderLogging::LogType(Type type) {
+ if (IsTypeIndex(type)) {
+ LOGF_NOINDENT("funcidx[%d]", static_cast<int>(type));
+ } else {
+ LOGF_NOINDENT("%s", GetTypeName(type));
+ }
+}
+
void BinaryReaderLogging::LogTypes(Index type_count, Type* types) {
LOGF_NOINDENT("[");
for (Index i = 0; i < type_count; ++i) {
- LOGF_NOINDENT("%s", GetTypeName(types[i]));
+ LogType(types[i]);
if (i != type_count - 1) {
LOGF_NOINDENT(", ");
}
@@ -254,11 +262,11 @@ Result BinaryReaderLogging::OnLocalDecl(Index decl_index,
return reader_->OnLocalDecl(decl_index, count, type);
}
-Result BinaryReaderLogging::OnBlockExpr(Index num_types, Type* sig_types) {
+Result BinaryReaderLogging::OnBlockExpr(Type sig_type) {
LOGF("OnBlockExpr(sig: ");
- LogTypes(num_types, sig_types);
+ LogType(sig_type);
LOGF_NOINDENT(")\n");
- return reader_->OnBlockExpr(num_types, sig_types);
+ return reader_->OnBlockExpr(sig_type);
}
Result BinaryReaderLogging::OnBrExpr(Index depth) {
@@ -323,34 +331,32 @@ Result BinaryReaderLogging::OnI64ConstExpr(uint64_t value) {
return reader_->OnI64ConstExpr(value);
}
-Result BinaryReaderLogging::OnIfExpr(Index num_types, Type* sig_types) {
+Result BinaryReaderLogging::OnIfExpr(Type sig_type) {
LOGF("OnIfExpr(sig: ");
- LogTypes(num_types, sig_types);
+ LogType(sig_type);
LOGF_NOINDENT(")\n");
- return reader_->OnIfExpr(num_types, sig_types);
+ return reader_->OnIfExpr(sig_type);
}
-Result BinaryReaderLogging::OnIfExceptExpr(Index num_types,
- Type* sig_types,
- Index except_index) {
+Result BinaryReaderLogging::OnIfExceptExpr(Type sig_type, Index except_index) {
LOGF("OnIfExceptExpr(sig: ");
- LogTypes(num_types, sig_types);
+ LogType(sig_type);
LOGF_NOINDENT(", except: %" PRIindex ")\n", except_index);
- return reader_->OnIfExceptExpr(num_types, sig_types, except_index);
+ return reader_->OnIfExceptExpr(sig_type, except_index);
}
-Result BinaryReaderLogging::OnLoopExpr(Index num_types, Type* sig_types) {
+Result BinaryReaderLogging::OnLoopExpr(Type sig_type) {
LOGF("OnLoopExpr(sig: ");
- LogTypes(num_types, sig_types);
+ LogType(sig_type);
LOGF_NOINDENT(")\n");
- return reader_->OnLoopExpr(num_types, sig_types);
+ return reader_->OnLoopExpr(sig_type);
}
-Result BinaryReaderLogging::OnTryExpr(Index num_types, Type* sig_types) {
+Result BinaryReaderLogging::OnTryExpr(Type sig_type) {
LOGF("OnTryExpr(sig: ");
- LogTypes(num_types, sig_types);
+ LogType(sig_type);
LOGF_NOINDENT(")\n");
- return reader_->OnTryExpr(num_types, sig_types);
+ return reader_->OnTryExpr(sig_type);
}
Result BinaryReaderLogging::OnSimdLaneOpExpr(Opcode opcode, uint64_t value) {
@@ -753,8 +759,8 @@ Result BinaryReaderLogging::OnOpcodeV128(v128 value) {
return reader_->OnOpcodeV128(value);
}
-Result BinaryReaderLogging::OnOpcodeBlockSig(Index num_types, Type* sig_types) {
- return reader_->OnOpcodeBlockSig(num_types, sig_types);
+Result BinaryReaderLogging::OnOpcodeBlockSig(Type sig_type) {
+ return reader_->OnOpcodeBlockSig(sig_type);
}
Result BinaryReaderLogging::OnEndFunc() {