Bug 165888

Summary: WebAssembly: implement init_expr for Element
Product: WebKit Reporter: Saam Barati <sbarati>
Component: JavaScriptCoreAssignee: Saam Barati <sbarati>
Severity: Normal CC: benjamin, clopez, fpizlo, ggaren, gskachkov, jfbastien, keith_miller, mark.lam, msaboff, oliver, ryanhaddad, ticaiolima, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
patch keith_miller: review+

Description Saam Barati 2016-12-14 19:35:53 PST
Comment 1 Radar WebKit Bug Importer 2016-12-20 14:23:34 PST
Comment 2 Saam Barati 2017-03-03 18:46:46 PST
Created attachment 303375 [details]

Needs a test. Also contains part of another patch inside of it.
Comment 3 Saam Barati 2017-03-05 10:55:56 PST
*** Bug 169183 has been marked as a duplicate of this bug. ***
Comment 4 Saam Barati 2017-03-05 11:36:31 PST
Created attachment 303460 [details]
Comment 5 Keith Miller 2017-03-05 19:22:31 PST
Comment on attachment 303460 [details]

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

r=me with a comment.

> Source/JavaScriptCore/wasm/WasmModuleParser.cpp:442
> +        WASM_PARSER_FAIL_IF(initExprType != I32, elementNum, "th Element init_expr must produce an i32");

typo: the*

I think I would say "Element init_expr must return an i32" though.
Comment 6 Saam Barati 2017-03-06 13:44:44 PST
landed in:
Comment 7 Carlos Alberto Lopez Perez 2017-03-06 16:20:35 PST
(In reply to comment #6)
> landed in:
> https://trac.webkit.org/changeset/213465

This has caused the test wasm.yaml/wasm/js-api/element.js to fail:


Running wasm.yaml/wasm/js-api/globals-export.js.default-wasm
wasm.yaml/wasm/js-api/element.js.default-wasm: Exception: Error: Expected to throw a CompileError with message "WebAssembly.Module doesn't parse at byte 58 / 72: 0th Element init_expr must produce an i32", got Error with message "WebAssembly.Module doesn't parse at byte 58 / 72: Element init_expr must produce an i32 (evaluating 'new WebAssembly.Module(bin)')"
wasm.yaml/wasm/js-api/element.js.default-wasm: _fail@/Volumes/Data/slave/elcapitan-release-tests-jsc/build/WebKitBuild/Release/jsc-stress-results/.tests/wasm.yaml/wasm/assert.js:27:20
wasm.yaml/wasm/js-api/element.js.default-wasm: _throws@/Volumes/Data/slave/elcapitan-release-tests-jsc/build/WebKitBuild/Release/jsc-stress-results/.tests/wasm.yaml/wasm/assert.js:128:14
wasm.yaml/wasm/js-api/element.js.default-wasm: module code@/Volumes/Data/slave/elcapitan-release-tests-jsc/build/WebKitBuild/Release/jsc-stress-results/.tests/wasm.yaml/wasm/js-api/element.js:218:18
wasm.yaml/wasm/js-api/element.js.default-wasm: evaluate@[native code]
wasm.yaml/wasm/js-api/element.js.default-wasm: moduleEvaluation@[native code]
wasm.yaml/wasm/js-api/element.js.default-wasm: [native code]
wasm.yaml/wasm/js-api/element.js.default-wasm: promiseReactionJob@[native code]
Running wasm.yaml/wasm/js-api/globals-import.js.default-wasm
wasm.yaml/wasm/js-api/element.js.default-wasm: ERROR: Unexpected exit code: 3
Comment 8 Saam Barati 2017-03-06 17:36:13 PST
Will fix now.
Comment 9 Saam Barati 2017-03-06 18:10:54 PST
Landed fix in: