Stream: git-wasmtime

Topic: wasmtime / PR #2059 Validate modules while translating


view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2020 at 22:44):

alexcrichton opened PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(bytecodealliance/wasmparser#62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2020 at 22:45):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(bytecodealliance/wasmparser#62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 08:14):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 08:14):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 08:14):

bnjbvr created PR Review Comment:

(Probably a dumb question, but just a sanity check) Does the validator keep internal state to remember which sections it has seen? This might have an impact since sections are supposed to appear in a certain order.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 13:55):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 13:55):

alexcrichton created PR Review Comment:

It does indeed!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 14:29):

alexcrichton edited PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 15:03):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 15:16):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 16:23):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 16:24):

alexcrichton has marked PR #2059 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 16:24):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 18:38):

yurydelendik submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 22 2020 at 22:11):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:10):

bnjbvr created PR Review Comment:

One early comment (before i try this tomorrow): can you please expose wasmparser::FuncValidator publicly, so that embedders aren't required to add wasmparser to their own dependencies?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:10):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:10):

bnjbvr edited PR Review Comment.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:39):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:40):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:40):

alexcrichton created PR Review Comment:

Sure thing! I've pushed up a comment which reexports wasmparser as a crate since there's a number of types/etc you'll likely want to pull from there.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2020 at 17:48):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2020 at 15:33):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2020 at 18:23):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2020 at 19:32):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2020 at 19:35):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 04 2020 at 17:54):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2020 at 18:56):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2020 at 05:47):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2020 at 21:06):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2020 at 00:50):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 30 2020 at 19:55):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 30 2020 at 21:17):

alexcrichton updated PR #2059 from late-validate to main:

This commit is a change to cranelift-wasm to validate each function body
as it is translated. Additionally top-level module translation functions
will perform module validation. This commit builds on changes in
wasmparser to perform module validation interwtwined with parsing and
translation. This will be necessary for future wasm features such as
module linking where the type behind a function index, for example, can
be far away in another module. Additionally this also brings a nice
benefit where parsing the binary only happens once (instead of having an
up-front serial validation step) and validation can happen in parallel
for each function.

Most of the changes in this commit are plumbing to make sure everything
lines up right. The major functional change here is that module
compilation should be faster by validating in parallel (or skipping
function validation entirely in the case of a cache hit). Otherwise from
a user-facing perspective nothing should be that different.

This commit does mean that cranelift's translation now inherently
validates the input wasm module. This means that the Spidermonkey
integration of cranelift-wasm will also be validating the function as
it's being translated with cranelift. The associated PR for wasmparser
(https://github.com/bytecodealliance/wasm-tools/pull/62) provides the necessary tools to create
a FuncValidator for Gecko, but this is something I'll want careful
review for before landing!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2020 at 16:02):

alexcrichton merged PR #2059.


Last updated: Dec 23 2024 at 12:05 UTC