Changeset 212983 in webkit
- Timestamp:
- Feb 24, 2017 6:02:06 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r212939 r212983 1 2017-02-24 JF Bastien <jfbastien@apple.com> 2 3 WebAssembly: miscellaneous spec fixes 4 https://bugs.webkit.org/show_bug.cgi?id=168822 5 6 Reviewed by Saam Barati. 7 8 * wasm.yaml: mark some skip tests as normal, now that they pass 9 * wasm/Builder.js: error message was wrong, causing extra error if hit 10 * wasm/js-api/global-error.js: new tests 11 (assert.throws): 12 * wasm/spec-tests/call.wast.js: comment out stack check tests 13 * wasm/spec-tests/call_indirect.wast.js: comment out stack check tests 14 * wasm/spec-tests/fac.wast.js: comment out stack check tests 15 * wasm/spec-tests/float_exprs.wast.js: wabt is wrong, bug reported, we should update 16 * wasm/spec-tests/imports.wast.js: bug in old wabt, fixed in recent wabt 17 (assert_unlinkable): 18 1 19 2017-02-23 Saam Barati <sbarati@apple.com> 2 20 -
trunk/JSTests/wasm.yaml
r210244 r212983 53 53 54 54 - path: wasm/spec-tests/call.wast.js 55 cmd: runWebAssemblySpecTest : skip55 cmd: runWebAssemblySpecTest :normal 56 56 57 57 - path: wasm/spec-tests/call_indirect.wast.js 58 cmd: runWebAssemblySpecTest : skip58 cmd: runWebAssemblySpecTest :normal 59 59 60 60 - path: wasm/spec-tests/comments.wast.js … … 65 65 66 66 - path: wasm/spec-tests/custom_section.wast.js 67 cmd: runWebAssemblySpecTest : skip67 cmd: runWebAssemblySpecTest :normal 68 68 69 69 - path: wasm/spec-tests/endianness.wast.js … … 86 86 87 87 - path: wasm/spec-tests/fac.wast.js 88 cmd: runWebAssemblySpecTest : skip88 cmd: runWebAssemblySpecTest :normal 89 89 90 90 - path: wasm/spec-tests/float_exprs.wast.js 91 cmd: runWebAssemblySpecTest : skip91 cmd: runWebAssemblySpecTest :normal 92 92 93 93 - path: wasm/spec-tests/float_literals.wast.js … … 122 122 123 123 - path: wasm/spec-tests/imports.wast.js 124 cmd: runWebAssemblySpecTest : skip124 cmd: runWebAssemblySpecTest :normal 125 125 126 126 - path: wasm/spec-tests/int_exprs.wast.js -
trunk/JSTests/wasm/Builder.js
r210282 r212983 193 193 return 0; 194 194 else 195 throw new Error(`mutability should be either "mutable" or "immutable", but got ${ global.mutablity}`);195 throw new Error(`mutability should be either "mutable" or "immutable", but got ${mutability}`); 196 196 }; 197 197 -
trunk/JSTests/wasm/js-api/global-error.js
r210090 r212983 188 188 assert.throws(() => new WebAssembly.Instance(module, { imp: { global: imp } }), WebAssembly.LinkError, "imported global must be a number (evaluating 'new WebAssembly.Instance(module, { imp: { global: imp } })')"); 189 189 } 190 191 { 192 const builder = new Builder() 193 .Type().End() 194 .Global().I64(0, "immutable").End() 195 .Export() 196 .Global("bigInt", 0) 197 .End(); 198 const module = new WebAssembly.Module(builder.WebAssembly().get()); 199 assert.throws(() => new WebAssembly.Instance(module), WebAssembly.LinkError, "exported global cannot be an i64 (evaluating 'new WebAssembly.Instance(module)')"); 200 } 201 202 { 203 const builder = new Builder() 204 .Type().End() 205 .Import() 206 .Global().I64("imp", "global", "immutable").End() 207 .End() 208 .Function().End() 209 .Global().GetGlobal("i64", 0, "immutable").End(); 210 const module = new WebAssembly.Module(builder.WebAssembly().get()); 211 assert.throws(() => new WebAssembly.Instance(module, { imp: { global: undefined } }), WebAssembly.LinkError, "imported global cannot be an i64 (evaluating 'new WebAssembly.Instance(module, { imp: { global: undefined } })')"); 212 } -
trunk/JSTests/wasm/spec-tests/call.wast.js
r212922 r212983 127 127 assert_return(() => $$.exports["assert_22"]()); 128 128 assert_return(() => $$.exports["assert_23"]()); 129 assert_trap(() => $$.exports["runaway"]()); 130 assert_trap(() => $$.exports["mutual-runaway"]()); 129 // FIXME do stack checks https://bugs.webkit.org/show_bug.cgi?id=165546 130 //assert_trap(() => $$.exports["runaway"]()); 131 //assert_trap(() => $$.exports["mutual-runaway"]()); 131 132 assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x03\x03\x02\x00\x00\x0a\x0a\x02\x05\x00\x10\x01\x45\x0b\x02\x00\x0b"); 132 133 assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x08\x02\x60\x00\x00\x60\x00\x01\x7e\x03\x03\x02\x00\x01\x0a\x0c\x02\x05\x00\x10\x01\x45\x0b\x04\x00\x42\x01\x0b"); -
trunk/JSTests/wasm/spec-tests/call_indirect.wast.js
r212922 r212983 140 140 assert_return(() => $$.exports["odd"](200), 99); 141 141 assert_return(() => $$.exports["odd"](77), 44); 142 assert_trap(() => $$.exports["runaway"]()); 143 assert_trap(() => $$.exports["mutual-runaway"]()); 142 // FIXME do stack checks https://bugs.webkit.org/show_bug.cgi?id=165546 143 //assert_trap(() => $$.exports["runaway"]()); 144 //assert_trap(() => $$.exports["mutual-runaway"]()); 144 145 assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x03\x02\x01\x00\x0a\x09\x01\x07\x00\x41\x00\x11\x00\x00\x0b"); 145 146 assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x03\x02\x01\x00\x04\x04\x01\x70\x00\x00\x0a\x0a\x01\x08\x00\x41\x00\x11\x00\x00\x45\x0b"); -
trunk/JSTests/wasm/spec-tests/fac.wast.js
r212922 r212983 99 99 assert_return(() => $$.exports["assert_3"]()); 100 100 assert_return(() => $$.exports["assert_4"]()); 101 assert_trap(() => $$.exports["assert_5"]()); 101 // FIXME do stack checks https://bugs.webkit.org/show_bug.cgi?id=165546 102 //assert_trap(() => $$.exports["assert_5"]()); -
trunk/JSTests/wasm/spec-tests/float_exprs.wast.js
r212922 r212983 133 133 assert_return(() => $$.exports["assert_1"]()); 134 134 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x0e\x03\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x60\x00\x00\x03\x05\x04\x00\x01\x02\x02\x07\x43\x04\x13\x66\x33\x32\x2e\x6e\x6f\x5f\x66\x6f\x6c\x64\x5f\x6d\x75\x6c\x5f\x6f\x6e\x65\x00\x00\x13\x66\x36\x34\x2e\x6e\x6f\x5f\x66\x6f\x6c\x64\x5f\x6d\x75\x6c\x5f\x6f\x6e\x65\x00\x01\x08\x61\x73\x73\x65\x72\x74\x5f\x30\x00\x02\x08\x61\x73\x73\x65\x72\x74\x5f\x31\x00\x03\x0a\x57\x04\x0a\x00\x20\x00\x43\x00\x00\x80\x3f\x94\x0b\x0e\x00\x20\x00\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\xa2\x0b\x19\x00\x02\x40\x43\x00\x00\xa0\x7f\x10\x00\xbc\x43\x00\x00\xe0\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b\x21\x00\x02\x40\x44\x00\x00\x00\x00\x00\x00\xf4\x7f\x10\x01\xbd\x44\x00\x00\x00\x00\x00\x00\xfc\x7f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b"); 135 assert_return(() => $$.exports["assert_0"]()); 136 assert_return(() => $$.exports["assert_1"]()); 135 // FIXME The following spec tests seem to mistranslate with wabt: 136 // (assert_return (invoke "f32.no_fold_mul_one" (f32.const nan:0x200000)) (f32.const nan:0x600000)) 137 // (assert_return (invoke "f64.no_fold_mul_one" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) 138 //assert_return(() => $$.exports["assert_0"]()); 139 //assert_return(() => $$.exports["assert_1"]()); 137 140 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x0e\x03\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x60\x00\x00\x03\x07\x06\x00\x01\x02\x02\x02\x02\x07\x5b\x06\x14\x66\x33\x32\x2e\x6e\x6f\x5f\x66\x6f\x6c\x64\x5f\x7a\x65\x72\x6f\x5f\x64\x69\x76\x00\x00\x14\x66\x36\x34\x2e\x6e\x6f\x5f\x66\x6f\x6c\x64\x5f\x7a\x65\x72\x6f\x5f\x64\x69\x76\x00\x01\x08\x61\x73\x73\x65\x72\x74\x5f\x30\x00\x02\x08\x61\x73\x73\x65\x72\x74\x5f\x31\x00\x03\x08\x61\x73\x73\x65\x72\x74\x5f\x32\x00\x04\x08\x61\x73\x73\x65\x72\x74\x5f\x33\x00\x05\x0a\x93\x01\x06\x0a\x00\x43\x00\x00\x00\x00\x20\x00\x95\x0b\x0e\x00\x44\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\xa3\x0b\x19\x00\x02\x40\x43\x00\x00\xc0\x7f\x10\x00\xbc\x43\x00\x00\xc0\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b\x19\x00\x02\x40\x43\x00\x00\xa0\x7f\x10\x00\xbc\x43\x00\x00\xe0\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b\x21\x00\x02\x40\x44\x00\x00\x00\x00\x00\x00\xf8\x7f\x10\x01\xbd\x44\x00\x00\x00\x00\x00\x00\xf8\x7f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b\x21\x00\x02\x40\x44\x00\x00\x00\x00\x00\x00\xf4\x7f\x10\x01\xbd\x44\x00\x00\x00\x00\x00\x00\xfc\x7f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b"); 138 141 assert_return_nan(() => $$.exports["f32.no_fold_zero_div"](f32(0.0))); … … 376 379 assert_return(() => $$.exports["no_fold_demote_promote"](2.335945149795088e+31), 2.3359452224542198e+31); 377 380 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x09\x02\x60\x01\x7d\x01\x7d\x60\x00\x00\x03\x03\x02\x00\x01\x07\x25\x02\x16\x6e\x6f\x5f\x66\x6f\x6c\x64\x5f\x70\x72\x6f\x6d\x6f\x74\x65\x5f\x64\x65\x6d\x6f\x74\x65\x00\x00\x08\x61\x73\x73\x65\x72\x74\x5f\x30\x00\x01\x0a\x22\x02\x06\x00\x20\x00\xbb\xb6\x0b\x19\x00\x02\x40\x43\x00\x00\xa0\x7f\x10\x00\xbc\x43\x00\x00\xe0\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b"); 378 assert_return(() => $$.exports["assert_0"]()); 381 // FIXME The following spec tests seem to mistranslate with wabt: 382 // (assert_return (invoke "no_fold_promote_demote" (f32.const nan:0x200000)) (f32.const nan:0x600000)) 383 //assert_return(() => $$.exports["assert_0"]()); 379 384 assert_return(() => $$.exports["no_fold_promote_demote"](f32(0.0)), f32(0.0)); 380 385 assert_return(() => $$.exports["no_fold_promote_demote"](f32(-0.0)), f32(-0.0)); -
trunk/JSTests/wasm/spec-tests/imports.wast.js
r212922 r212983 57 57 let mod = module(bytes); 58 58 try { new WebAssembly.Instance(mod, registry) } catch (e) { 59 if (e instanceof TypeError) return;59 if (e instanceof WebAssembly.LinkError) return; // Note: this is fixed in tip-of-tree wabt. 60 60 } 61 61 throw new Error("Wasm linking failure expected"); … … 95 95 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x1e\x07\x60\x00\x00\x60\x01\x7f\x00\x60\x01\x7d\x00\x60\x00\x01\x7f\x60\x00\x01\x7d\x60\x01\x7f\x01\x7f\x60\x01\x7e\x01\x7e\x03\x08\x07\x00\x01\x02\x03\x04\x05\x06\x04\x04\x01\x70\x00\x0a\x05\x03\x01\x00\x02\x06\x0e\x02\x7f\x00\x41\x37\x0b\x7d\x00\x43\x00\x00\x30\x42\x0b\x07\x8e\x01\x0b\x04\x66\x75\x6e\x63\x00\x00\x08\x66\x75\x6e\x63\x2d\x69\x33\x32\x00\x01\x08\x66\x75\x6e\x63\x2d\x66\x33\x32\x00\x02\x09\x66\x75\x6e\x63\x2d\x3e\x69\x33\x32\x00\x03\x09\x66\x75\x6e\x63\x2d\x3e\x66\x33\x32\x00\x04\x0d\x66\x75\x6e\x63\x2d\x69\x33\x32\x2d\x3e\x69\x33\x32\x00\x05\x0d\x66\x75\x6e\x63\x2d\x69\x36\x34\x2d\x3e\x69\x36\x34\x00\x06\x0a\x67\x6c\x6f\x62\x61\x6c\x2d\x69\x33\x32\x03\x00\x0a\x67\x6c\x6f\x62\x61\x6c\x2d\x66\x33\x32\x03\x01\x0c\x74\x61\x62\x6c\x65\x2d\x31\x30\x2d\x69\x6e\x66\x01\x00\x0c\x6d\x65\x6d\x6f\x72\x79\x2d\x32\x2d\x69\x6e\x66\x02\x00\x0a\x21\x07\x02\x00\x0b\x02\x00\x0b\x02\x00\x0b\x04\x00\x41\x16\x0b\x07\x00\x43\x00\x00\x30\x41\x0b\x04\x00\x20\x00\x0b\x04\x00\x20\x00\x0b"); 96 96 register("test", $$) 97 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x23\x08\x60\x01\x7f\x00\x60\x01\x7e\x00\x60\x01\x7d\x00\x60\x01\x7c\x00\x60\x02\x7f\x7d\x00\x60\x02\x7c\x7c\x00\x60\x01\x7e\x01\x7e\x60\x00\x00\x02\xc0\x01\x0b\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x02\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x03\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x04\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x05\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x03\x04\x74\x65\x73\x74\x0d\x66\x75\x6e\x63\x2d\x69\x36\x34\x2d\x3e\x69\x36\x34\x00\x06\x03\x04\x03\x00\x01\x07\x04\x05\x01\x70\x01\x02\x02\x07\x20\x03\x07\x70\x72\x69\x6e\x74\x33\x32\x00\x0b\x07\x70\x72\x69\x6e\x74\x36\x34\x00\x0c\x08\x61\x73\x73\x65\x72\x74\x5f\x30\x00\x0d\x09\x08\x01\x00\x41\x00\x0b\x02\x02\x05\x0a\x70\x03\x2c\x01\x01\x7d\x20\x00\xb2\x21\x01\x20\x00\x10\x00\x20\x00\x41\x01\x6a\x43\x00\x00\x28\x42\x10\x06\x20\x00\x10\x02\x20\x00\x10\x08\x20\x01\x10\x04\x20\x00\x41\x00\x11\x00\x00\x0b\x35\x01\x01\x7c\x20\x00\x10\x0a\xb9\x21\x01\x20\x00\x10\x01\x20\x01\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\xa0\x44\x00\x00\x00\x00\x00\x80\x4a\x40\x10\x07\x20\x01\x10\x05\x20\x01\x10\x09\x20\x01\x41\x01\x11\x03\x00\x0b\x0b\x00\x02\x40\x42\x18\x10\x0c\x0f\x0b\x00\x0b"); 98 assert_return(() => $$.exports["print32"](13)); 99 assert_return(() => $$.exports["assert_0"]()); 97 // FIXME re-exporting an import isn't implemented. https://bugs.webkit.org/show_bug.cgi?id=165510 98 //$$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x23\x08\x60\x01\x7f\x00\x60\x01\x7e\x00\x60\x01\x7d\x00\x60\x01\x7c\x00\x60\x02\x7f\x7d\x00\x60\x02\x7c\x7c\x00\x60\x01\x7e\x01\x7e\x60\x00\x00\x02\xc0\x01\x0b\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x02\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x03\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x04\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x05\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x03\x04\x74\x65\x73\x74\x0d\x66\x75\x6e\x63\x2d\x69\x36\x34\x2d\x3e\x69\x36\x34\x00\x06\x03\x04\x03\x00\x01\x07\x04\x05\x01\x70\x01\x02\x02\x07\x20\x03\x07\x70\x72\x69\x6e\x74\x33\x32\x00\x0b\x07\x70\x72\x69\x6e\x74\x36\x34\x00\x0c\x08\x61\x73\x73\x65\x72\x74\x5f\x30\x00\x0d\x09\x08\x01\x00\x41\x00\x0b\x02\x02\x05\x0a\x70\x03\x2c\x01\x01\x7d\x20\x00\xb2\x21\x01\x20\x00\x10\x00\x20\x00\x41\x01\x6a\x43\x00\x00\x28\x42\x10\x06\x20\x00\x10\x02\x20\x00\x10\x08\x20\x01\x10\x04\x20\x00\x41\x00\x11\x00\x00\x0b\x35\x01\x01\x7c\x20\x00\x10\x0a\xb9\x21\x01\x20\x00\x10\x01\x20\x01\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\xa0\x44\x00\x00\x00\x00\x00\x80\x4a\x40\x10\x07\x20\x01\x10\x05\x20\x01\x10\x09\x20\x01\x41\x01\x11\x03\x00\x0b\x0b\x00\x02\x40\x42\x18\x10\x0c\x0f\x0b\x00\x0b"); 99 //assert_return(() => $$.exports["print32"](13)); 100 //assert_return(() => $$.exports["assert_0"]()); 100 101 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x02\x0d\x01\x04\x74\x65\x73\x74\x04\x66\x75\x6e\x63\x00\x00"); 101 102 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x05\x01\x60\x01\x7f\x00\x02\x11\x01\x04\x74\x65\x73\x74\x08\x66\x75\x6e\x63\x2d\x69\x33\x32\x00\x00"); … … 129 130 assert_unlinkable("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x02\x12\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x74\x61\x62\x6c\x65\x00\x00"); 130 131 assert_unlinkable("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x02\x13\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x6d\x65\x6d\x6f\x72\x79\x00\x00"); 131 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x05\x01\x60\x00\x01\x7f\x02\x86\x01\x07\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7e\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7d\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7c\x00\x03\x05\x04\x00\x00\x00\x00\x07\x21\x04\x05\x67\x65\x74\x2d\x30\x00\x00\x05\x67\x65\x74\x2d\x31\x00\x01\x05\x67\x65\x74\x2d\x78\x00\x02\x05\x67\x65\x74\x2d\x79\x00\x03\x0a\x15\x04\x04\x00\x23\x00\x0b\x04\x00\x23\x01\x0b\x04\x00\x23\x02\x0b\x04\x00\x23\x03\x0b"); 132 assert_return(() => $$.exports["get-0"](), 666); 133 assert_return(() => $$.exports["get-1"](), 666); 134 assert_return(() => $$.exports["get-x"](), 666); 135 assert_return(() => $$.exports["get-y"](), 666); 132 // FIXME i64 global was fixed in ToT spec repo. Update spec tests for newer version. https://bugs.webkit.org/show_bug.cgi?id=168784 133 //$$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x05\x01\x60\x00\x01\x7f\x02\x86\x01\x07\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7f\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7e\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7d\x00\x08\x73\x70\x65\x63\x74\x65\x73\x74\x06\x67\x6c\x6f\x62\x61\x6c\x03\x7c\x00\x03\x05\x04\x00\x00\x00\x00\x07\x21\x04\x05\x67\x65\x74\x2d\x30\x00\x00\x05\x67\x65\x74\x2d\x31\x00\x01\x05\x67\x65\x74\x2d\x78\x00\x02\x05\x67\x65\x74\x2d\x79\x00\x03\x0a\x15\x04\x04\x00\x23\x00\x0b\x04\x00\x23\x01\x0b\x04\x00\x23\x02\x0b\x04\x00\x23\x03\x0b"); 134 //assert_return(() => $$.exports["get-0"](), 666); 135 //assert_return(() => $$.exports["get-1"](), 666); 136 //assert_return(() => $$.exports["get-x"](), 666); 137 //assert_return(() => $$.exports["get-y"](), 666); 136 138 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x02\x14\x01\x04\x74\x65\x73\x74\x0a\x67\x6c\x6f\x62\x61\x6c\x2d\x69\x33\x32\x03\x7f\x00"); 137 139 $$ = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x02\x14\x01\x04\x74\x65\x73\x74\x0a\x67\x6c\x6f\x62\x61\x6c\x2d\x66\x33\x32\x03\x7d\x00"); -
trunk/Source/JavaScriptCore/ChangeLog
r212970 r212983 1 2017-02-24 JF Bastien <jfbastien@apple.com> 2 3 WebAssembly: miscellaneous spec fixes 4 https://bugs.webkit.org/show_bug.cgi?id=168822 5 6 Reviewed by Saam Barati. 7 8 * wasm/WasmModuleParser.cpp: "unknown" sections are now called "custom" sections 9 * wasm/WasmSections.h: 10 (JSC::Wasm::validateOrder): 11 (JSC::Wasm::makeString): fix ASSERT_UNREACHABLE bug in printing 12 * wasm/js/WebAssemblyInstanceConstructor.cpp: 13 (JSC::constructJSWebAssemblyInstance): disallow i64 import 14 * wasm/js/WebAssemblyModuleRecord.cpp: 15 (JSC::WebAssemblyModuleRecord::link): disallow i64 export 16 (JSC::WebAssemblyModuleRecord::evaluate): 17 1 18 2017-02-24 Filip Pizlo <fpizlo@apple.com> 2 19 -
trunk/Source/JavaScriptCore/wasm/WasmModuleParser.cpp
r212922 r212983 60 60 WASM_PARSER_FAIL_IF(versionNumber != expectedVersionNumber, "unexpected version number ", versionNumber, " expected ", expectedVersionNumber); 61 61 62 Section previousSection = Section:: Unknown;62 Section previousSection = Section::Custom; 63 63 while (m_offset < length()) { 64 64 uint8_t sectionByte; … … 66 66 WASM_PARSER_FAIL_IF(!parseUInt7(sectionByte), "can't get section byte"); 67 67 68 Section section = Section:: Unknown;68 Section section = Section::Custom; 69 69 if (sectionByte) { 70 70 if (isValidSection(sectionByte)) … … 88 88 #undef WASM_SECTION_PARSE 89 89 90 case Section:: Unknown: {90 case Section::Custom: { 91 91 WASM_FAIL_IF_HELPER_FAILS(parseCustom(sectionLength)); 92 92 break; -
trunk/Source/JavaScriptCore/wasm/WasmSections.h
r209880 r212983 47 47 FOR_EACH_WASM_SECTION(DEFINE_WASM_SECTION_ENUM) 48 48 #undef DEFINE_WASM_SECTION_ENUM 49 Unknown49 Custom 50 50 }; 51 51 … … 64 64 static inline bool validateOrder(Section previous, Section next) 65 65 { 66 if (previous == Section:: Unknown)66 if (previous == Section::Custom) 67 67 return true; 68 68 return static_cast<uint8_t>(previous) < static_cast<uint8_t>(next); … … 72 72 { 73 73 switch (section) { 74 case Section::Custom: 75 return "Custom"; 74 76 #define STRINGIFY_SECTION_NAME(NAME, ID, DESCRIPTION) case Section::NAME: return #NAME; 75 77 FOR_EACH_WASM_SECTION(STRINGIFY_SECTION_NAME) 76 78 #undef STRINGIFY_SECTION_NAME 77 default:78 RELEASE_ASSERT_NOT_REACHED();79 return "?";80 79 } 81 80 } -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp
r211247 r212983 204 204 // i. If i is not an immutable global, throw a TypeError. 205 205 ASSERT(moduleInformation.globals[import.kindIndex].mutability == Wasm::Global::Immutable); 206 // ii. If Type(v) is not Number, throw a TypeError. 206 // ii. If the global_type of i is i64 or Type(v) is not Number, throw a WebAssembly.LinkError. 207 if (moduleInformation.globals[import.kindIndex].type == Wasm::I64) 208 return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, vm, ASCIILiteral("imported global cannot be an i64")))); 207 209 if (!value.isNumber()) 208 210 return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, vm, ASCIILiteral("imported global must be a number")))); -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
r211247 r212983 149 149 break; 150 150 151 case Wasm::I64: 152 throwException(state, scope, createJSWebAssemblyLinkError(state, vm, ASCIILiteral("exported global cannot be an i64"))); 153 return; 154 151 155 case Wasm::F32: 152 156 exportedValue = JSValue(instance->loadF32Global(exp.kindIndex)); … … 239 243 Wasm::SignatureIndex signatureIndex = module->signatureIndexFromFunctionIndexSpace(functionIndex); 240 244 const Wasm::Signature* signature = Wasm::SignatureInformation::get(&vm, signatureIndex); 241 // FIXME: Say we export local function "foo" at func iton index 0.245 // FIXME: Say we export local function "foo" at function index 0. 242 246 // What if we also set it to the table an Element w/ index 0. 243 247 // Does (new Instance(...)).exports.foo === table.get(0)?
Note: See TracChangeset
for help on using the changeset viewer.