Skip to content

Commit

Permalink
Optimize call result push to the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored and axic committed Nov 6, 2020
1 parent 7c0562b commit 1b161a3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,8 @@ inline bool invoke_function(const FuncType& func_type, uint32_t func_idx, Instan

stack.drop(num_args);

const auto num_outputs = func_type.outputs.size();
// NOTE: we can assume these two from validation
assert(num_outputs <= 1);
assert(ret.has_value == (num_outputs == 1));
// Push back the result
if (num_outputs != 0)
if (ret.has_value)
stack.push(ret.value);

return true;
Expand Down

0 comments on commit 1b161a3

Please sign in to comment.