[wasm][comment] Explain magic wasm-to-js wrapper parameter

Change-Id: Ic0edb4a424b7358a40c54984f0f56f5c0ba05b09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2930171
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75045}
This commit is contained in:
Manos Koukoutos 2021-06-09 12:01:50 +00:00 committed by V8 LUCI CQ
parent 191b637f28
commit 9eebd147c0

View File

@ -6848,7 +6848,12 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
return false;
}
// The callable is passed as the last parameter, after Wasm arguments.
// The Wasm-to-JS wrapper gets passed a pair of (instance, JS callable) in
// parameter kWasmInstanceParameterIndex, instead of just the instance, like
// most wasm functions. In {CodeGenerator::AssembleConstructFrame}, the pair
// expanded into kWasmInstanceRegister and kJSFunctionRegister. The TF call
// descriptor for import wrappers is then adapted to contain an additional
// parameter mapped to kJSFunctionRegister (in {GetWasmCallDescriptor}).
Node* callable_node = Param(wasm_count + 1);
Node* undefined_node = UndefinedValue();