Skip to content

Use v8 to test wasm binaries are valid in test suite binary format checks#2206

Merged
kripken merged 9 commits into
masterfrom
v8bin
Jul 3, 2019
Merged

Use v8 to test wasm binaries are valid in test suite binary format checks#2206
kripken merged 9 commits into
masterfrom
v8bin

Conversation

@kripken

@kripken kripken commented Jul 3, 2019

Copy link
Copy Markdown
Member

No description provided.

@kripken kripken requested a review from aheejin July 3, 2019 12:53

@aheejin aheejin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! By the way, there seem to be some .wasm files (without matching .wast files) in test/ directory. Do we need to test them too?

Comment thread scripts/test/shared.py Outdated
Comment thread scripts/validation_shell.js Outdated
if (!binary.buffer) binary = new Uint8Array(binary);
} else {
var args;
if (typeof scriptArgs != 'undefined') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is scriptArgs? (I don't know much about the JS part, sorry)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's one of the ways various JS shells give us access to the commandline params. I think scriptArgs is for spidermonkey and arguments is for v8 (or maybe the opposite).

Comment thread scripts/validation_shell.js Outdated

// Test the wasm for validity. The imports aren't there (we can't use a proxy
// because we don't know the types), but if we get to the imports, that means
// the wasm is valid.

@aheejin aheejin Jul 3, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know much about the v8 validation process. Are imports validated after all other things?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, it compiles first, then uses imports only when creating an instance (at least v8 and sm do - perhaps chakra does lazy validation/compilation?).

Thinking about this again now, I see the code can be much simpler - we can just compile and not even create an instance, so no imports are involved.

@kripken

kripken commented Jul 3, 2019

Copy link
Copy Markdown
Member Author

Thanks, that commit should address those comments.

Except for the note about other wasm files in test/ - good point, we should check them too. I'll do it as a followup.

@kripken

kripken commented Jul 3, 2019

Copy link
Copy Markdown
Member Author

Turns out it was just the wasm-dis checks - I was worried there were more. So I added those other wasm files in this PR.

Removed one old invalid file while doing so.

@aheejin aheejin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@kripken kripken merged commit 256187c into master Jul 3, 2019
@kripken kripken deleted the v8bin branch July 3, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants