Changeset 271168 in webkit
- Timestamp:
- Jan 5, 2021 12:13:38 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 41 edited
- 1 moved
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/wasm/function-tests/function-import-return-value.js (modified) (4 diffs)
-
JSTests/wasm/function-tests/i64-conversion.js (moved) (moved from trunk/JSTests/wasm/function-tests/i64-from-js-exceptions.js) (1 diff)
-
JSTests/wasm/js-api/global-error.js (modified) (2 diffs)
-
JSTests/wasm/stress/i64-call.js (added)
-
JSTests/wasm/stress/i64-extract.js (added)
-
JSTests/wasm/stress/immutable-globals.js (modified) (1 diff)
-
JSTests/wasm/stress/multi-value-i64.js (added)
-
JSTests/wasm/stress/mutable-globals.js (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.worker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.worker-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any.worker-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming.any-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming.any.worker-expected.txt (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/jsc.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/BigIntConstructor.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/runtime/BigIntConstructor.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSBigInt.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSBigInt.h (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/JSCJSValue.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSCJSValue.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/WasmExceptionType.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/WasmGlobal.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/wasm/WasmGlobal.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/WasmOperations.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/wasm/WasmOperations.h (modified) (1 diff)
-
Source/JavaScriptCore/wasm/js/JSToWasm.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/wasm/js/WasmToJS.cpp (modified) (8 diffs)
-
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/wasm/js/WebAssemblyGlobalConstructor.cpp (modified) (1 diff)
-
Source/JavaScriptCore/wasm/js/WebAssemblyGlobalPrototype.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r271164 r271168 1 2021-01-05 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [WASM] [BigInt] Add I64 to BigInt conversion 4 https://bugs.webkit.org/show_bug.cgi?id=213528 5 6 Reviewed by Michael Saboff. 7 8 * wasm/function-tests/function-import-return-value.js: 9 (assert.truthy): 10 (assert.throws): 11 (assert.eq): 12 * wasm/function-tests/i64-conversion.js: Renamed from JSTests/wasm/function-tests/i64-from-js-exceptions.js. 13 (assert.eq.instance.exports.foo.valueOf): 14 * wasm/js-api/global-error.js: 15 * wasm/stress/i64-call.js: Added. 16 (async test): 17 * wasm/stress/i64-extract.js: Added. 18 (testI64): 19 * wasm/stress/immutable-globals.js: 20 (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.i.assert.eq): 21 * wasm/stress/multi-value-i64.js: Added. 22 (async test): 23 * wasm/stress/mutable-globals.js: 24 1 25 2021-01-05 Alexey Shvayka <shvaikalesh@gmail.com> 2 26 -
trunk/JSTests/wasm/function-tests/function-import-return-value.js
r211195 r271168 152 152 const instance = new WebAssembly.Instance(module, {imp: {func}}); 153 153 for (let i = 0; i < 100; i++) { 154 assert.throws(() => instance.exports.foo(), TypeError, "i64 not allowed as return type or argument to an imported function"); 154 assert.throws(() => instance.exports.foo(), TypeError, "Invalid argument type in ToBigInt operation"); 155 } 156 } 157 158 { 159 const builder = new Builder() 160 .Type().End() 161 .Import() 162 .Function("imp", "func", { params: [], ret: "i64"}) 163 .End() 164 .Function().End() 165 .Export() 166 .Function("foo") 167 .End() 168 .Code() 169 .Function("foo", {params: [], ret: "void"}) 170 .Call(0) 171 .Drop() 172 .Return() 173 .End() 174 .End(); 175 176 177 const bin = builder.WebAssembly().get(); 178 const module = new WebAssembly.Module(bin); 179 const func = () => 20n; 180 const instance = new WebAssembly.Instance(module, {imp: {func}}); 181 for (let i = 0; i < 100; i++) { 182 assert.eq(instance.exports.foo(), undefined); 183 } 184 } 185 186 { 187 const builder = new Builder() 188 .Type().End() 189 .Import() 190 .Function("imp", "func", { params: [], ret: "i64"}) 191 .End() 192 .Function().End() 193 .Export() 194 .Function("foo") 195 .End() 196 .Code() 197 .Function("foo", {params: [], ret: "i64"}) 198 .Call(0) 199 .Return() 200 .End() 201 .End(); 202 203 204 const bin = builder.WebAssembly().get(); 205 const module = new WebAssembly.Module(bin); 206 const func = () => 20n; 207 const instance = new WebAssembly.Instance(module, {imp: {func}}); 208 for (let i = 0; i < 100; i++) { 209 assert.eq(instance.exports.foo(), 20n); 155 210 } 156 211 } … … 177 232 const bin = builder.WebAssembly().get(); 178 233 const module = new WebAssembly.Module(bin); 179 const func = () => 20; 180 const instance = new WebAssembly.Instance(module, {imp: {func}}); 181 for (let i = 0; i < 100; i++) { 182 assert.throws(() => instance.exports.foo(), TypeError, "i64 not allowed as return type or argument to an imported function"); 183 } 184 } 185 186 { 187 const builder = new Builder() 188 .Type().End() 189 .Import() 190 .Function("imp", "func", { params: ["i64"], ret: "void"}) 191 .End() 192 .Function().End() 193 .Export() 194 .Function("foo") 195 .End() 196 .Code() 197 .Function("foo", {params: [], ret: "void"}) 234 let called = false; 235 const func = (value) => { 236 called = true; 237 assert.eq(value, 20n); 238 }; 239 const instance = new WebAssembly.Instance(module, {imp: {func}}); 240 for (let i = 0; i < 100; i++) { 241 called = false; 242 assert.eq(instance.exports.foo(), undefined); 243 assert.truthy(called); 244 } 245 } 246 247 { 248 const builder = new Builder() 249 .Type().End() 250 .Import() 251 .Function("imp", "func", { params: ["i64"], ret: "i64"}) 252 .End() 253 .Function().End() 254 .Export() 255 .Function("foo") 256 .End() 257 .Code() 258 .Function("foo", {params: [], ret: "i64"}) 198 259 .I64Const(20) 199 260 .Call(0) … … 206 267 const module = new WebAssembly.Module(bin); 207 268 let called = false; 208 const func = ( ) => {269 const func = (value) => { 209 270 called = true; 210 } 211 const instance = new WebAssembly.Instance(module, {imp: {func}}); 212 for (let i = 0; i < 100; i++) { 213 assert.throws(() => instance.exports.foo(), TypeError, "i64 not allowed as return type or argument to an imported function"); 214 assert.eq(called, false); 271 return value + 22n; 272 } 273 const instance = new WebAssembly.Instance(module, {imp: {func}}); 274 for (let i = 0; i < 100; i++) { 275 called = false; 276 assert.eq(instance.exports.foo(), 42n); 277 assert.truthy(called); 215 278 } 216 279 } … … 242 305 const instance = new WebAssembly.Instance(module); 243 306 for (let i = 0; i < 100; i++) { 244 assert.throws(() => instance.exports.foo(value), Error, "WebAssembly function with an i64 argument can't be called from JavaScript"); 245 assert.eq(called, false); 246 } 247 } 307 assert.throws(() => instance.exports.foo(value), Error, "Invalid argument type in ToBigInt operation"); 308 assert.eq(called, true); 309 } 310 } 311 312 { 313 const builder = new Builder() 314 .Type().End() 315 .Function().End() 316 .Export() 317 .Function("foo") 318 .End() 319 .Code() 320 .Function("foo", {params: ["i64"], ret: "i64"}) 321 .GetLocal(0) 322 .Return() 323 .End() 324 .End(); 325 326 327 const bin = builder.WebAssembly().get(); 328 const module = new WebAssembly.Module(bin); 329 let called = false; 330 let value = { 331 valueOf() { 332 called = true; 333 return 42n; 334 } 335 }; 336 const instance = new WebAssembly.Instance(module); 337 for (let i = 0; i < 100; i++) { 338 called = false; 339 assert.eq(instance.exports.foo(value), 42n); 340 assert.eq(called, true); 341 } 342 } -
trunk/JSTests/wasm/function-tests/i64-conversion.js
r271167 r271168 35 35 36 36 const instance = new WebAssembly.Instance(module, imp); 37 assert.throws(() => instance.exports.foo(20), WebAssembly.RuntimeError, "WebAssembly function with an i64 argument can't be called from JavaScript"); 38 assert.throws(() => instance.exports.foo({valueOf() { throw new Error("Should not be called!"); }}), WebAssembly.RuntimeError, "WebAssembly function with an i64 argument can't be called from JavaScript"); 39 assert.throws(() => instance.exports.bar(), WebAssembly.RuntimeError, "WebAssembly function that returns i64 can't be called from JavaScript"); 40 assert.eq(called, false); 37 assert.throws(() => instance.exports.foo(20), TypeError, "Invalid argument type in ToBigInt operation"); 38 assert.eq(instance.exports.foo(20n), undefined); 39 assert.truthy(called); 40 called = false; 41 let convertCalled = false; 42 assert.eq(instance.exports.foo({valueOf() { convertCalled = true; return 20n; }}), undefined); 43 assert.truthy(convertCalled); 44 assert.truthy(called); 45 called = false; 46 assert.eq(instance.exports.bar(), 25n); 47 assert.truthy(called, false); -
trunk/JSTests/wasm/js-api/global-error.js
r271145 r271168 196 196 const module = new WebAssembly.Module(builder.WebAssembly().get()); 197 197 let instance = new WebAssembly.Instance(module); 198 assert. throws(() => instance.exports.bigInt.value, TypeError, "WebAssembly.Global.prototype.value does not work with i64 type");198 assert.eq(instance.exports.bigInt.value, 0n); 199 199 } 200 200 … … 208 208 .Global().GetGlobal("i64", 0, "immutable").End(); 209 209 const module = new WebAssembly.Module(builder.WebAssembly().get()); 210 assert.throws(() => new WebAssembly.Instance(module, { imp: { global: undefined } }), WebAssembly.LinkError, "imported global imp:global cannot be an i64(evaluating 'new WebAssembly.Instance(module, { imp: { global: undefined } })')");211 } 210 assert.throws(() => new WebAssembly.Instance(module, { imp: { global: undefined } }), WebAssembly.LinkError, "imported global imp:global must be a BigInt (evaluating 'new WebAssembly.Instance(module, { imp: { global: undefined } })')"); 211 } -
trunk/JSTests/wasm/stress/immutable-globals.js
r269552 r271168 89 89 { 90 90 let binding = instance.exports.i64; 91 assert. throws(() => binding.value, TypeError, `WebAssembly.Global.prototype.value does not work with i64 type`);92 assert.throws(() => binding.value = 42 , TypeError, `WebAssembly.Global.prototype.value attempts to modify immutable global value`);91 assert.eq(binding.value, 0n); 92 assert.throws(() => binding.value = 42n, TypeError, `WebAssembly.Global.prototype.value attempts to modify immutable global value`); 93 93 assert.eq(instance.exports.getI64AsI32(), 0); 94 94 } -
trunk/JSTests/wasm/stress/mutable-globals.js
r269552 r271168 138 138 { 139 139 let binding = instance.exports.i64; 140 assert.throws(() => binding.value, TypeError, `WebAssembly.Global.prototype.value does not work with i64 type`); 141 assert.throws(() => binding.value = 42, TypeError, `WebAssembly.Global.prototype.value does not work with i64 type`); 142 assert.eq(instance.exports.getI64AsI32(), 0); 140 assert.eq(binding.value, 0n); 141 assert.throws(() => binding.value = 42, TypeError, `Invalid argument type in ToBigInt operation`); 142 binding.value = 42n; 143 assert.eq(instance.exports.getI64AsI32(), 42); 143 144 instance.exports.setI32AsI64(20); 144 145 assert.eq(instance.exports.getI64AsI32(), 20); -
trunk/LayoutTests/imported/w3c/ChangeLog
r271146 r271168 1 2021-01-05 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [WASM] [BigInt] Add I64 to BigInt conversion 4 https://bugs.webkit.org/show_bug.cgi?id=213528 5 6 Reviewed by Michael Saboff. 7 8 * web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any-expected.txt: 9 * web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker-expected.txt: 10 * web-platform-tests/wasm/jsapi/constructor/instantiate.any-expected.txt: 11 * web-platform-tests/wasm/jsapi/constructor/instantiate.any.worker-expected.txt: 12 * web-platform-tests/wasm/jsapi/global/constructor.any-expected.txt: 13 * web-platform-tests/wasm/jsapi/global/constructor.any.worker-expected.txt: 14 * web-platform-tests/wasm/jsapi/global/value-get-set.any-expected.txt: 15 * web-platform-tests/wasm/jsapi/global/value-get-set.any.worker-expected.txt: 16 * web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any-expected.txt: 17 * web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker-expected.txt: 18 * web-platform-tests/wasm/jsapi/instance/constructor.any-expected.txt: 19 * web-platform-tests/wasm/jsapi/instance/constructor.any.worker-expected.txt: 20 * web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any-expected.txt: 21 * web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any.worker-expected.txt: 22 * web-platform-tests/wasm/webapi/instantiateStreaming.any-expected.txt: 23 * web-platform-tests/wasm/webapi/instantiateStreaming.any.worker-expected.txt: 24 1 25 2021-01-05 Manuel Rego Casasnovas <rego@igalia.com> 2 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any-expected.txt
r269866 r271168 1 CONSOLE MESSAGE: TypeError: WebAssembly.Global does not accept i64 initial value2 3 Harness Error (FAIL), message = TypeError: WebAssembly.Global does not accept i64 initial value4 1 5 2 PASS WebAssembly.instantiate(module): Non-object imports argument: null … … 78 75 PASS WebAssembly.instantiate(module): Importing an i32 mutable global with an immutable Global object 79 76 PASS WebAssembly.instantiate(module): Importing an i64 mutable global with a primitive value 77 PASS WebAssembly.instantiate(module): Importing an i64 mutable global with an immutable Global object 78 PASS WebAssembly.instantiate(module): Importing an f32 mutable global with a primitive value 79 PASS WebAssembly.instantiate(module): Importing an f32 mutable global with an immutable Global object 80 PASS WebAssembly.instantiate(module): Importing an f64 mutable global with a primitive value 81 PASS WebAssembly.instantiate(module): Importing an f64 mutable global with an immutable Global object 82 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: undefined 83 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: null 84 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: true 85 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: "" 86 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: symbol "Symbol()" 87 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: 1 88 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: 0.1 89 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: NaN 90 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: plain object 91 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory 92 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 93 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 94 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 95 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: undefined 96 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: null 97 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: true 98 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: "" 99 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: symbol "Symbol()" 100 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: 1 101 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: 0.1 102 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: NaN 103 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: plain object 104 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table 105 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 106 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 107 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 108 PASS WebAssembly.instantiate(buffer): Non-object imports argument: null 109 PASS WebAssembly.instantiate(buffer): Non-object imports argument: true 110 PASS WebAssembly.instantiate(buffer): Non-object imports argument: "" 111 PASS WebAssembly.instantiate(buffer): Non-object imports argument: symbol "Symbol()" 112 PASS WebAssembly.instantiate(buffer): Non-object imports argument: 1 113 PASS WebAssembly.instantiate(buffer): Non-object imports argument: 0.1 114 PASS WebAssembly.instantiate(buffer): Non-object imports argument: NaN 115 PASS WebAssembly.instantiate(buffer): Non-object module: undefined 116 PASS WebAssembly.instantiate(buffer): Non-object module: null 117 PASS WebAssembly.instantiate(buffer): Non-object module: true 118 PASS WebAssembly.instantiate(buffer): Non-object module: "" 119 PASS WebAssembly.instantiate(buffer): Non-object module: symbol "Symbol()" 120 PASS WebAssembly.instantiate(buffer): Non-object module: 1 121 PASS WebAssembly.instantiate(buffer): Non-object module: 0.1 122 PASS WebAssembly.instantiate(buffer): Non-object module: NaN 123 PASS WebAssembly.instantiate(buffer): Missing imports argument 124 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: undefined 125 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: empty object 126 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: wrong property 127 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: undefined 128 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: null 129 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: true 130 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: "" 131 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: symbol "Symbol()" 132 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: 1 133 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: 0.1 134 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: NaN 135 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: object "[object Object]" 136 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: undefined 137 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: null 138 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: true 139 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: "" 140 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: symbol "Symbol()" 141 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: plain object 142 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global 143 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global.prototype 144 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 145 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: BigInt 146 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 147 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: undefined 148 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: null 149 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: true 150 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: "" 151 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: symbol "Symbol()" 152 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: plain object 153 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global 154 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global.prototype 155 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 156 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: Number 157 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 158 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: undefined 159 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: null 160 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: true 161 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: "" 162 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: symbol "Symbol()" 163 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: plain object 164 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global 165 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global.prototype 166 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 167 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: BigInt 168 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 169 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: undefined 170 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: null 171 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: true 172 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: "" 173 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: symbol "Symbol()" 174 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: plain object 175 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global 176 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global.prototype 177 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 178 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: BigInt 179 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 180 PASS WebAssembly.instantiate(buffer): Importing an i32 mutable global with a primitive value 181 PASS WebAssembly.instantiate(buffer): Importing an i32 mutable global with an immutable Global object 182 PASS WebAssembly.instantiate(buffer): Importing an i64 mutable global with a primitive value 183 PASS WebAssembly.instantiate(buffer): Importing an i64 mutable global with an immutable Global object 184 PASS WebAssembly.instantiate(buffer): Importing an f32 mutable global with a primitive value 185 PASS WebAssembly.instantiate(buffer): Importing an f32 mutable global with an immutable Global object 186 PASS WebAssembly.instantiate(buffer): Importing an f64 mutable global with a primitive value 187 PASS WebAssembly.instantiate(buffer): Importing an f64 mutable global with an immutable Global object 188 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: undefined 189 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: null 190 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: true 191 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: "" 192 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: symbol "Symbol()" 193 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: 1 194 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: 0.1 195 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: NaN 196 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: plain object 197 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory 198 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 199 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 200 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 201 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: undefined 202 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: null 203 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: true 204 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: "" 205 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: symbol "Symbol()" 206 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: 1 207 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: 0.1 208 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: NaN 209 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: plain object 210 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table 211 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 212 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 213 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 80 214 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker-expected.txt
r269866 r271168 1 2 Harness Error (FAIL), message = Error in remote http://localhost:8800/wasm/jsapi/bad-imports.js: TypeError: WebAssembly.Global does not accept i64 initial value3 1 4 2 PASS WebAssembly.instantiate(module): Non-object imports argument: null … … 77 75 PASS WebAssembly.instantiate(module): Importing an i32 mutable global with an immutable Global object 78 76 PASS WebAssembly.instantiate(module): Importing an i64 mutable global with a primitive value 77 PASS WebAssembly.instantiate(module): Importing an i64 mutable global with an immutable Global object 78 PASS WebAssembly.instantiate(module): Importing an f32 mutable global with a primitive value 79 PASS WebAssembly.instantiate(module): Importing an f32 mutable global with an immutable Global object 80 PASS WebAssembly.instantiate(module): Importing an f64 mutable global with a primitive value 81 PASS WebAssembly.instantiate(module): Importing an f64 mutable global with an immutable Global object 82 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: undefined 83 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: null 84 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: true 85 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: "" 86 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: symbol "Symbol()" 87 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: 1 88 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: 0.1 89 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: NaN 90 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: plain object 91 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory 92 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 93 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 94 PASS WebAssembly.instantiate(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 95 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: undefined 96 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: null 97 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: true 98 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: "" 99 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: symbol "Symbol()" 100 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: 1 101 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: 0.1 102 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: NaN 103 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: plain object 104 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table 105 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 106 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 107 PASS WebAssembly.instantiate(module): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 108 PASS WebAssembly.instantiate(buffer): Non-object imports argument: null 109 PASS WebAssembly.instantiate(buffer): Non-object imports argument: true 110 PASS WebAssembly.instantiate(buffer): Non-object imports argument: "" 111 PASS WebAssembly.instantiate(buffer): Non-object imports argument: symbol "Symbol()" 112 PASS WebAssembly.instantiate(buffer): Non-object imports argument: 1 113 PASS WebAssembly.instantiate(buffer): Non-object imports argument: 0.1 114 PASS WebAssembly.instantiate(buffer): Non-object imports argument: NaN 115 PASS WebAssembly.instantiate(buffer): Non-object module: undefined 116 PASS WebAssembly.instantiate(buffer): Non-object module: null 117 PASS WebAssembly.instantiate(buffer): Non-object module: true 118 PASS WebAssembly.instantiate(buffer): Non-object module: "" 119 PASS WebAssembly.instantiate(buffer): Non-object module: symbol "Symbol()" 120 PASS WebAssembly.instantiate(buffer): Non-object module: 1 121 PASS WebAssembly.instantiate(buffer): Non-object module: 0.1 122 PASS WebAssembly.instantiate(buffer): Non-object module: NaN 123 PASS WebAssembly.instantiate(buffer): Missing imports argument 124 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: undefined 125 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: empty object 126 PASS WebAssembly.instantiate(buffer): Imports argument with missing property: wrong property 127 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: undefined 128 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: null 129 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: true 130 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: "" 131 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: symbol "Symbol()" 132 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: 1 133 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: 0.1 134 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: NaN 135 PASS WebAssembly.instantiate(buffer): Importing a function with an incorrectly-typed value: object "[object Object]" 136 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: undefined 137 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: null 138 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: true 139 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: "" 140 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: symbol "Symbol()" 141 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: plain object 142 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global 143 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global.prototype 144 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 145 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: BigInt 146 PASS WebAssembly.instantiate(buffer): Importing an i32 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 147 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: undefined 148 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: null 149 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: true 150 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: "" 151 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: symbol "Symbol()" 152 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: plain object 153 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global 154 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global.prototype 155 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 156 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: Number 157 PASS WebAssembly.instantiate(buffer): Importing an i64 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 158 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: undefined 159 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: null 160 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: true 161 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: "" 162 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: symbol "Symbol()" 163 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: plain object 164 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global 165 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global.prototype 166 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 167 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: BigInt 168 PASS WebAssembly.instantiate(buffer): Importing an f32 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 169 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: undefined 170 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: null 171 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: true 172 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: "" 173 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: symbol "Symbol()" 174 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: plain object 175 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global 176 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global.prototype 177 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: Object.create(WebAssembly.Global.prototype) 178 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: BigInt 179 PASS WebAssembly.instantiate(buffer): Importing an f64 global with an incorrectly-typed value: WebAssembly.Global object (wrong value type) 180 PASS WebAssembly.instantiate(buffer): Importing an i32 mutable global with a primitive value 181 PASS WebAssembly.instantiate(buffer): Importing an i32 mutable global with an immutable Global object 182 PASS WebAssembly.instantiate(buffer): Importing an i64 mutable global with a primitive value 183 PASS WebAssembly.instantiate(buffer): Importing an i64 mutable global with an immutable Global object 184 PASS WebAssembly.instantiate(buffer): Importing an f32 mutable global with a primitive value 185 PASS WebAssembly.instantiate(buffer): Importing an f32 mutable global with an immutable Global object 186 PASS WebAssembly.instantiate(buffer): Importing an f64 mutable global with a primitive value 187 PASS WebAssembly.instantiate(buffer): Importing an f64 mutable global with an immutable Global object 188 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: undefined 189 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: null 190 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: true 191 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: "" 192 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: symbol "Symbol()" 193 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: 1 194 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: 0.1 195 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: NaN 196 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: plain object 197 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory 198 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 199 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 200 PASS WebAssembly.instantiate(buffer): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 201 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: undefined 202 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: null 203 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: true 204 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: "" 205 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: symbol "Symbol()" 206 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: 1 207 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: 0.1 208 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: NaN 209 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: plain object 210 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table 211 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 212 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 213 PASS WebAssembly.instantiate(buffer): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 79 214 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any-expected.txt
r271112 r271168 18 18 PASS exports and imports: BufferSource argument 19 19 PASS exports and imports: Module argument 20 FAIL i64 exports and imports: BufferSource argument promise_test: Unhandled rejection with value: object "LinkError: imported global module:global cannot be an i64" 21 FAIL i64 exports and imports: Module argument promise_test: Unhandled rejection with value: object "LinkError: imported global module:global cannot be an i64" 20 PASS i64 exports and imports: BufferSource argument 21 PASS i64 exports and imports: Module argument 22 22 PASS import with i32-returning function: BufferSource argument 23 23 PASS import with i32-returning function: Module argument 24 24 PASS import with function that takes and returns i32: BufferSource argument 25 25 PASS import with function that takes and returns i32: Module argument 26 FAIL import with i64-returning function: BufferSource argument assert_true: Should have called into JS expected true got false 27 FAIL import with i64-returning function: Module argument assert_true: Should have called into JS expected true got false 28 FAIL import with function that takes and returns i64: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()')" 29 FAIL import with function that takes and returns i64: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()')" 26 PASS import with i64-returning function: BufferSource argument 27 PASS import with i64-returning function: Module argument 28 PASS import with function that takes and returns i64: BufferSource argument 29 PASS import with function that takes and returns i64: Module argument 30 30 PASS import with i32-taking function: BufferSource argument 31 31 PASS import with i32-taking function: Module argument 32 FAIL import with i64-taking function: BufferSource argument assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 33 [native code] 34 }" ("TypeError") 35 FAIL import with i64-taking function: Module argument assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 36 [native code] 37 }" ("TypeError") 38 FAIL export i64-returning function: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()')" 39 FAIL export i64-returning function: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()')" 32 PASS import with i64-taking function: BufferSource argument 33 PASS import with i64-taking function: Module argument 34 PASS export i64-returning function: BufferSource argument 35 PASS export i64-returning function: Module argument 40 36 PASS i32 mutable WebAssembly.Global import: BufferSource argument 41 37 PASS i32 mutable WebAssembly.Global import: Module argument 42 FAIL i64 mutable WebAssembly.Global import: BufferSource argument WebAssembly.Global does not accept i64 initial value 43 FAIL i64 mutable WebAssembly.Global import: Module argument WebAssembly.Global does not accept i64 initial value 44 FAIL Multiple i64 arguments: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)')" 45 FAIL Multiple i64 arguments: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)')" 38 PASS i64 mutable WebAssembly.Global import: BufferSource argument 39 PASS i64 mutable WebAssembly.Global import: Module argument 40 PASS Multiple i64 arguments: BufferSource argument 41 PASS Multiple i64 arguments: Module argument 46 42 PASS stray argument: BufferSource argument 47 43 PASS stray argument: Module argument -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.worker-expected.txt
r271112 r271168 18 18 PASS exports and imports: BufferSource argument 19 19 PASS exports and imports: Module argument 20 FAIL i64 exports and imports: BufferSource argument promise_test: Unhandled rejection with value: object "LinkError: imported global module:global cannot be an i64" 21 FAIL i64 exports and imports: Module argument promise_test: Unhandled rejection with value: object "LinkError: imported global module:global cannot be an i64" 20 PASS i64 exports and imports: BufferSource argument 21 PASS i64 exports and imports: Module argument 22 22 PASS import with i32-returning function: BufferSource argument 23 23 PASS import with i32-returning function: Module argument 24 24 PASS import with function that takes and returns i32: BufferSource argument 25 25 PASS import with function that takes and returns i32: Module argument 26 FAIL import with i64-returning function: BufferSource argument assert_true: Should have called into JS expected true got false 27 FAIL import with i64-returning function: Module argument assert_true: Should have called into JS expected true got false 28 FAIL import with function that takes and returns i64: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()')" 29 FAIL import with function that takes and returns i64: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()')" 26 PASS import with i64-returning function: BufferSource argument 27 PASS import with i64-returning function: Module argument 28 PASS import with function that takes and returns i64: BufferSource argument 29 PASS import with function that takes and returns i64: Module argument 30 30 PASS import with i32-taking function: BufferSource argument 31 31 PASS import with i32-taking function: Module argument 32 FAIL import with i64-taking function: BufferSource argument assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 33 [native code] 34 }" ("TypeError") 35 FAIL import with i64-taking function: Module argument assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 36 [native code] 37 }" ("TypeError") 38 FAIL export i64-returning function: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()')" 39 FAIL export i64-returning function: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()')" 32 PASS import with i64-taking function: BufferSource argument 33 PASS import with i64-taking function: Module argument 34 PASS export i64-returning function: BufferSource argument 35 PASS export i64-returning function: Module argument 40 36 PASS i32 mutable WebAssembly.Global import: BufferSource argument 41 37 PASS i32 mutable WebAssembly.Global import: Module argument 42 FAIL i64 mutable WebAssembly.Global import: BufferSource argument WebAssembly.Global does not accept i64 initial value 43 FAIL i64 mutable WebAssembly.Global import: Module argument WebAssembly.Global does not accept i64 initial value 44 FAIL Multiple i64 arguments: BufferSource argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)')" 45 FAIL Multiple i64 arguments: Module argument promise_test: Unhandled rejection with value: object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)')" 38 PASS i64 mutable WebAssembly.Global import: BufferSource argument 39 PASS i64 mutable WebAssembly.Global import: Module argument 40 PASS Multiple i64 arguments: BufferSource argument 41 PASS Multiple i64 arguments: Module argument 46 42 PASS stray argument: BufferSource argument 47 43 PASS stray argument: Module argument -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any-expected.txt
r269866 r271168 7 7 PASS Invalid descriptor argument 8 8 PASS Invalid type argument 9 FAIL i64 with default WebAssembly.Global.prototype.value does not work with i64 type 9 PASS i64 with default 10 10 PASS Default value for type i32 11 11 PASS Explicit value undefined for type i32 … … 44 44 PASS Explicit value object with valueOf returning number for type f64 45 45 PASS BigInt value for type f64 46 FAIL Explicit value undefined for type i64 WebAssembly.Global.prototype.value does not work with i64 type 47 FAIL Explicit value true for type i64 WebAssembly.Global does not accept i64 initial value 48 FAIL Explicit value false for type i64 WebAssembly.Global does not accept i64 initial value 49 FAIL Explicit value "3" for type i64 WebAssembly.Global does not accept i64 initial value 50 FAIL Explicit value bigint "123" for type i64 WebAssembly.Global does not accept i64 initial value 51 FAIL Explicit value object with toString returning string for type i64 WebAssembly.Global does not accept i64 initial value 52 FAIL Explicit value object with valueOf returning string for type i64 WebAssembly.Global does not accept i64 initial value 53 FAIL Explicit value object with toString returning bigint for type i64 WebAssembly.Global does not accept i64 initial value 54 FAIL Explicit value object with valueOf returning bigint for type i64 WebAssembly.Global does not accept i64 initial value 46 PASS Explicit value undefined for type i64 47 PASS Explicit value true for type i64 48 PASS Explicit value false for type i64 49 PASS Explicit value "3" for type i64 50 PASS Explicit value bigint "123" for type i64 51 PASS Explicit value object with toString returning string for type i64 52 PASS Explicit value object with valueOf returning string for type i64 53 PASS Explicit value object with toString returning bigint for type i64 54 PASS Explicit value object with valueOf returning bigint for type i64 55 55 PASS Pass non-bigint as i64 Global value: null 56 56 PASS Pass non-bigint as i64 Global value: 666 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker-expected.txt
r269866 r271168 7 7 PASS Invalid descriptor argument 8 8 PASS Invalid type argument 9 FAIL i64 with default WebAssembly.Global.prototype.value does not work with i64 type 9 PASS i64 with default 10 10 PASS Default value for type i32 11 11 PASS Explicit value undefined for type i32 … … 44 44 PASS Explicit value object with valueOf returning number for type f64 45 45 PASS BigInt value for type f64 46 FAIL Explicit value undefined for type i64 WebAssembly.Global.prototype.value does not work with i64 type 47 FAIL Explicit value true for type i64 WebAssembly.Global does not accept i64 initial value 48 FAIL Explicit value false for type i64 WebAssembly.Global does not accept i64 initial value 49 FAIL Explicit value "3" for type i64 WebAssembly.Global does not accept i64 initial value 50 FAIL Explicit value bigint "123" for type i64 WebAssembly.Global does not accept i64 initial value 51 FAIL Explicit value object with toString returning string for type i64 WebAssembly.Global does not accept i64 initial value 52 FAIL Explicit value object with valueOf returning string for type i64 WebAssembly.Global does not accept i64 initial value 53 FAIL Explicit value object with toString returning bigint for type i64 WebAssembly.Global does not accept i64 initial value 54 FAIL Explicit value object with valueOf returning bigint for type i64 WebAssembly.Global does not accept i64 initial value 46 PASS Explicit value undefined for type i64 47 PASS Explicit value true for type i64 48 PASS Explicit value false for type i64 49 PASS Explicit value "3" for type i64 50 PASS Explicit value bigint "123" for type i64 51 PASS Explicit value object with toString returning string for type i64 52 PASS Explicit value object with valueOf returning string for type i64 53 PASS Explicit value object with toString returning bigint for type i64 54 PASS Explicit value object with valueOf returning bigint for type i64 55 55 PASS Pass non-bigint as i64 Global value: null 56 56 PASS Pass non-bigint as i64 Global value: 666 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any-expected.txt
r269866 r271168 17 17 PASS Mutable i32 (string) 18 18 PASS Mutable i32 (true on prototype) 19 FAIL Immutable i64 (missing) WebAssembly.Global.prototype.value does not work with i64 type 20 FAIL Immutable i64 with ToNumber side-effects (missing) WebAssembly.Global.prototype.value does not work with i64 type 21 FAIL Immutable i64 (undefined) WebAssembly.Global.prototype.value does not work with i64 type 22 FAIL Immutable i64 with ToNumber side-effects (undefined) WebAssembly.Global.prototype.value does not work with i64 type 23 FAIL Immutable i64 (null) WebAssembly.Global.prototype.value does not work with i64 type 24 FAIL Immutable i64 with ToNumber side-effects (null) WebAssembly.Global.prototype.value does not work with i64 type 25 FAIL Immutable i64 (false) WebAssembly.Global.prototype.value does not work with i64 type 26 FAIL Immutable i64 with ToNumber side-effects (false) WebAssembly.Global.prototype.value does not work with i64 type 27 FAIL Immutable i64 (empty string) WebAssembly.Global.prototype.value does not work with i64 type 28 FAIL Immutable i64 with ToNumber side-effects (empty string) WebAssembly.Global.prototype.value does not work with i64 type 29 FAIL Immutable i64 (zero) WebAssembly.Global.prototype.value does not work with i64 type 30 FAIL Immutable i64 with ToNumber side-effects (zero) WebAssembly.Global.prototype.value does not work with i64 type 31 FAIL Mutable i64 (true) WebAssembly.Global.prototype.value does not work with i64 type 32 FAIL Mutable i64 (one) WebAssembly.Global.prototype.value does not work with i64 type 33 FAIL Mutable i64 (string) WebAssembly.Global.prototype.value does not work with i64 type 34 FAIL Mutable i64 (true on prototype) WebAssembly.Global.prototype.value does not work with i64 type 19 PASS Immutable i64 (missing) 20 PASS Immutable i64 with ToNumber side-effects (missing) 21 PASS Immutable i64 (undefined) 22 PASS Immutable i64 with ToNumber side-effects (undefined) 23 PASS Immutable i64 (null) 24 PASS Immutable i64 with ToNumber side-effects (null) 25 PASS Immutable i64 (false) 26 PASS Immutable i64 with ToNumber side-effects (false) 27 PASS Immutable i64 (empty string) 28 PASS Immutable i64 with ToNumber side-effects (empty string) 29 PASS Immutable i64 (zero) 30 PASS Immutable i64 with ToNumber side-effects (zero) 31 PASS Mutable i64 (true) 32 PASS Mutable i64 (one) 33 PASS Mutable i64 (string) 34 PASS Mutable i64 (true on prototype) 35 35 PASS Immutable f32 (missing) 36 36 PASS Immutable f32 with ToNumber side-effects (missing) … … 65 65 PASS Mutable f64 (string) 66 66 PASS Mutable f64 (true on prototype) 67 FAIL i64 mutability WebAssembly.Global.prototype.value does not work with i64 type 67 PASS i64 mutability 68 68 PASS Calling setter without argument 69 69 PASS Stray argument -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.worker-expected.txt
r269866 r271168 17 17 PASS Mutable i32 (string) 18 18 PASS Mutable i32 (true on prototype) 19 FAIL Immutable i64 (missing) WebAssembly.Global.prototype.value does not work with i64 type 20 FAIL Immutable i64 with ToNumber side-effects (missing) WebAssembly.Global.prototype.value does not work with i64 type 21 FAIL Immutable i64 (undefined) WebAssembly.Global.prototype.value does not work with i64 type 22 FAIL Immutable i64 with ToNumber side-effects (undefined) WebAssembly.Global.prototype.value does not work with i64 type 23 FAIL Immutable i64 (null) WebAssembly.Global.prototype.value does not work with i64 type 24 FAIL Immutable i64 with ToNumber side-effects (null) WebAssembly.Global.prototype.value does not work with i64 type 25 FAIL Immutable i64 (false) WebAssembly.Global.prototype.value does not work with i64 type 26 FAIL Immutable i64 with ToNumber side-effects (false) WebAssembly.Global.prototype.value does not work with i64 type 27 FAIL Immutable i64 (empty string) WebAssembly.Global.prototype.value does not work with i64 type 28 FAIL Immutable i64 with ToNumber side-effects (empty string) WebAssembly.Global.prototype.value does not work with i64 type 29 FAIL Immutable i64 (zero) WebAssembly.Global.prototype.value does not work with i64 type 30 FAIL Immutable i64 with ToNumber side-effects (zero) WebAssembly.Global.prototype.value does not work with i64 type 31 FAIL Mutable i64 (true) WebAssembly.Global.prototype.value does not work with i64 type 32 FAIL Mutable i64 (one) WebAssembly.Global.prototype.value does not work with i64 type 33 FAIL Mutable i64 (string) WebAssembly.Global.prototype.value does not work with i64 type 34 FAIL Mutable i64 (true on prototype) WebAssembly.Global.prototype.value does not work with i64 type 19 PASS Immutable i64 (missing) 20 PASS Immutable i64 with ToNumber side-effects (missing) 21 PASS Immutable i64 (undefined) 22 PASS Immutable i64 with ToNumber side-effects (undefined) 23 PASS Immutable i64 (null) 24 PASS Immutable i64 with ToNumber side-effects (null) 25 PASS Immutable i64 (false) 26 PASS Immutable i64 with ToNumber side-effects (false) 27 PASS Immutable i64 (empty string) 28 PASS Immutable i64 with ToNumber side-effects (empty string) 29 PASS Immutable i64 (zero) 30 PASS Immutable i64 with ToNumber side-effects (zero) 31 PASS Mutable i64 (true) 32 PASS Mutable i64 (one) 33 PASS Mutable i64 (string) 34 PASS Mutable i64 (true on prototype) 35 35 PASS Immutable f32 (missing) 36 36 PASS Immutable f32 with ToNumber side-effects (missing) … … 65 65 PASS Mutable f64 (string) 66 66 PASS Mutable f64 (true on prototype) 67 FAIL i64 mutability WebAssembly.Global.prototype.value does not work with i64 type 67 PASS i64 mutability 68 68 PASS Calling setter without argument 69 69 PASS Stray argument -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any-expected.txt
r269866 r271168 1 CONSOLE MESSAGE: TypeError: WebAssembly.Global does not accept i64 initial value2 3 Harness Error (FAIL), message = TypeError: WebAssembly.Global does not accept i64 initial value4 1 5 2 PASS new WebAssembly.Instance(module): Non-object imports argument: null … … 78 75 PASS new WebAssembly.Instance(module): Importing an i32 mutable global with an immutable Global object 79 76 PASS new WebAssembly.Instance(module): Importing an i64 mutable global with a primitive value 77 PASS new WebAssembly.Instance(module): Importing an i64 mutable global with an immutable Global object 78 PASS new WebAssembly.Instance(module): Importing an f32 mutable global with a primitive value 79 PASS new WebAssembly.Instance(module): Importing an f32 mutable global with an immutable Global object 80 PASS new WebAssembly.Instance(module): Importing an f64 mutable global with a primitive value 81 PASS new WebAssembly.Instance(module): Importing an f64 mutable global with an immutable Global object 82 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: undefined 83 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: null 84 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: true 85 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: "" 86 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: symbol "Symbol()" 87 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: 1 88 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: 0.1 89 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: NaN 90 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: plain object 91 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory 92 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 93 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 94 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 95 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: undefined 96 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: null 97 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: true 98 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: "" 99 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: symbol "Symbol()" 100 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: 1 101 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: 0.1 102 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: NaN 103 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: plain object 104 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table 105 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 106 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 107 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 80 108 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker-expected.txt
r269866 r271168 1 CONSOLE MESSAGE: TypeError: WebAssembly.Global does not accept i64 initial value2 3 Harness Error (FAIL), message = TypeError: WebAssembly.Global does not accept i64 initial value4 1 5 2 PASS new WebAssembly.Instance(module): Non-object imports argument: null … … 78 75 PASS new WebAssembly.Instance(module): Importing an i32 mutable global with an immutable Global object 79 76 PASS new WebAssembly.Instance(module): Importing an i64 mutable global with a primitive value 77 PASS new WebAssembly.Instance(module): Importing an i64 mutable global with an immutable Global object 78 PASS new WebAssembly.Instance(module): Importing an f32 mutable global with a primitive value 79 PASS new WebAssembly.Instance(module): Importing an f32 mutable global with an immutable Global object 80 PASS new WebAssembly.Instance(module): Importing an f64 mutable global with a primitive value 81 PASS new WebAssembly.Instance(module): Importing an f64 mutable global with an immutable Global object 82 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: undefined 83 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: null 84 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: true 85 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: "" 86 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: symbol "Symbol()" 87 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: 1 88 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: 0.1 89 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: NaN 90 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: plain object 91 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory 92 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype 93 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) 94 PASS new WebAssembly.Instance(module): Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) 95 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: undefined 96 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: null 97 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: true 98 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: "" 99 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: symbol "Symbol()" 100 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: 1 101 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: 0.1 102 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: NaN 103 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: plain object 104 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table 105 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table.prototype 106 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) 107 PASS new WebAssembly.Instance(module): Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) 80 108 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any-expected.txt
r271112 r271168 12 12 PASS No imports 13 13 PASS exports and imports 14 FAIL i64 exports and imports imported global module:global cannot be an i64 (evaluating 'new WebAssembly.Instance(module, ...args)') 14 PASS i64 exports and imports 15 15 PASS import with i32-returning function 16 16 PASS import with function that takes and returns i32 17 FAIL import with i64-returning function assert_true: Should have called into JS expected true got false 18 FAIL import with function that takes and returns i64 WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()') 17 PASS import with i64-returning function 18 PASS import with function that takes and returns i64 19 19 PASS import with i32-taking function 20 FAIL import with i64-taking function assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 21 [native code] 22 }" ("TypeError") 23 FAIL export i64-returning function WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()') 20 PASS import with i64-taking function 21 PASS export i64-returning function 24 22 PASS i32 mutable WebAssembly.Global import 25 FAIL i64 mutable WebAssembly.Global import WebAssembly.Global does not accept i64 initial value 26 FAIL Multiple i64 arguments WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)') 23 PASS i64 mutable WebAssembly.Global import 24 PASS Multiple i64 arguments 27 25 PASS stray argument 28 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker-expected.txt
r271112 r271168 12 12 PASS No imports 13 13 PASS exports and imports 14 FAIL i64 exports and imports imported global module:global cannot be an i64 (evaluating 'new WebAssembly.Instance(module, ...args)') 14 PASS i64 exports and imports 15 15 PASS import with i32-returning function 16 16 PASS import with function that takes and returns i32 17 FAIL import with i64-returning function assert_true: Should have called into JS expected true got false 18 FAIL import with function that takes and returns i64 WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn2()') 17 PASS import with i64-returning function 18 PASS import with function that takes and returns i64 19 19 PASS import with i32-taking function 20 FAIL import with i64-taking function assert_throws_js: function "() => instance.exports.fn(6)" threw object "RuntimeError: WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'instance.exports.fn(6)')" ("RuntimeError") expected instance of function "function TypeError() { 21 [native code] 22 }" ("TypeError") 23 FAIL export i64-returning function WebAssembly function that returns i64 can't be called from JavaScript (evaluating 'instance.exports.fn()') 20 PASS import with i64-taking function 21 PASS export i64-returning function 24 22 PASS i32 mutable WebAssembly.Global import 25 FAIL i64 mutable WebAssembly.Global import WebAssembly.Global does not accept i64 initial value 26 FAIL Multiple i64 arguments WebAssembly function with an i64 argument can't be called from JavaScript (evaluating 'fn(1n, 0n)') 23 PASS i64 mutable WebAssembly.Global import 24 PASS Multiple i64 arguments 27 25 PASS stray argument 28 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any-expected.txt
r269866 r271168 1 CONSOLE MESSAGE: TypeError: WebAssembly.Global does not accept i64 initial value2 3 Harness Error (FAIL), message = TypeError: WebAssembly.Global does not accept i64 initial value4 1 5 2 FAIL Non-object imports argument: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) … … 78 75 FAIL Importing an i32 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 79 76 FAIL Importing an i64 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 77 FAIL Importing an i64 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 78 FAIL Importing an f32 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 79 FAIL Importing an f32 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 80 FAIL Importing an f64 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 81 FAIL Importing an f64 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 82 FAIL Importing memory with an incorrectly-typed value: undefined WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 83 FAIL Importing memory with an incorrectly-typed value: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 84 FAIL Importing memory with an incorrectly-typed value: true WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 85 FAIL Importing memory with an incorrectly-typed value: "" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 86 FAIL Importing memory with an incorrectly-typed value: symbol "Symbol()" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 87 FAIL Importing memory with an incorrectly-typed value: 1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 88 FAIL Importing memory with an incorrectly-typed value: 0.1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 89 FAIL Importing memory with an incorrectly-typed value: NaN WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 90 FAIL Importing memory with an incorrectly-typed value: plain object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 91 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 92 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 93 FAIL Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 94 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 95 FAIL Importing table with an incorrectly-typed value: undefined WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 96 FAIL Importing table with an incorrectly-typed value: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 97 FAIL Importing table with an incorrectly-typed value: true WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 98 FAIL Importing table with an incorrectly-typed value: "" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 99 FAIL Importing table with an incorrectly-typed value: symbol "Symbol()" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 100 FAIL Importing table with an incorrectly-typed value: 1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 101 FAIL Importing table with an incorrectly-typed value: 0.1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 102 FAIL Importing table with an incorrectly-typed value: NaN WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 103 FAIL Importing table with an incorrectly-typed value: plain object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 104 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 105 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table.prototype WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 106 FAIL Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 107 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 80 108 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any.worker-expected.txt
r269866 r271168 1 CONSOLE MESSAGE: TypeError: WebAssembly.Global does not accept i64 initial value2 3 Harness Error (FAIL), message = TypeError: WebAssembly.Global does not accept i64 initial value4 1 5 2 FAIL Non-object imports argument: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) … … 78 75 FAIL Importing an i32 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 79 76 FAIL Importing an i64 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 77 FAIL Importing an i64 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 78 FAIL Importing an f32 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 79 FAIL Importing an f32 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 80 FAIL Importing an f64 mutable global with a primitive value WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 81 FAIL Importing an f64 mutable global with an immutable Global object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 82 FAIL Importing memory with an incorrectly-typed value: undefined WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 83 FAIL Importing memory with an incorrectly-typed value: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 84 FAIL Importing memory with an incorrectly-typed value: true WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 85 FAIL Importing memory with an incorrectly-typed value: "" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 86 FAIL Importing memory with an incorrectly-typed value: symbol "Symbol()" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 87 FAIL Importing memory with an incorrectly-typed value: 1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 88 FAIL Importing memory with an incorrectly-typed value: 0.1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 89 FAIL Importing memory with an incorrectly-typed value: NaN WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 90 FAIL Importing memory with an incorrectly-typed value: plain object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 91 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 92 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory.prototype WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 93 FAIL Importing memory with an incorrectly-typed value: Object.create(WebAssembly.Memory.prototype) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 94 FAIL Importing memory with an incorrectly-typed value: WebAssembly.Memory object (too large) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 95 FAIL Importing table with an incorrectly-typed value: undefined WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 96 FAIL Importing table with an incorrectly-typed value: null WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 97 FAIL Importing table with an incorrectly-typed value: true WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 98 FAIL Importing table with an incorrectly-typed value: "" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 99 FAIL Importing table with an incorrectly-typed value: symbol "Symbol()" WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 100 FAIL Importing table with an incorrectly-typed value: 1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 101 FAIL Importing table with an incorrectly-typed value: 0.1 WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 102 FAIL Importing table with an incorrectly-typed value: NaN WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 103 FAIL Importing table with an incorrectly-typed value: plain object WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 104 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 105 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table.prototype WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 106 FAIL Importing table with an incorrectly-typed value: Object.create(WebAssembly.Table.prototype) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 107 FAIL Importing table with an incorrectly-typed value: WebAssembly.Table object (too large) WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined) 80 108 -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming.any-expected.txt
r269866 r271168 16 16 FAIL export i64-returning function promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 17 17 FAIL i32 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 18 FAIL i64 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly. Global does not accept i64 initial value"18 FAIL i64 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 19 19 FAIL Multiple i64 arguments promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 20 20 FAIL stray argument promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" -
trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming.any.worker-expected.txt
r269866 r271168 16 16 FAIL export i64-returning function promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 17 17 FAIL i32 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 18 FAIL i64 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly. Global does not accept i64 initial value"18 FAIL i64 mutable WebAssembly.Global import promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 19 19 FAIL Multiple i64 arguments promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" 20 20 FAIL stray argument promise_test: Unhandled rejection with value: object "TypeError: WebAssembly.instantiateStreaming is not a function. (In 'WebAssembly.instantiateStreaming(response, ...args)', 'WebAssembly.instantiateStreaming' is undefined)" -
trunk/Source/JavaScriptCore/ChangeLog
r271164 r271168 1 2021-01-05 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [WASM] [BigInt] Add I64 to BigInt conversion 4 https://bugs.webkit.org/show_bug.cgi?id=213528 5 6 Reviewed by Michael Saboff. 7 8 This patch implements i64 to BigInt / BigInt to i64 support in WebAssembly to expose i64 features to JS. 9 10 1. Arguments of exposed wasm functions can have i64. 11 2. Returned values of exposed wasm functions can have i64. 12 3. WebAssembly.Global can expose i64 value to JS. 13 14 Currently, we do not support fast JS->Wasm IC for wasm functions including i64 arguments. But this should be supported later 15 in https://bugs.webkit.org/show_bug.cgi?id=220053. 16 17 * jsc.cpp: 18 (JSC_DEFINE_HOST_FUNCTION): 19 * runtime/BigIntConstructor.cpp: 20 (JSC::JSC_DEFINE_HOST_FUNCTION): 21 (JSC::toBigInt): Deleted. 22 * runtime/BigIntConstructor.h: 23 * runtime/JSBigInt.cpp: 24 (JSC::JSBigInt::toBigUInt64Heap): 25 * runtime/JSBigInt.h: 26 * runtime/JSCJSValue.cpp: 27 (JSC::JSValue::toBigInt const): 28 (JSC::JSValue::toBigInt64 const): 29 (JSC::JSValue::toBigUInt64 const): 30 * runtime/JSCJSValue.h: 31 * wasm/WasmExceptionType.h: 32 * wasm/WasmGlobal.cpp: 33 (JSC::Wasm::Global::get const): 34 (JSC::Wasm::Global::set): 35 * wasm/WasmGlobal.h: 36 * wasm/WasmOperations.cpp: 37 (JSC::Wasm::JSC_DEFINE_JIT_OPERATION): 38 * wasm/WasmOperations.h: 39 * wasm/js/JSToWasm.cpp: 40 (JSC::Wasm::marshallJSResult): 41 (JSC::Wasm::createJSToWasmWrapper): 42 (JSC::Wasm::boxWasmResult): Deleted. 43 * wasm/js/WasmToJS.cpp: 44 (JSC::Wasm::wasmToJS): 45 (JSC::Wasm::handleBadI64Use): Deleted. 46 * wasm/js/WebAssemblyFunction.cpp: 47 (JSC::JSC_DEFINE_HOST_FUNCTION): 48 (JSC::WebAssemblyFunction::jsCallEntrypointSlow): 49 * wasm/js/WebAssemblyGlobalConstructor.cpp: 50 (JSC::JSC_DEFINE_HOST_FUNCTION): 51 * wasm/js/WebAssemblyGlobalPrototype.cpp: 52 (JSC::JSC_DEFINE_HOST_FUNCTION): 53 * wasm/js/WebAssemblyModuleRecord.cpp: 54 (JSC::WebAssemblyModuleRecord::link): 55 1 56 2021-01-05 Alexey Shvayka <shvaikalesh@gmail.com> 2 57 -
trunk/Source/JavaScriptCore/jsc.cpp
r270764 r271168 2416 2416 auto scope = DECLARE_THROW_SCOPE(vm); 2417 2417 JSValue argument = callFrame->argument(0); 2418 JSValue bigInt = toBigInt(globalObject, argument);2418 JSValue bigInt = argument.toBigInt(globalObject); 2419 2419 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2420 2420 #if USE(BIGINT32) … … 2435 2435 auto scope = DECLARE_THROW_SCOPE(vm); 2436 2436 JSValue argument = callFrame->argument(0); 2437 JSValue bigIntValue = toBigInt(globalObject, argument);2437 JSValue bigIntValue = argument.toBigInt(globalObject); 2438 2438 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 2439 2439 if (bigIntValue.isBigInt32()) -
trunk/Source/JavaScriptCore/runtime/BigIntConstructor.cpp
r268322 r271168 73 73 // ------------------------------ Functions --------------------------- 74 74 75 JSValue toBigInt(JSGlobalObject* globalObject, JSValue argument)76 {77 VM& vm = globalObject->vm();78 auto scope = DECLARE_THROW_SCOPE(vm);79 80 JSValue primitive = argument.toPrimitive(globalObject);81 RETURN_IF_EXCEPTION(scope, { });82 83 if (primitive.isBigInt())84 return primitive;85 86 if (primitive.isBoolean()) {87 #if USE(BIGINT32)88 return jsBigInt32(primitive.asBoolean());89 #else90 RELEASE_AND_RETURN(scope, JSBigInt::createFrom(globalObject, primitive.asBoolean()));91 #endif92 }93 94 if (primitive.isString()) {95 scope.release();96 return toStringView(globalObject, primitive, [&] (StringView view) {97 return JSBigInt::parseInt(globalObject, view);98 });99 }100 101 ASSERT(primitive.isUndefinedOrNull() || primitive.isNumber() || primitive.isSymbol());102 throwTypeError(globalObject, scope, "Invalid argument type in ToBigInt operation"_s);103 return jsUndefined();104 }105 106 75 JSC_DEFINE_HOST_FUNCTION(callBigIntConstructor, (JSGlobalObject* globalObject, CallFrame* callFrame)) 107 76 { … … 128 97 } 129 98 130 RELEASE_AND_RETURN(scope, JSValue::encode( toBigInt(globalObject, primitive)));99 RELEASE_AND_RETURN(scope, JSValue::encode(primitive.toBigInt(globalObject))); 131 100 } 132 101 … … 146 115 RETURN_IF_EXCEPTION(scope, { }); 147 116 148 JSValue bigInt = toBigInt(globalObject, callFrame->argument(1));117 JSValue bigInt = callFrame->argument(1).toBigInt(globalObject); 149 118 RETURN_IF_EXCEPTION(scope, { }); 150 119 … … 166 135 RETURN_IF_EXCEPTION(scope, { }); 167 136 168 JSValue bigInt = toBigInt(globalObject, callFrame->argument(1));137 JSValue bigInt = callFrame->argument(1).toBigInt(globalObject); 169 138 RETURN_IF_EXCEPTION(scope, { }); 170 139 -
trunk/Source/JavaScriptCore/runtime/BigIntConstructor.h
r260490 r271168 59 59 STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(BigIntConstructor, InternalFunction); 60 60 61 JS_EXPORT_PRIVATE JSValue toBigInt(JSGlobalObject*, JSValue);62 63 61 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp
r270766 r271168 3044 3044 #endif 3045 3045 3046 uint64_t JSBigInt::toBigUInt64Heap(JSBigInt* bigInt) 3047 { 3048 auto length = bigInt->length(); 3049 if (!length) 3050 return 0; 3051 uint64_t value = 0; 3052 if constexpr (sizeof(Digit) == 4) { 3053 value = static_cast<uint64_t>(bigInt->digit(0)); 3054 if (length > 1) 3055 value |= static_cast<uint64_t>(bigInt->digit(1)) << 32; 3056 } else { 3057 ASSERT(sizeof(Digit) == 8); 3058 value = bigInt->digit(0); 3059 } 3060 if (!bigInt->sign()) 3061 return value; 3062 return ~(value - 1); // To avoid undefined behavior, we compute two's compliment by hand in C while this is simply `-value`. 3063 } 3064 3046 3065 Optional<uint64_t> JSBigInt::toUint64Heap(JSBigInt* bigInt) 3047 3066 { -
trunk/Source/JavaScriptCore/runtime/JSBigInt.h
r270298 r271168 421 421 #endif 422 422 423 static uint64_t toBigUInt64(JSValue bigInt) 424 { 425 ASSERT(bigInt.isBigInt()); 426 #if USE(BIGINT32) 427 if (bigInt.isBigInt32()) 428 return static_cast<uint64_t>(static_cast<int64_t>(bigInt.bigInt32AsInt32())); 429 #endif 430 return toBigUInt64Heap(bigInt.asHeapBigInt()); 431 } 432 433 static uint64_t toBigInt64(JSValue bigInt) 434 { 435 ASSERT(bigInt.isBigInt()); 436 #if USE(BIGINT32) 437 if (bigInt.isBigInt32()) 438 return static_cast<int64_t>(bigInt.bigInt32AsInt32()); 439 #endif 440 return static_cast<int64_t>(toBigUInt64Heap(bigInt.asHeapBigInt())); 441 } 442 423 443 static Optional<uint64_t> toUint64(JSValue bigInt) 424 444 { … … 589 609 static ImplResult truncateAndSubFromPowerOfTwo(JSGlobalObject*, int32_t, BigIntImpl, bool resultSign); 590 610 611 JS_EXPORT_PRIVATE static uint64_t toBigUInt64Heap(JSBigInt*); 612 591 613 JS_EXPORT_PRIVATE static Optional<uint64_t> toUint64Heap(JSBigInt*); 592 614 -
trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp
r268710 r271168 95 95 return 0; 96 96 return WTF::nullopt; 97 } 98 99 // https://tc39.es/ecma262/#sec-tobigint 100 JSValue JSValue::toBigInt(JSGlobalObject* globalObject) const 101 { 102 VM& vm = globalObject->vm(); 103 auto scope = DECLARE_THROW_SCOPE(vm); 104 105 JSValue primitive = toPrimitive(globalObject); 106 RETURN_IF_EXCEPTION(scope, { }); 107 108 if (primitive.isBigInt()) 109 return primitive; 110 111 if (primitive.isBoolean()) { 112 #if USE(BIGINT32) 113 return jsBigInt32(primitive.asBoolean()); 114 #else 115 RELEASE_AND_RETURN(scope, JSBigInt::createFrom(globalObject, primitive.asBoolean())); 116 #endif 117 } 118 119 if (primitive.isString()) { 120 scope.release(); 121 return toStringView(globalObject, primitive, [&] (StringView view) { 122 return JSBigInt::parseInt(globalObject, view); 123 }); 124 } 125 126 ASSERT(primitive.isUndefinedOrNull() || primitive.isNumber() || primitive.isSymbol()); 127 throwTypeError(globalObject, scope, "Invalid argument type in ToBigInt operation"_s); 128 return jsUndefined(); 129 } 130 131 // https://tc39.es/ecma262/#sec-tobigint64 132 int64_t JSValue::toBigInt64(JSGlobalObject* globalObject) const 133 { 134 VM& vm = globalObject->vm(); 135 auto scope = DECLARE_THROW_SCOPE(vm); 136 137 JSValue value = toBigInt(globalObject); 138 RETURN_IF_EXCEPTION(scope, { }); 139 return JSBigInt::toBigInt64(value); 140 } 141 142 // https://tc39.es/ecma262/#sec-tobiguint64 143 uint64_t JSValue::toBigUInt64(JSGlobalObject* globalObject) const 144 { 145 VM& vm = globalObject->vm(); 146 auto scope = DECLARE_THROW_SCOPE(vm); 147 148 JSValue value = toBigInt(globalObject); 149 RETURN_IF_EXCEPTION(scope, { }); 150 return JSBigInt::toBigUInt64(value); 97 151 } 98 152 -
trunk/Source/JavaScriptCore/runtime/JSCJSValue.h
r270298 r271168 299 299 double toLength(JSGlobalObject*) const; 300 300 301 JS_EXPORT_PRIVATE JSValue toBigInt(JSGlobalObject*) const; 302 int64_t toBigInt64(JSGlobalObject*) const; 303 uint64_t toBigUInt64(JSGlobalObject*) const; 304 301 305 Optional<uint32_t> toUInt32AfterToNumeric(JSGlobalObject*) const; 302 306 -
trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h
r246589 r271168 43 43 macro(IntegerOverflow, "Integer overflow") \ 44 44 macro(StackOverflow, "Stack overflow") \ 45 macro(I64ArgumentType, "WebAssembly function with an i64 argument can't be called from JavaScript") \46 macro(I64ReturnType, "WebAssembly function that returns i64 can't be called from JavaScript") \47 45 macro(FuncrefNotWasm, "Funcref must be an exported wasm function") 48 46 -
trunk/Source/JavaScriptCore/wasm/WasmGlobal.cpp
r269552 r271168 36 36 namespace JSC { namespace Wasm { 37 37 38 JSValue Global::get( ) const38 JSValue Global::get(JSGlobalObject* globalObject) const 39 39 { 40 40 switch (m_type) { 41 41 case Wasm::Type::I32: 42 42 return jsNumber(bitwise_cast<int32_t>(static_cast<uint32_t>(m_value.m_primitive))); 43 case Wasm::Type::I64: 44 return JSBigInt::makeHeapBigIntOrBigInt32(globalObject, static_cast<int64_t>(m_value.m_primitive)); 43 45 case Wasm::Type::F32: 44 46 return jsNumber(purifyNaN(static_cast<double>(bitwise_cast<float>(static_cast<uint32_t>(m_value.m_primitive))))); … … 63 65 RETURN_IF_EXCEPTION(throwScope, void()); 64 66 m_value.m_primitive = static_cast<uint64_t>(static_cast<uint32_t>(value)); 67 break; 68 } 69 case Wasm::Type::I64: { 70 int64_t value = argument.toBigInt64(globalObject); 71 RETURN_IF_EXCEPTION(throwScope, void()); 72 m_value.m_primitive = static_cast<uint64_t>(value); 65 73 break; 66 74 } -
trunk/Source/JavaScriptCore/wasm/WasmGlobal.h
r269552 r271168 55 55 Wasm::Type type() const { return m_type; } 56 56 Wasm::GlobalInformation::Mutability mutability() const { return m_mutability; } 57 JSValue get( ) const;57 JSValue get(JSGlobalObject*) const; 58 58 uint64_t getPrimitive() const { return m_value.m_primitive; } 59 59 void set(JSGlobalObject*, JSValue); -
trunk/Source/JavaScriptCore/wasm/WasmOperations.cpp
r271114 r271168 58 58 59 59 namespace JSC { namespace Wasm { 60 61 JSC_DEFINE_JIT_OPERATION(operationWasmThrowBadI64, void, (JSWebAssemblyInstance* instance))62 {63 VM& vm = instance->vm();64 CallFrame* callFrame = DECLARE_CALL_FRAME(vm);65 JITOperationPrologueCallFrameTracer tracer(vm, callFrame);66 67 {68 auto throwScope = DECLARE_THROW_SCOPE(vm);69 JSGlobalObject* globalObject = instance->globalObject();70 auto* error = ErrorInstance::create(globalObject, vm, globalObject->errorStructure(ErrorType::TypeError), "i64 not allowed as return type or argument to an imported function"_s);71 throwException(globalObject, throwScope, error);72 }73 74 genericUnwind(vm, callFrame);75 ASSERT(!!vm.callFrameForCatch);76 }77 60 78 61 static bool shouldTriggerOMGCompile(TierUpCount& tierUp, OMGCallee* replacement, uint32_t functionIndex) … … 482 465 } 483 466 467 JSC_DEFINE_JIT_OPERATION(operationConvertToI64, int64_t, (CallFrame* callFrame, JSValue v)) 468 { 469 // FIXME: Consider passing JSWebAssemblyInstance* instead. 470 // https://bugs.webkit.org/show_bug.cgi?id=203206 471 VM& vm = callFrame->deprecatedVM(); 472 NativeCallFrameTracer tracer(vm, callFrame); 473 return v.toBigInt64(callFrame->lexicalGlobalObject(vm)); 474 } 475 484 476 JSC_DEFINE_JIT_OPERATION(operationConvertToF64, double, (CallFrame* callFrame, JSValue v)) 485 477 { … … 507 499 NativeCallFrameTracer tracer(vm, callFrame); 508 500 return static_cast<float>(v.toNumber(callFrame->lexicalGlobalObject(vm))); 501 } 502 503 JSC_DEFINE_JIT_OPERATION(operationConvertToBigInt, EncodedJSValue, (CallFrame* callFrame, Instance* instance, int64_t value)) 504 { 505 JSWebAssemblyInstance* jsInstance = instance->owner<JSWebAssemblyInstance>(); 506 JSGlobalObject* globalObject = jsInstance->globalObject(); 507 VM& vm = globalObject->vm(); 508 NativeCallFrameTracer tracer(vm, callFrame); 509 return JSValue::encode(JSBigInt::makeHeapBigIntOrBigInt32(globalObject, value)); 509 510 } 510 511 … … 549 550 case I32: 550 551 unboxedValue = value.toInt32(globalObject); 552 break; 553 case I64: 554 unboxedValue = value.toBigInt64(globalObject); 551 555 break; 552 556 case F32: -
trunk/Source/JavaScriptCore/wasm/WasmOperations.h
r271100 r271168 48 48 JSC_DECLARE_JIT_OPERATION(operationWasmTriggerOSREntryNow, void, (Probe::Context&)); 49 49 JSC_DECLARE_JIT_OPERATION(operationWasmTriggerTierUpNow, void, (Instance*, uint32_t functionIndex)); 50 JSC_DECLARE_JIT_OPERATION(operationWasmThrowBadI64, void, (JSWebAssemblyInstance*));51 50 JSC_DECLARE_JIT_OPERATION(operationWasmUnwind, void, (CallFrame*)); 52 51 52 JSC_DECLARE_JIT_OPERATION(operationConvertToI64, int64_t, (CallFrame*, JSValue)); 53 53 JSC_DECLARE_JIT_OPERATION(operationConvertToF64, double, (CallFrame*, JSValue)); 54 54 JSC_DECLARE_JIT_OPERATION(operationConvertToI32, int32_t, (CallFrame*, JSValue)); 55 55 JSC_DECLARE_JIT_OPERATION(operationConvertToF32, float, (CallFrame*, JSValue)); 56 57 JSC_DECLARE_JIT_OPERATION(operationConvertToBigInt, EncodedJSValue, (CallFrame*, Instance*, int64_t)); 56 58 57 59 JSC_DECLARE_JIT_OPERATION(operationIterateResults, void, (CallFrame*, Instance*, const Signature*, JSValue, uint64_t*, uint64_t*)); -
trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp
r269974 r271168 39 39 namespace JSC { namespace Wasm { 40 40 41 inline void boxWasmResult(CCallHelpers& jit, Wasm::Type type, Reg src, JSValueRegs dst)42 {43 switch (type) {44 case Wasm::Void:45 jit.moveTrustedValue(jsUndefined(), dst);46 break;47 case Wasm::Externref:48 case Wasm::Funcref:49 jit.move(src.gpr(), dst.payloadGPR());50 break;51 case Wasm::I32:52 jit.zeroExtend32ToWord(src.gpr(), dst.payloadGPR());53 jit.boxInt32(dst.payloadGPR(), dst, DoNotHaveTagRegisters);54 break;55 case Wasm::F32:56 jit.convertFloatToDouble(src.fpr(), src.fpr());57 FALLTHROUGH;58 case Wasm::F64: {59 jit.moveTrustedValue(jsNumber(pureNaN()), dst);60 auto isNaN = jit.branchIfNaN(src.fpr());61 jit.boxDouble(src.fpr(), dst, DoNotHaveTagRegisters);62 isNaN.link(&jit);63 break;64 }65 default:66 jit.breakpoint();67 break;68 }69 }70 71 41 void marshallJSResult(CCallHelpers& jit, const Signature& signature, const CallInformation& wasmFrameConvention, const RegisterAtOffsetList& savedResultRegisters) 72 42 { 43 auto boxWasmResult = [](CCallHelpers& jit, Wasm::Type type, Reg src, JSValueRegs dst) { 44 switch (type) { 45 case Wasm::Void: 46 jit.moveTrustedValue(jsUndefined(), dst); 47 break; 48 case Wasm::Externref: 49 case Wasm::Funcref: 50 jit.move(src.gpr(), dst.payloadGPR()); 51 break; 52 case Wasm::I32: 53 jit.zeroExtend32ToWord(src.gpr(), dst.payloadGPR()); 54 jit.boxInt32(dst.payloadGPR(), dst, DoNotHaveTagRegisters); 55 break; 56 case Wasm::F32: 57 jit.convertFloatToDouble(src.fpr(), src.fpr()); 58 FALLTHROUGH; 59 case Wasm::F64: { 60 jit.moveTrustedValue(jsNumber(pureNaN()), dst); 61 auto isNaN = jit.branchIfNaN(src.fpr()); 62 jit.boxDouble(src.fpr(), dst, DoNotHaveTagRegisters); 63 isNaN.link(&jit); 64 break; 65 } 66 default: 67 jit.breakpoint(); 68 break; 69 } 70 }; 71 73 72 if (signature.returnsVoid()) 74 73 jit.moveTrustedValue(jsUndefined(), JSValueRegs { GPRInfo::returnValueGPR }); 75 else if (signature.returnCount() == 1) 76 boxWasmResult(jit, signature.returnType(0), wasmFrameConvention.results[0].reg(), JSValueRegs { GPRInfo::returnValueGPR }); 77 else { 74 else if (signature.returnCount() == 1) { 75 if (signature.returnType(0) == Wasm::I64) { 76 GPRReg inputGPR = wasmFrameConvention.results[0].reg().gpr(); 77 GPRReg wasmContextInstanceGPR = PinnedRegisterInfo::get().wasmContextInstancePointer; 78 if (Context::useFastTLS()) { 79 wasmContextInstanceGPR = inputGPR == GPRInfo::argumentGPR1 ? GPRInfo::argumentGPR0 : GPRInfo::argumentGPR1; 80 static_assert(std::is_same_v<Wasm::Instance*, typename FunctionTraits<decltype(operationAllocateResultsArray)>::ArgumentType<1>>); 81 jit.loadWasmContextInstance(wasmContextInstanceGPR); 82 } 83 jit.setupArguments<decltype(operationConvertToBigInt)>(wasmContextInstanceGPR, inputGPR); 84 jit.callOperation(FunctionPtr<OperationPtrTag>(operationConvertToBigInt)); 85 } else 86 boxWasmResult(jit, signature.returnType(0), wasmFrameConvention.results[0].reg(), JSValueRegs { GPRInfo::returnValueGPR }); 87 } else { 78 88 IndexingType indexingType = ArrayWithUndecided; 79 89 JSValueRegs scratch = JSValueRegs { wasmCallingConvention().prologueScratchGPRs[1] }; 80 90 // We can use the first floating point register as a scratch since it will always be moved onto the stack before other values. 81 91 FPRReg fprScratch = wasmCallingConvention().fprArgs[0].fpr(); 92 bool hasI64 = false; 82 93 for (unsigned i = 0; i < signature.returnCount(); ++i) { 83 94 B3::ValueRep rep = wasmFrameConvention.results[i]; 84 95 Type type = signature.returnType(i); 85 96 97 hasI64 |= type == Wasm::I64; 86 98 if (rep.isReg()) { 87 boxWasmResult(jit, signature.returnType(i), rep.reg(), scratch); 88 jit.storeValue(scratch, CCallHelpers::Address(CCallHelpers::stackPointerRegister, savedResultRegisters.find(rep.reg())->offset() + wasmFrameConvention.headerAndArgumentStackSizeInBytes)); 99 if (type != Wasm::I64) { 100 boxWasmResult(jit, signature.returnType(i), rep.reg(), scratch); 101 jit.storeValue(scratch, CCallHelpers::Address(CCallHelpers::stackPointerRegister, savedResultRegisters.find(rep.reg())->offset() + wasmFrameConvention.headerAndArgumentStackSizeInBytes)); 102 } else 103 jit.storeValue(JSValueRegs { rep.reg().gpr() }, CCallHelpers::Address(CCallHelpers::stackPointerRegister, savedResultRegisters.find(rep.reg())->offset() + wasmFrameConvention.headerAndArgumentStackSizeInBytes)); 89 104 } else { 90 auto location = CCallHelpers::Address(CCallHelpers::stackPointerRegister, rep.offsetFromSP()); 91 Reg tmp = type == F32 || type == F64 ? Reg(fprScratch) : Reg(scratch.gpr()); 92 jit.load64ToReg(location, tmp); 93 boxWasmResult(jit, signature.returnType(i), tmp, scratch); 94 jit.storeValue(scratch, location); 105 if (type != Wasm::I64) { 106 auto location = CCallHelpers::Address(CCallHelpers::stackPointerRegister, rep.offsetFromSP()); 107 Reg tmp = type == F32 || type == F64 ? Reg(fprScratch) : Reg(scratch.gpr()); 108 jit.load64ToReg(location, tmp); 109 boxWasmResult(jit, signature.returnType(i), tmp, scratch); 110 jit.storeValue(scratch, location); 111 } 95 112 } 96 113 … … 109 126 } 110 127 128 // Now, all return values are stored in memory. So we can call functions can clobber caller-save registers. 129 // This is required to convert values to BigInt. 130 if (hasI64) { 131 for (unsigned i = 0; i < signature.returnCount(); ++i) { 132 B3::ValueRep rep = wasmFrameConvention.results[i]; 133 Type type = signature.returnType(i); 134 if (type != Wasm::I64) 135 continue; 136 137 GPRReg wasmContextInstanceGPR = PinnedRegisterInfo::get().wasmContextInstancePointer; 138 if (Context::useFastTLS()) { 139 wasmContextInstanceGPR = GPRInfo::argumentGPR1; 140 static_assert(std::is_same_v<Wasm::Instance*, typename FunctionTraits<decltype(operationAllocateResultsArray)>::ArgumentType<1>>); 141 jit.loadWasmContextInstance(wasmContextInstanceGPR); 142 } 143 144 if (rep.isReg()) 145 jit.load64(CCallHelpers::Address(CCallHelpers::stackPointerRegister, savedResultRegisters.find(rep.reg())->offset() + wasmFrameConvention.headerAndArgumentStackSizeInBytes), GPRInfo::argumentGPR0); 146 else { 147 auto location = CCallHelpers::Address(CCallHelpers::stackPointerRegister, rep.offsetFromSP()); 148 jit.load64ToReg(location, GPRInfo::argumentGPR0); 149 } 150 jit.setupArguments<decltype(operationConvertToBigInt)>(wasmContextInstanceGPR, GPRInfo::argumentGPR0); 151 jit.callOperation(FunctionPtr<OperationPtrTag>(operationConvertToBigInt)); 152 if (rep.isReg()) 153 jit.storeValue(JSValueRegs { GPRInfo::returnValueGPR }, CCallHelpers::Address(CCallHelpers::stackPointerRegister, savedResultRegisters.find(rep.reg())->offset() + wasmFrameConvention.headerAndArgumentStackSizeInBytes)); 154 else { 155 auto location = CCallHelpers::Address(CCallHelpers::stackPointerRegister, rep.offsetFromSP()); 156 jit.storeValue(JSValueRegs { GPRInfo::returnValueGPR }, location); 157 } 158 } 159 } 160 111 161 GPRReg wasmContextInstanceGPR = PinnedRegisterInfo::get().wasmContextInstancePointer; 112 162 if (Context::useFastTLS()) { … … 165 215 ptrdiff_t offset = regAtOffset.offset(); 166 216 jit.storePtr(reg, CCallHelpers::Address(GPRInfo::callFrameRegister, offset)); 167 }168 169 if (wasmFrameConvention.argumentsIncludeI64 || wasmFrameConvention.resultsIncludeI64) {170 if (Context::useFastTLS())171 jit.loadWasmContextInstance(GPRInfo::argumentGPR2);172 else {173 // vmEntryToWasm passes the JSWebAssemblyInstance corresponding to Wasm::Context*'s174 // instance as the first JS argument when we're not using fast TLS to hold the175 // Wasm::Context*'s instance.176 jit.loadPtr(CCallHelpers::Address(GPRInfo::callFrameRegister, CallFrameSlot::thisArgument * sizeof(EncodedJSValue)), GPRInfo::argumentGPR2);177 jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR2, JSWebAssemblyInstance::offsetOfInstance()), GPRInfo::argumentGPR2);178 }179 180 emitThrowWasmToJSException(jit, GPRInfo::argumentGPR2, wasmFrameConvention.argumentsIncludeI64 ? ExceptionType::I64ArgumentType : ExceptionType::I64ReturnType);181 return result;182 217 } 183 218 -
trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp
r269552 r271168 52 52 } 53 53 54 static Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> handleBadI64Use(VM& vm, JIT& jit, unsigned importIndex)55 {56 jit.copyCalleeSavesToEntryFrameCalleeSavesBuffer(vm.topEntryFrame);57 jit.loadWasmContextInstance(GPRInfo::argumentGPR0);58 59 // Store Callee.60 jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, Instance::offsetOfOwner()), GPRInfo::argumentGPR0);61 jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, JSWebAssemblyInstance::offsetOfModule()), GPRInfo::argumentGPR1);62 jit.prepareCallOperation(vm);63 jit.storePtr(GPRInfo::argumentGPR1, JIT::Address(GPRInfo::callFrameRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register))));64 65 auto call = jit.call(OperationPtrTag);66 jit.jumpToExceptionHandler(vm);67 68 LinkBuffer linkBuffer(jit, GLOBAL_THUNK_ID, JITCompilationCanFail);69 if (UNLIKELY(linkBuffer.didFailToAllocate()))70 return makeUnexpected(BindingFailure::OutOfMemory);71 72 linkBuffer.link(call, FunctionPtr<OperationPtrTag>(operationWasmThrowBadI64));73 return FINALIZE_WASM_CODE(linkBuffer, WasmEntryPtrTag, "WebAssembly->JavaScript invalid i64 use in import[%i]", importIndex);74 }75 76 54 Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM& vm, Bag<CallLinkInfo>& callLinkInfos, SignatureIndex signatureIndex, unsigned importIndex) 77 55 { … … 96 74 jit.emitFunctionPrologue(); 97 75 jit.store64(JIT::TrustedImm32(0), JIT::Address(GPRInfo::callFrameRegister, CallFrameSlot::codeBlock * static_cast<int>(sizeof(Register)))); // FIXME Stop using 0 as codeBlocks. https://bugs.webkit.org/show_bug.cgi?id=165321 98 99 if (wasmCallInfo.argumentsIncludeI64 || wasmCallInfo.resultsIncludeI64)100 return handleBadI64Use(vm, jit, importIndex);101 76 102 77 // Here we assume that the JS calling convention saves at least all the wasm callee saved. We therefore don't need to save and restore more registers since the wasm callee already took care of this. … … 130 105 case Void: 131 106 case Func: 132 case I64:133 107 RELEASE_ASSERT_NOT_REACHED(); // Handled above. 134 108 case Externref: 135 109 case Funcref: 136 case I32: { 110 case I32: 111 case I64: { 137 112 GPRReg gprReg; 138 113 if (marshalledGPRs < wasmCC.gprArgs.size()) … … 202 177 case Void: 203 178 case Func: 204 case I64:205 179 RELEASE_ASSERT_NOT_REACHED(); // Handled above. 206 180 case Externref: 207 181 case Funcref: 208 182 case I32: 183 case I64: { 209 184 // Skipped: handled above. 210 185 if (marshalledGPRs >= wasmCC.gprArgs.size()) … … 213 188 calleeFrameOffset += sizeof(Register); 214 189 break; 190 } 215 191 case F32: { 216 192 FPRReg fprReg; … … 241 217 } 242 218 } 219 } 220 } 221 222 CCallHelpers::JumpList exceptionChecks; 223 224 if (wasmCallInfo.argumentsIncludeI64) { 225 // Since all argument GPRs and FPRs are stored into stack frames, clobbering caller-save registers is OK here. 226 // We call functions to convert I64 to BigInt. 227 unsigned calleeFrameOffset = CallFrameSlot::firstArgument * static_cast<int>(sizeof(Register)); 228 for (unsigned argNum = 0; argNum < argCount; ++argNum) { 229 if (signature.argument(argNum) == I64) { 230 jit.loadWasmContextInstance(GPRInfo::argumentGPR0); 231 jit.load64(calleeFrame.withOffset(calleeFrameOffset), GPRInfo::argumentGPR1); 232 jit.setupArguments<decltype(operationConvertToBigInt)>(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1); 233 auto call = jit.call(OperationPtrTag); 234 exceptionChecks.append(jit.emitJumpIfException(vm)); 235 jit.store64(GPRInfo::returnValueGPR, calleeFrame.withOffset(calleeFrameOffset)); 236 jit.addLinkTask([=] (LinkBuffer& linkBuffer) { 237 linkBuffer.link(call, FunctionPtr<OperationPtrTag>(operationConvertToBigInt)); 238 }); 239 } 240 calleeFrameOffset += sizeof(Register); 243 241 } 244 242 } … … 276 274 done.link(&jit); 277 275 278 CCallHelpers::JumpList exceptionChecks;279 280 276 if (signature.returnCount() == 1) { 281 277 switch (signature.returnType(0)) { … … 286 282 break; 287 283 case I64: { 288 RELEASE_ASSERT_NOT_REACHED(); // Handled above. 284 // FIXME: Optimize I64 extraction from BigInt. 285 // https://bugs.webkit.org/show_bug.cgi?id=220053 286 GPRReg dest = wasmCallInfo.results[0].gpr(); 287 jit.setupArguments<decltype(operationConvertToI64)>(GPRInfo::returnValueGPR); 288 auto call = jit.call(OperationPtrTag); 289 exceptionChecks.append(jit.emitJumpIfException(vm)); 290 jit.move(GPRInfo::returnValueGPR, dest); 291 292 jit.addLinkTask([=] (LinkBuffer& linkBuffer) { 293 linkBuffer.link(call, FunctionPtr<OperationPtrTag>(operationConvertToI64)); 294 }); 295 break; 289 296 } 290 297 case I32: { -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
r270686 r271168 92 92 break; 93 93 case Wasm::I64: 94 arg = JSValue ();94 arg = JSValue::decode(bitwise_cast<uint64_t>(arg.toBigInt64(globalObject))); 95 95 break; 96 96 case Wasm::F32: … … 215 215 totalFrameSize += savedResultRegisters.size() * sizeof(CPURegister); 216 216 217 if (wasmCallInfo.argumentsIncludeI64 || wasmCallInfo.resultsIncludeI64) 217 // FIXME: Optimize Wasm function call even if arguments include I64. 218 // This requires I64 extraction from BigInt. 219 // https://bugs.webkit.org/show_bug.cgi?id=220053 220 if (wasmCallInfo.argumentsIncludeI64) 218 221 return nullptr; 219 222 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyGlobalConstructor.cpp
r271115 r271168 109 109 } 110 110 case Wasm::Type::I64: { 111 return JSValue::encode(throwException(globalObject, throwScope, createTypeError(globalObject, "WebAssembly.Global does not accept i64 initial value"_s))); 111 int64_t value = argument.toBigInt64(globalObject); 112 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 113 initialValue = static_cast<uint64_t>(value); 114 break; 112 115 } 113 116 case Wasm::Type::F32: { -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyGlobalPrototype.cpp
r267594 r271168 74 74 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 75 75 76 switch (global->global()->type()) { 77 case Wasm::Type::I64: 78 return JSValue::encode(throwException(globalObject, throwScope, createTypeError(globalObject, "WebAssembly.Global.prototype.valueOf does not work with i64 type"_s))); 79 default: 80 return JSValue::encode(global->global()->get()); 81 } 76 RELEASE_AND_RETURN(throwScope, JSValue::encode(global->global()->get(globalObject))); 82 77 } 83 78 … … 90 85 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 91 86 92 switch (global->global()->type()) { 93 case Wasm::Type::I64: 94 return JSValue::encode(throwException(globalObject, throwScope, createTypeError(globalObject, "WebAssembly.Global.prototype.value does not work with i64 type"_s))); 95 default: 96 return JSValue::encode(global->global()->get()); 97 } 87 RELEASE_AND_RETURN(throwScope, JSValue::encode(global->global()->get(globalObject))); 98 88 } 99 89 … … 112 102 return JSValue::encode(throwException(globalObject, throwScope, createTypeError(globalObject, "WebAssembly.Global.prototype.value attempts to modify immutable global value"_s))); 113 103 114 switch (global->global()->type()) { 115 case Wasm::Type::I64: 116 return JSValue::encode(throwException(globalObject, throwScope, createTypeError(globalObject, "WebAssembly.Global.prototype.value does not work with i64 type"_s))); 117 default: 118 global->global()->set(globalObject, callFrame->argument(0)); 119 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 120 return JSValue::encode(jsUndefined()); 121 } 104 global->global()->set(globalObject, callFrame->argument(0)); 105 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 106 return JSValue::encode(jsUndefined()); 122 107 } 123 108 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
r271112 r271168 239 239 switch (moduleInformation.globals[import.kindIndex].type) { 240 240 case Wasm::Funcref: 241 value = globalValue->global()->get(); 241 value = globalValue->global()->get(globalObject); 242 RETURN_IF_EXCEPTION(scope, void()); 242 243 if (!isWebAssemblyHostFunction(vm, value) && !value.isNull()) 243 244 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "imported global", "must be a wasm exported function or null"))); … … 245 246 break; 246 247 case Wasm::Externref: 247 value = globalValue->global()->get(); 248 value = globalValue->global()->get(globalObject); 249 RETURN_IF_EXCEPTION(scope, void()); 248 250 m_instance->instance().setGlobal(import.kindIndex, value); 249 251 break; … … 259 261 } else { 260 262 const auto globalType = moduleInformation.globals[import.kindIndex].type; 261 // ii. If the global_type of i is i64 or Type(v) is not Number, throw a WebAssembly.LinkError. 262 if (globalType == Wasm::I64) 263 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "imported global", "cannot be an i64"))); 264 if (!isRefType(globalType) && !value.isNumber()) 265 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "imported global", "must be a number"))); 263 if (!isRefType(globalType)) { 264 // ii. If the global_type of i is i64 or Type(v) is Number, throw a WebAssembly.LinkError. 265 if (globalType == Wasm::I64) { 266 if (!value.isBigInt()) 267 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "imported global", "must be a BigInt"))); 268 } else { 269 if (!value.isNumber()) 270 return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "imported global", "must be a number"))); 271 } 272 } 266 273 267 274 // iii. Append ToWebAssemblyValue(v) to imports. 268 switch ( moduleInformation.globals[import.kindIndex].type) {275 switch (globalType) { 269 276 case Wasm::Funcref: 270 277 if (!isWebAssemblyHostFunction(vm, value) && !value.isNull()) … … 278 285 m_instance->instance().setGlobal(import.kindIndex, value.toInt32(globalObject)); 279 286 break; 287 case Wasm::I64: { 288 int64_t bits = value.toBigInt64(globalObject); 289 RETURN_IF_EXCEPTION(scope, void()); 290 m_instance->instance().setGlobal(import.kindIndex, bits); 291 break; 292 } 280 293 case Wasm::F32: 281 294 m_instance->instance().setGlobal(import.kindIndex, bitwise_cast<uint32_t>(value.toFloat(globalObject)));
Note: See TracChangeset
for help on using the changeset viewer.