Bug 170360 - WebAssembly: downgrade likely unused fast memory modules to slow memory
Summary: WebAssembly: downgrade likely unused fast memory modules to slow memory
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 159775
  Show dependency treegraph
 
Reported: 2017-03-31 14:05 PDT by JF Bastien
Modified: 2017-03-31 14:05 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2017-03-31 14:05:56 PDT
In setting where we have a limited number of fast memories, it's possible that the GC inadvertently keeps one alive by keeping the WebAssemblyInstance alive. That's a bummer because we're wasting a precious fast memory. We could have a heuristic to figure out whether an Instance executes at all (counters on function entry, or from JS exports, or when the GC scans the stack) and if we think an Instance is dead the downgrade it to a BoundsChecking memory instead. This requires changing its mode, deleting all its code, and making damn sure none of the code is currently on a call stack. Or performing OSR.

This is a lot of work and may not be worth it, but let's keep it in mind.