Commit e95be459 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Avoid redundant {EndControl}

Many callers of {DoReturn} either already call {EndControl}, or pop
the control afterwards, hence we do not need to {EndControl}.
Hence only call {EndControl} when really needed.

R=herhut@chromium.org

Bug: v8:8423
Change-Id: Ie4e7b2dd6918cc0f9619a72d624014222f58a251
Reviewed-on: https://chromium-review.googlesource.com/c/1384085Reviewed-by: 's avatarStephan Herhut <herhut@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58359}
parent 4aa97de1
...@@ -1895,6 +1895,7 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -1895,6 +1895,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
case kExprReturn: { case kExprReturn: {
if (!TypeCheckReturn()) break; if (!TypeCheckReturn()) break;
DoReturn(); DoReturn();
EndControl();
break; break;
} }
case kExprUnreachable: { case kExprUnreachable: {
...@@ -2572,8 +2573,6 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -2572,8 +2573,6 @@ class WasmFullDecoder : public WasmDecoder<validate> {
: Vector<Value>{&*(stack_.end() - return_count), return_count}; : Vector<Value>{&*(stack_.end() - return_count), return_count};
CALL_INTERFACE_IF_REACHABLE(DoReturn, return_values); CALL_INTERFACE_IF_REACHABLE(DoReturn, return_values);
EndControl();
} }
inline Value* Push(ValueType type) { inline Value* Push(ValueType type) {
......
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