Commit 329e35fb authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Simplify {InterpreterHandle::Unwind} a bit.

R=clemensh@chromium.org

Change-Id: I09cc32bbb43c8659805d7d93637d5be7f61e9fd5
Reviewed-on: https://chromium-review.googlesource.com/c/1447711Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59240}
parent 3974a655
......@@ -385,17 +385,11 @@ class InterpreterHandle {
// Activations must be properly stacked:
DCHECK_EQ(activations_.size() - 1, activations_[frame_pointer]);
uint32_t activation_id = static_cast<uint32_t>(activations_.size() - 1);
// Unwind the frames of the current activation if not already unwound.
WasmInterpreter::Thread* thread = interpreter()->GetThread(0);
if (static_cast<uint32_t>(thread->GetFrameCount()) >
thread->ActivationFrameBase(activation_id)) {
using ExceptionResult = WasmInterpreter::Thread::ExceptionHandlingResult;
ExceptionResult result = thread->HandleException(isolate_);
// TODO(wasm): Handle exceptions caught in wasm land.
CHECK_EQ(ExceptionResult::UNWOUND, result);
}
// The top activation must have no active frames. The interpreter already
// had a chance to handle exceptions and hence dropped all frames.
DCHECK_EQ(interpreter()->GetThread(0)->GetFrameCount(),
interpreter()->GetThread(0)->ActivationFrameBase(activation_id));
// All that remains to be done is finish the activation.
FinishActivation(frame_pointer, activation_id);
}
......
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