[browser] streamline Task/Promise marshalling - atttemp 2 #93648
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Second attempt to #93010
This streamlines passing Promise/Task from two cross-boundary calls per promise argument to one.
Changes
create_task_callbackcomplete_taskmono_wasm_marshal_promiseand rename it tomono_wasm_resolve_or_reject_promiseGCVHandleGCHandlein that it keeps proxy of C# object alive while JS owns it.JSVHandleJSHandlein that it keeps proxy of JS object alive while C# owns it.GetTaskResultDynamicto handlevoidTaskJSObject.DisposeLocalInterop "stack frame"
IntPtrand handles to beI32rather thanU32MarshalerTypefromI32toU8sizeMarshalerType.TaskResolvedandMarshalerType.TaskRejectedJSMarshalerArgumentslotJSMarshalerArgument.ElementTypeto different offsetJSMarshalerArgument.ElementTypenow contains type of the promise's resultJSBindingTypelayout accordingly.2Other
WeakRefInternal<T>ForceDisposeProxiesin the middle of the program because it can't balance C# side of handles