Bug 165883 - WebAssembly: Add various low hanging fruit that will allow us to run the LLVM torture tests in Wasm
Summary: WebAssembly: Add various low hanging fruit that will allow us to run the LLVM...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
: 165671 165684 165782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-14 17:18 PST by Saam Barati
Modified: 2016-12-14 19:33 PST (History)
12 users (show)

See Also:


Attachments
patch (19.27 KB, patch)
2016-12-14 17:56 PST, Saam Barati
keith_miller: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-12-14 17:18:03 PST
...
Comment 1 Saam Barati 2016-12-14 17:56:36 PST
Created attachment 297152 [details]
patch
Comment 2 WebKit Commit Bot 2016-12-14 17:59:15 PST
Attachment 297152 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:455:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:461:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/wasm/WasmModuleParser.cpp:516:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/wasm/WasmModuleParser.cpp:523:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:132:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:140:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 6 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 JF Bastien 2016-12-14 18:00:38 PST
Comment on attachment 297152 [details]
patch

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

Looks good otherwise.

> JSTests/wasm/Builder.js:196
> +        assert.isNumber(index, `Memory exports only support number indices right now`);

FIXME + bug?

> JSTests/wasm/js-api/table.js:93
> +    assertBadBinary(builder, badExportString);

I'd really rather use assert.throws, I have to update the other tests to it right now.

> JSTests/wasm/js-api/test_memory.js:156
> +    return;

?
Comment 4 Saam Barati 2016-12-14 19:10:25 PST
Comment on attachment 297152 [details]
patch

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

>> JSTests/wasm/js-api/test_memory.js:156
>> +    return;
> 
> ?

This should be removed.
Comment 5 Keith Miller 2016-12-14 19:14:54 PST
Comment on attachment 297152 [details]
patch

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

r=me.

> JSTests/wasm/js-api/table.js:279
> +    assert.truthy(table === instance.exports.table);
> +    assert.truthy(table === instance.exports.table2);

can't you do assert.eq?

>> JSTests/wasm/js-api/test_memory.js:156
>> +    return;
> 
> ?

Test passes!

> Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:462
> +        Value* partialResult = m_currentBlock->appendNew<Value>(m_proc, BitAnd, Origin(), 
> +                value,
> +                m_currentBlock->appendNew<Const32Value>(m_proc, Origin(), 0x0000ffff));

Nit, I would do this as:

Value* partialResult = m_currentBlock->appendNew<Value>(m_proc, BitAnd, Origin(), value,
    m_currentBlock->appendNew<Const32Value>(m_proc, Origin(), 0x0000ffff));
Comment 6 Saam Barati 2016-12-14 19:31:42 PST
landed in:
https://trac.webkit.org/changeset/209850
Comment 7 Saam Barati 2016-12-14 19:33:01 PST
*** Bug 165684 has been marked as a duplicate of this bug. ***
Comment 8 Saam Barati 2016-12-14 19:33:15 PST
*** Bug 165671 has been marked as a duplicate of this bug. ***
Comment 9 Saam Barati 2016-12-14 19:33:35 PST
*** Bug 165782 has been marked as a duplicate of this bug. ***