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

[wasm] Redesign of JS objects marshaling and lifecycle #57098

Merged
merged 33 commits into from
Aug 17, 2021

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Aug 9, 2021

  • switched from gc_handle to js_handle for all JSObject marshaling
  • got rid of AnyRefHandle
  • got rid of bool ownsHandle
  • got rid of mono_wasm_owned_objects_frames and mono_wasm_owned_objects_LMF
  • got rid of ref counting code on AnyRef
  • got rid of AnyRef and HostObjectBase types
  • simplified instantiation of JSObject to single call
  • improves the way how in-flight references are added
  • asserts for disposed JSObject for fast fail
  • implements fallback strategy when old Safari doesn't have FinalizationRegistry and WeakRef

Fixes #56303

@ghost
Copy link

ghost commented Aug 9, 2021

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

Issue Details

null

Author: pavelsavara
Assignees: -
Labels:

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

Milestone: -

@pavelsavara pavelsavara marked this pull request as ready for review August 10, 2021 14:28
@pavelsavara pavelsavara changed the title [wasm][interop] Redesign of all marshaled JS objects [wasm] Redesign of JS objects marshaling and lifecycle Aug 10, 2021
@lewing
Copy link
Member

lewing commented Aug 16, 2021

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara requested a review from kg August 16, 2021 14:22
Copy link
Member

@kg kg left a comment

Choose a reason for hiding this comment

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

Latest changes look good aside from the comments I added in here and sent via convo

src/mono/wasm/runtime/binding_support.js Outdated Show resolved Hide resolved
src/mono/wasm/runtime/binding_support.js Show resolved Hide resolved
src/mono/wasm/runtime/binding_support.js Outdated Show resolved Hide resolved
@pavelsavara pavelsavara requested a review from kg August 16, 2021 16:32
src/mono/wasm/runtime/binding_support.js Outdated Show resolved Hide resolved
@pavelsavara
Copy link
Member Author

The failures are unrelated VB overflow issue and unrelated JIT issues on Android.
There is probably timing issue in System.Net.WebSockets.Client.Tests.CancelTest.ConnectAsync_Cancel_ThrowsCancellationException of staging lane. I don't know if it could be related or not.

@lewing
Copy link
Member

lewing commented Aug 17, 2021

browser failures are #57501

@lewing
Copy link
Member

lewing commented Aug 17, 2021

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lewing lewing merged commit ead035b into dotnet:main Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2021
@pavelsavara pavelsavara deleted the wasm_interop_cs_owned branch November 20, 2021 19:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wasm] JSObject parameters of callback from JS to managed are not released and stay inFlight
3 participants