Summary: | WebAssembly: Wasm functions should have either JSFunctionType or TypeOfShouldCallGetCallData | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | buildbot, jfbastien, keith_miller, mark.lam, msaboff, sbarati, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Yusuke Suzuki
2017-10-12 06:22:25 PDT
Created attachment 323524 [details]
Patch
Comment on attachment 323524 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323524&action=review Nice! > JSTests/wasm/js-api/web-assembly-function.js:22 > + assert.truthy(typeof instance.exports.foo === "function", "is_function bytecode should handle wasm function."); We have assert.isFunction > JSTests/wasm/js-api/web-assembly-function.js:24 > + assert.eq(value, "function", "the result of typeof should be 'function'"); Why twice? Comment on attachment 323524 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323524&action=review Thank you! >> JSTests/wasm/js-api/web-assembly-function.js:22 >> + assert.truthy(typeof instance.exports.foo === "function", "is_function bytecode should handle wasm function."); > > We have assert.isFunction I would like to keep this as is. This is because I would like to keep this `typeof xxx === 'function'` form. Currently, our bytecode compiler performs pattern matching onto the AST nodes and emit `is_function` specially if it finds `typeof xxx === "function"`. >> JSTests/wasm/js-api/web-assembly-function.js:24 >> + assert.eq(value, "function", "the result of typeof should be 'function'"); > > Why twice? This is because we would like to test `is_function` opcode and `typeof` opcode in bytecode compiler. Our JSC bytecode compiler emits `is_function` if `typeof XXX === "function"` case. The first `truthy` one tests this. And second this one tests `typeof` bytecode operation. Committed r223274: <https://trac.webkit.org/changeset/223274> |