Commit 928bb02c authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Implement the unreachable-instruction with TrapUnless

With this change we can remove all the old trap code.

R=titzer@chromium.org, clemensh@chromium.org

Change-Id: I85c10a6ac7d3eccc7b611e06f2a651d5a8a00a9c
Reviewed-on: https://chromium-review.googlesource.com/452379Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43853}
parent 79ccd3a6
......@@ -1147,10 +1147,12 @@ Node* WasmGraphBuilder::Return(unsigned count, Node** vals) {
return ret;
}
Node* WasmGraphBuilder::ReturnVoid() { return Return(0, Buffer(0)); }
Node* WasmGraphBuilder::ReturnVoid() { return Return(0, nullptr); }
Node* WasmGraphBuilder::Unreachable(wasm::WasmCodePosition position) {
trap_->Unreachable(position);
trap_->AddTrapIfFalse(wasm::TrapReason::kTrapUnreachable, Int32Constant(0),
position);
ReturnVoid();
return nullptr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment