Skip to content

Commit

Permalink
Remove redundant type checks from WASM calls. (envoyproxy#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
jplevyak authored Feb 26, 2019
1 parent 266cd5f commit 241fec3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/extensions/common/wasm/wavm/wavm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ void getFunctionWavmReturn(WasmVm* vm, absl::string_view functionName,
throw WasmVmException(fmt::format("Bad function signature for: {}", functionName));
}
*function = [wavm, f](Context* context, Args... args) -> R {
CALL_WITH_CONTEXT_RETURN(invokeFunctionChecked(wavm->context(), f, {args...}), context,
UntaggedValue values[] = { args...};
CALL_WITH_CONTEXT_RETURN(invokeFunctionUnchecked(wavm->context(), f, &values[0]), context,
uint32_t, i32);
};
}
Expand All @@ -460,7 +461,8 @@ void getFunctionWavmReturn(WasmVm* vm, absl::string_view functionName,
throw WasmVmException(fmt::format("Bad function signature for: {}", functionName));
}
*function = [wavm, f](Context* context, Args... args) -> R {
CALL_WITH_CONTEXT(invokeFunctionChecked(wavm->context(), f, {args...}), context);
UntaggedValue values[] = { args...};
CALL_WITH_CONTEXT(invokeFunctionUnchecked(wavm->context(), f, &values[0]), context);
};
}

Expand Down

0 comments on commit 241fec3

Please sign in to comment.