Bug 161727 - Add support for WASM calls
Summary: Add support for WASM calls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks: 159775
  Show dependency treegraph
 
Reported: 2016-09-07 18:36 PDT by Keith Miller
Modified: 2016-10-21 09:05 PDT (History)
8 users (show)

See Also:


Attachments
Patch (31.85 KB, patch)
2016-10-20 13:47 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (41.70 KB, patch)
2016-10-20 18:47 PDT, Keith Miller
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-09-07 18:36:18 PDT
...
Comment 1 Keith Miller 2016-10-20 13:47:28 PDT
Created attachment 292246 [details]
Patch
Comment 2 Keith Miller 2016-10-20 13:49:56 PDT
Comment on attachment 292246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292246&action=review

> Source/JavaScriptCore/wasm/WASMB3IRGenerator.cpp:219
> +    // m_unlinkedCalls is a mapping from a function's index to a list of callsites that need to be linked.

I changed this to: // m_unlikedCalls is list of each call site and the function index whose address it should be patched with.
Comment 3 Michael Saboff 2016-10-20 15:54:13 PDT
Comment on attachment 292246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292246&action=review

r=me

> Source/JavaScriptCore/ChangeLog:11
> +        have been compiled by the time current function has started compilation we don't know what

How about ... by the time *the* current function ...?

> Source/JavaScriptCore/ChangeLog:12
> +        address we need to call to.  For each callsite in the compiling function WASM remembers what

Comma after "function"?

> Source/JavaScriptCore/ChangeLog:14
> +        each functions callsites are linked to the appropriate entrypoint.

Hoe about '... *is* linked ...'?
Comment 4 Keith Miller 2016-10-20 18:47:15 PDT
Created attachment 292307 [details]
Patch
Comment 5 Filip Pizlo 2016-10-20 19:17:07 PDT
Comment on attachment 292307 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292307&action=review

Looks sensible.

> Source/JavaScriptCore/wasm/WASMCallingConvention.h:53
> +        : m_gpRegisterArguments(gpRegisterArguments)
> +        , m_fpRegisterArguments(fpRegisterArguments)

I think we would normally say m_gprArgs and m_fprArgs.

> Source/JavaScriptCore/wasm/WASMCallingConvention.h:59
> +    B3::ValueRep marshallArgumentImpl(Vector<Reg> registerArguments, B3::Type type, size_t& count, size_t& stackOffset) const

regArgs
Comment 6 Keith Miller 2016-10-21 09:05:30 PDT
Committed r207671: <http://trac.webkit.org/changeset/207671>