Skip to content
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] JSImport binding improvements #95177

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Nov 23, 2023

Preparation for better MT dispatch.

  • make function_name and module_name part of the import signature buffer
  • assign import handle in C# side, not is JS side
  • detect if method are async with signature.IsAsync
  • detect if parameters have thread affinity with signature.IsThreadCaptured
  • made all callbacks to task.ContinueWith static

Other

  • rename JSSynchronizationContext.TargetThreadId to TargetTID
  • rename BindJSFunction to BindJSImport
  • rename InvokeImport to InvokeJSImport
  • rename mono_wasm_bind_js_function to mono_wasm_bind_js_import
  • rename mono_wasm_invoke_import to mono_wasm_invoke_js_import
  • drop parameter in InstallWebWorkerInterop, always install full
  • <EmitCompilerGeneratedFiles> in debug mode for few projects

assign ImportHandle in C# side, not is JS side
detect if method are async with signature.IsAsync
detect fi parameters have thread affinity with signature.IsThreadCaptured
made all task.ContinueWith static
rename JSSynchronizationContext.TargetThreadId to TargetTID
rename BindJSFunction to BindJSImport
rename InvokeImport to InvokeJSImport
rename mono_wasm_bind_js_function to mono_wasm_bind_js_import
rename mono_wasm_invoke_import to mono_wasm_invoke_js_import
drop parameter InstallWebWorkerInterop, always install full
EmitCompilerGeneratedFiles in debug mode for few projects
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Nov 23, 2023
@pavelsavara pavelsavara added this to the 9.0.0 milestone Nov 23, 2023
@pavelsavara pavelsavara self-assigned this Nov 23, 2023
@ghost
Copy link

ghost commented Nov 23, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • make function_name and module_name part of the import signature buffer
  • assign import handle in C# side, not is JS side
  • detect if method are async with signature.IsAsync
  • detect if parameters have thread affinity with signature.IsThreadCaptured
  • made all callbacks to task.ContinueWith static

Other

  • rename JSSynchronizationContext.TargetThreadId to TargetTID
  • rename BindJSFunction to BindJSImport
  • rename InvokeImport to InvokeJSImport
  • rename mono_wasm_bind_js_function to mono_wasm_bind_js_import
  • rename mono_wasm_invoke_import to mono_wasm_invoke_js_import
  • drop parameter in InstallWebWorkerInterop, always install full
  • <EmitCompilerGeneratedFiles> in debug mode for few projects
Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript, os-browser

Milestone: 9.0.0

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara marked this pull request as ready for review November 23, 2023 15:41
Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@pavelsavara pavelsavara merged commit f38242b into dotnet:main Nov 27, 2023
120 checks passed
@pavelsavara pavelsavara deleted the browser_jsimport_bind branch November 27, 2023 14:29
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants