summaryrefslogtreecommitdiff
path: root/src/binary-reader-logging.cc
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-05-28 11:30:38 -0700
committerGitHub <noreply@github.com>2020-05-28 11:30:38 -0700
commitbf46c08b05fc6fcc457f1657e936fab24b4dceee (patch)
treef57a19c670a3e222896c252c829d5eb5ec4db6d2 /src/binary-reader-logging.cc
parent0630dc53755678239d7609b61776b125221eefb8 (diff)
downloadwabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.tar.gz
wabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.tar.bz2
wabt-bf46c08b05fc6fcc457f1657e936fab24b4dceee.zip
Reference types changes to remove subtyping (#1407)
Main changes: * Rename `anyref` -> `externref` * Remove `nullref` * Rename `hostref` -> `externref` * `ref.null` and `ref.is_null` now have "ref kind" parameter * Add ref kind keywords: `func`, `extern`, `exn`
Diffstat (limited to 'src/binary-reader-logging.cc')
-rw-r--r--src/binary-reader-logging.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc
index c3e7e750..ef24ad0e 100644
--- a/src/binary-reader-logging.cc
+++ b/src/binary-reader-logging.cc
@@ -652,12 +652,24 @@ Result BinaryReaderLogging::OnComdatEntry(ComdatType kind, Index index) {
return reader_->name(value); \
}
+#define DEFINE_TYPE(name) \
+ Result BinaryReaderLogging::name(Type type) { \
+ LOGF(#name "(%s)\n", type.GetName()); \
+ return reader_->name(type); \
+ }
+
#define DEFINE_INDEX_DESC(name, desc) \
Result BinaryReaderLogging::name(Index value) { \
LOGF(#name "(" desc ": %" PRIindex ")\n", value); \
return reader_->name(value); \
}
+#define DEFINE_INDEX_TYPE(name) \
+ Result BinaryReaderLogging::name(Index value, Type type) { \
+ LOGF(#name "(index: %" PRIindex ", type: %s)\n", value, type.GetName()); \
+ return reader_->name(value, type); \
+ }
+
#define DEFINE_INDEX_INDEX(name, desc0, desc1) \
Result BinaryReaderLogging::name(Index value0, Index value1) { \
LOGF(#name "(" desc0 ": %" PRIindex ", " desc1 ": %" PRIindex ")\n", \
@@ -777,8 +789,8 @@ DEFINE_INDEX(OnTableGrowExpr)
DEFINE_INDEX(OnTableSizeExpr)
DEFINE_INDEX_DESC(OnTableFillExpr, "table index")
DEFINE_INDEX(OnRefFuncExpr)
-DEFINE0(OnRefNullExpr)
-DEFINE0(OnRefIsNullExpr)
+DEFINE_TYPE(OnRefNullExpr)
+DEFINE_TYPE(OnRefIsNullExpr)
DEFINE0(OnNopExpr)
DEFINE0(OnRethrowExpr);
DEFINE_INDEX_DESC(OnReturnCallExpr, "func_index")
@@ -798,7 +810,7 @@ DEFINE_INDEX(OnElemSegmentCount)
DEFINE_INDEX(BeginElemSegmentInitExpr)
DEFINE_INDEX(EndElemSegmentInitExpr)
DEFINE_INDEX_INDEX(OnElemSegmentElemExprCount, "index", "count")
-DEFINE_INDEX(OnElemSegmentElemExpr_RefNull)
+DEFINE_INDEX_TYPE(OnElemSegmentElemExpr_RefNull)
DEFINE_INDEX_INDEX(OnElemSegmentElemExpr_RefFunc, "index", "func_index")
DEFINE_INDEX(EndElemSegment)
DEFINE_END(EndElemSection)
@@ -825,7 +837,7 @@ DEFINE_BEGIN(BeginRelocSection)
DEFINE_END(EndRelocSection)
DEFINE_INDEX_INDEX(OnInitExprGlobalGetExpr, "index", "global_index")
-DEFINE_INDEX(OnInitExprRefNull)
+DEFINE_INDEX_TYPE(OnInitExprRefNull)
DEFINE_INDEX_INDEX(OnInitExprRefFunc, "index", "func_index")
DEFINE_BEGIN(BeginDylinkSection)
@@ -891,6 +903,10 @@ Result BinaryReaderLogging::OnOpcodeBlockSig(Type sig_type) {
return reader_->OnOpcodeBlockSig(sig_type);
}
+Result BinaryReaderLogging::OnOpcodeType(Type type) {
+ return reader_->OnOpcodeType(type);
+}
+
Result BinaryReaderLogging::OnEndFunc() {
return reader_->OnEndFunc();
}