[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_callback
complete_task
mono_wasm_marshal_promise
and rename it tomono_wasm_resolve_or_reject_promise
GCVHandle
GCHandle
in that it keeps proxy of C# object alive while JS owns it.JSVHandle
JSHandle
in that it keeps proxy of JS object alive while C# owns it.GetTaskResultDynamic
to handlevoid
TaskJSObject.DisposeLocal
Interop "stack frame"
IntPtr
and handles to beI32
rather thanU32
MarshalerType
fromI32
toU8
sizeMarshalerType.TaskResolved
andMarshalerType.TaskRejected
JSMarshalerArgument
slotJSMarshalerArgument.ElementType
to different offsetJSMarshalerArgument.ElementType
now contains type of the promise's resultJSBindingType
layout accordingly.2
Other
WeakRefInternal<T>
ForceDisposeProxies
in the middle of the program because it can't balance C# side of handles