-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[browser] streamline Task/Promise marshalling - atttemp 2 #93648
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pavelsavara
added
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
labels
Oct 18, 2023
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsSecond attempt to #93010 This streamlines passing Promise/Task from two cross-boundary calls per promise argument to one.
Changes
Interop "stack frame"
Other
|
pavelsavara
changed the title
second attempt https://github.com/dotnet/runtime/pull/93010
[browser] streamline Task/Promise marshalling - atttemp 2
Oct 18, 2023
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
maraf
approved these changes
Oct 19, 2023
...nteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSFunctionBinding.cs
Show resolved
Hide resolved
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
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