diff options
author | Ben Smith <binjimin@gmail.com> | 2018-03-02 17:48:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 17:48:10 -0800 |
commit | c0e3c8ae30236582060dfa830bf405b209d9e149 (patch) | |
tree | b0723ece60bf89f31c2a19701465e9af19e9f6f3 /src/binary-reader-objdump.cc | |
parent | 2c591c592b5e1480e4d69093dd051348c1ec5f0e (diff) | |
download | wabt-c0e3c8ae30236582060dfa830bf405b209d9e149.tar.gz wabt-c0e3c8ae30236582060dfa830bf405b209d9e149.tar.bz2 wabt-c0e3c8ae30236582060dfa830bf405b209d9e149.zip |
WIP on support for level1 exception spec (#773)
Implemented:
* Parsing `try`, `if_except`, `throw`, `rethrow`
* Validation
* Binary and text output
Still missing:
* `except_ref` for locals
* Interpreter implementation
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index 25e2b1b3..b84a4691 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -204,6 +204,9 @@ class BinaryReaderObjdumpDisassemble : public BinaryReaderObjdumpBase { Result OnBrTableExpr(Index num_targets, Index* target_depths, Index default_target_depth) override; + Result OnIfExceptExpr(Index num_types, + Type* sig_types, + Index except_index) override; Result OnEndExpr() override; Result OnEndFunc() override; @@ -270,7 +273,6 @@ void BinaryReaderObjdumpDisassemble::LogOpcode(const uint8_t* data, switch (current_opcode) { case Opcode::Else: case Opcode::Catch: - case Opcode::CatchAll: indent_level--; default: break; @@ -366,6 +368,20 @@ Result BinaryReaderObjdumpDisassemble::OnBrTableExpr( return Result::Ok; } +Result BinaryReaderObjdumpDisassemble::OnIfExceptExpr(Index num_types, + Type* sig_types, + Index except_index) { + Offset immediate_len = state->offset - current_opcode_offset; + if (num_types) { + LogOpcode(data_, immediate_len, "%s %u", GetTypeName(*sig_types), + except_index); + } else { + LogOpcode(data_, immediate_len, "%u", except_index); + } + indent_level++; + return Result::Ok; +} + Result BinaryReaderObjdumpDisassemble::OnEndFunc() { LogOpcode(nullptr, 0, nullptr); return Result::Ok; |