Skip to content

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

Merged
lewing merged 33 commits into
dotnet:mainfrom
pavelsavara:wasm_interop_cs_owned
Aug 17, 2021
Merged

[wasm] Redesign of JS objects marshaling and lifecycle#57098
lewing merged 33 commits into
dotnet:mainfrom
pavelsavara:wasm_interop_cs_owned

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Aug 9, 2021

Copy link
Copy Markdown
Member
  • 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

ghost commented Aug 9, 2021

Copy link
Copy Markdown

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: -

Comment thread src/mono/wasm/runtime/binding_support.js Outdated
@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

lewing commented Aug 16, 2021

Copy link
Copy Markdown
Member

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

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

@kg kg left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/mono/wasm/runtime/binding_support.js Outdated
Comment thread src/mono/wasm/runtime/binding_support.js Outdated
Comment thread src/mono/wasm/runtime/binding_support.js Outdated
@pavelsavara
pavelsavara requested a review from kg August 16, 2021 16:32
Comment thread src/mono/wasm/runtime/binding_support.js Outdated
@pavelsavara
pavelsavara force-pushed the wasm_interop_cs_owned branch from 743abcb to b8ad165 Compare August 16, 2021 19:19
@pavelsavara

Copy link
Copy Markdown
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

lewing commented Aug 17, 2021

Copy link
Copy Markdown
Member

browser failures are #57501

@lewing

lewing commented Aug 17, 2021

Copy link
Copy Markdown
Member

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
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