Release pointer lock when page state is reset for any reason, not just for process...
[WebKit-https.git] / JSTests / ChangeLog
1 2017-01-04  Saam Barati  <sbarati@apple.com>
2
3         We don't properly handle exceptions inside the nativeCallTrampoline macro in the LLInt
4         https://bugs.webkit.org/show_bug.cgi?id=163720
5
6         Reviewed by Mark Lam.
7
8         * stress/bound-function-tail-call-with-exception.js: Added.
9         (bar):
10         (foo):
11         (catch):
12
13 2017-01-03  JF Bastien  <jfbastien@apple.com>
14
15         WebAssembly JS API: check and test in-call / out-call values
16         https://bugs.webkit.org/show_bug.cgi?id=164876
17         <rdar://problem/29844107>
18
19         Reviewed by Saam Barati.
20
21         * wasm.yaml:
22         * wasm/assert.js: add an assert for NaN comparison
23         * wasm/fuzz/export-function.js: Added. Generate random wasm export
24         signatures, and call them with random parameters.
25         (const.paramExporter):
26         (const.setBuffer):
27         (const.types.generate):
28         (generate):
29         * wasm/js-api/export-arity.js: Added.
30         (const.paramExporter): Test that mismatched arities when JS calls
31         wasm follow the defined semantics: i32 is 0, f32 / f64 are NaN.
32         https://github.com/WebAssembly/design/blob/master/JS.md#exported-function-exotic-objects
33         * wasm/js-api/export-void-is-undef.js: Added. Test that "void"
34         wasm functions return "undefined" in JS.
35
36 2017-01-02  JF Bastien  <jfbastien@apple.com>
37
38         WebAssembly: handle and optimize wasm export → wasm import calls
39         https://bugs.webkit.org/show_bug.cgi?id=165282
40
41         Reviewed by Saam Barati.
42
43         * wasm/Builder.js: Add a Proxy to Builder.js, which intercepts
44         unknown property lookups. This creates way better error messages
45         on typos than 'undefined is not a function', which happens
46         semi-frequently as I typo opcode names (and which one is a typo is
47         hard to find because we chain builders).
48         (const._isValidValue):
49         (get target):
50         (const._importFunctionContinuation):
51         (const._importMemoryContinuation):
52         (const._importTableContinuation):
53         (const._exportFunctionContinuation):
54         (export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
55         (export.default.Builder.prototype._registerSectionBuilders.this.Unknown):
56         * wasm/LowLevelBinary.js: Add limited support for var{u}int64 (only the 32-bit values)
57         (export.default.LowLevelBinary.prototype.varint32):
58         (export.default.LowLevelBinary.prototype.varuint64):
59         (export.default.LowLevelBinary.prototype.varint64):
60         * wasm/function-tests/exceptions.js: update error message
61         * wasm/function-tests/trap-load.js: update error message
62         * wasm/function-tests/trap-store.js: update error message
63         * wasm/js-api/wasm-to-wasm-bad-signature.js: Added. Test a bunch of bad wasm->wasm import signatures
64         (const.makeImportee.signature.switch):
65         (BadSignatureDropStartParams):
66         * wasm/js-api/wasm-to-wasm.js: Added. Test 64-bit wasm->wasm import calls
67         (const.callerModule):
68         (const.calleeModule):
69         (WasmToWasm):
70
71 2017-01-02  Saam Barati  <sbarati@apple.com>
72
73         WebAssembly: Some loads don't take into account the offset
74         https://bugs.webkit.org/show_bug.cgi?id=166616
75         <rdar://problem/29841541>
76
77         Reviewed by Keith Miller.
78
79         * wasm/function-tests/load-offset.js: Added.
80
81 2016-12-29  Saam Barati  <sbarati@apple.com>
82
83         WebAssembly: Rebase spec-tests now that wabt has been updated to produce certain kinds of invalid modules
84         https://bugs.webkit.org/show_bug.cgi?id=166491
85         <rdar://problem/29814999>
86
87         Reviewed by Yusuke Suzuki.
88
89         Based off these revisions:
90         - spec: b055d01ea1dfdd7a5231ae779095435f836de97f
91         - wabt: d0d44702c753f851b094615298a2f4d4e3c21035
92
93         The reason for the rebase is that wabt was updated to stop
94         silently rejecting invalid modules. This was needed because
95         some of the spec tests check to make sure that the module
96         is invalid, but wabt was silently ignoring the errors and
97         generating valid modules:
98         https://github.com/WebAssembly/wabt/issues/256
99
100         * wasm.yaml:
101         * wasm/spec-tests/address.wast.js:
102         * wasm/spec-tests/binary.wast.js:
103         * wasm/spec-tests/block.wast.js:
104         * wasm/spec-tests/br.wast.js:
105         * wasm/spec-tests/br_if.wast.js:
106         * wasm/spec-tests/br_table.wast.js:
107         * wasm/spec-tests/break-drop.wast.js:
108         * wasm/spec-tests/call.wast.js:
109         * wasm/spec-tests/call_indirect.wast.js:
110         * wasm/spec-tests/comments.wast.js:
111         * wasm/spec-tests/conversions.wast.js:
112         * wasm/spec-tests/custom_section.wast.js:
113         * wasm/spec-tests/endianness.wast.js:
114         * wasm/spec-tests/exports.wast.js:
115         * wasm/spec-tests/f32.wast.js:
116         * wasm/spec-tests/f32_cmp.wast.js:
117         * wasm/spec-tests/f64.wast.js:
118         * wasm/spec-tests/f64_cmp.wast.js:
119         * wasm/spec-tests/fac.wast.js:
120         * wasm/spec-tests/float_exprs.wast.js:
121         * wasm/spec-tests/float_literals.wast.js:
122         * wasm/spec-tests/float_memory.wast.js:
123         * wasm/spec-tests/float_misc.wast.js:
124         * wasm/spec-tests/forward.wast.js:
125         * wasm/spec-tests/func.wast.js:
126         * wasm/spec-tests/func_ptrs.wast.js:
127         * wasm/spec-tests/get_local.wast.js:
128         * wasm/spec-tests/globals.wast.js:
129         * wasm/spec-tests/i32.wast.js:
130         * wasm/spec-tests/i64.wast.js:
131         * wasm/spec-tests/imports.wast.js:
132         * wasm/spec-tests/int_exprs.wast.js:
133         * wasm/spec-tests/int_literals.wast.js:
134         * wasm/spec-tests/left-to-right.wast.js:
135         * wasm/spec-tests/linking.wast.js:
136         * wasm/spec-tests/loop.wast.js:
137         * wasm/spec-tests/memory.wast.js:
138         * wasm/spec-tests/memory_redundancy.wast.js:
139         * wasm/spec-tests/memory_trap.wast.js:
140         * wasm/spec-tests/names.wast.js:
141         * wasm/spec-tests/nop.wast.js:
142         * wasm/spec-tests/resizing.wast.js:
143         * wasm/spec-tests/return.wast.js:
144         * wasm/spec-tests/select.wast.js:
145         * wasm/spec-tests/set_local.wast.js:
146         * wasm/spec-tests/skip-stack-guard-page.wast.js:
147         * wasm/spec-tests/stack.wast.js:
148         * wasm/spec-tests/start.wast.js:
149         * wasm/spec-tests/store_retval.wast.js:
150         * wasm/spec-tests/switch.wast.js:
151         * wasm/spec-tests/tee_local.wast.js:
152         * wasm/spec-tests/traps.wast.js:
153         * wasm/spec-tests/typecheck.wast.js:
154         * wasm/spec-tests/unreachable.wast.js:
155         * wasm/spec-tests/unwind.wast.js:
156
157 2016-12-28  Saam Barati  <sbarati@apple.com>
158
159         WebAssembly: Don't allow duplicate export names
160         https://bugs.webkit.org/show_bug.cgi?id=166490
161         <rdar://problem/29815000>
162
163         Reviewed by Keith Miller.
164
165         * wasm.yaml:
166         * wasm/function-tests/invalid-duplicate-export.js: Added.
167
168 2016-12-28  Saam Barati  <sbarati@apple.com>
169
170         WebAssembly: Implement grow_memory and current_memory
171         https://bugs.webkit.org/show_bug.cgi?id=166448
172         <rdar://problem/29803676>
173
174         Reviewed by Keith Miller.
175
176         I rewrote some of the testWasmModuleFunctions that used Memory to use
177         the JS API since the jsc.cpp version can no longer use memory.
178
179         * wasm.yaml:
180         * wasm/function-tests/add-12.js:
181         (testWasmModuleFunctions):
182         * wasm/function-tests/br-if-loop-less-than.js:
183         (testWasmModuleFunctions):
184         * wasm/function-tests/brTableAsIf.js:
185         (testWasmModuleFunctions):
186         * wasm/function-tests/brTableManyValues.js:
187         (testWasmModuleFunctions):
188         * wasm/function-tests/brTableWithLoop.js:
189         (testWasmModuleFunctions):
190         * wasm/function-tests/dumb-eq-if-then-else.js:
191         * wasm/function-tests/eqz.js:
192         * wasm/function-tests/grow-memory-2.js: Added.
193         (const.func):
194         (assert.eq.instance.exports.foo):
195         * wasm/function-tests/grow-memory-3.js: Added.
196         * wasm/function-tests/grow-memory-4.js: Added.
197         (const.func):
198         * wasm/function-tests/grow-memory.js: Added.
199         (binaryShouldNotParse):
200         (assert.truthy):
201         (assert.eq):
202         (memory.grow):
203         * wasm/function-tests/i32-load.js:
204         (testWasmModuleFunctions):
205         * wasm/function-tests/i32-load8-s.js:
206         * wasm/function-tests/max.js:
207         * wasm/function-tests/min.js:
208         * wasm/js-api/memory-grow.js: Added.
209         (i.i):
210         (assertEq):
211         * wasm/js-api/test_memory.js:
212         * wasm/wasm.json:
213
214 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
215
216         Propagate the source origin as much as possible
217         https://bugs.webkit.org/show_bug.cgi?id=166348
218
219         Reviewed by Darin Adler.
220
221         * stress/source-origin.js: Added.
222         (shouldBe):
223
224 2016-12-24  Caio Lima  <ticaiolima@gmail.com>
225
226         [test262] Fixing mapped arguments object property test case
227         https://bugs.webkit.org/show_bug.cgi?id=159398
228
229         Reviewed by Saam Barati.
230
231         * stress/arguments-bizarre-behaviour-disable-enumerability.js:
232         * stress/arguments-define-property.js: Added.
233         (assert):
234         (testProperties):
235         * stress/arguments-non-configurable.js: Added.
236         (assert):
237         (tryChangeNonConfigurableDescriptor):
238         (set tryChangeNonConfigurableDescriptor):
239         (tryChangeWritableOfNonConfigurableDescriptor):
240         * test262.yaml:
241
242 016-12-20  Caio Lima  <ticaiolima@gmail.com>
243
244         [test262] Fixing mapped arguments object property test case
245         https://bugs.webkit.org/show_bug.cgi?id=159398
246
247         Reviewed by .
248
249         * stress/arguments-bizarre-behaviour-disable-enumerability.js:
250         * stress/arguments-define-property.js: Added.
251         (assert):
252         (testProperties):
253         * stress/arguments-non-configurable.js: Added.
254         (assert):
255         (tryChangeNonConfigurableDescriptor):
256         (set tryChangeNonConfigurableDescriptor):
257         (tryChangeWritableOfNonConfigurableDescriptor):
258         * test262.yaml:
259
260 2016-12-23  Keith Miller  <keith_miller@apple.com>
261
262         WebAssembly: trap on bad division.
263         https://bugs.webkit.org/show_bug.cgi?id=164786
264
265         Reviewed by Mark Lam.
266
267         Also, mark conversions as passing.
268
269         * wasm.yaml:
270         * wasm/wasm.json:
271
272 2016-12-22  Keith Miller  <keith_miller@apple.com>
273
274         WebAssembly: Make spec-tests/f32.wast.js and spec-tests/f64.wast.js pass
275         https://bugs.webkit.org/show_bug.cgi?id=166447
276
277         Reviewed by Saam Barati.
278
279         * wasm.yaml:
280         * wasm/wasm.json:
281
282 2016-12-22  Saam Barati  <sbarati@apple.com>
283
284         WebAssembly: Make calling Wasm functions that returns or takes an i64 as a parameter an early exception
285         https://bugs.webkit.org/show_bug.cgi?id=166437
286         <rdar://problem/29793949>
287
288         Reviewed by Keith Miller.
289
290         * wasm.yaml:
291         * wasm/function-tests/i64-from-js-exceptions.js: Added.
292         (const.imp.import.sideEffects):
293         (assert.throws.instance.exports.foo.valueOf):
294
295 2016-12-22  Mark Lam  <mark.lam@apple.com>
296
297         De-duplicate finally blocks.
298         https://bugs.webkit.org/show_bug.cgi?id=160168
299
300         Reviewed by Saam Barati.
301
302         Re-landing r209952 with a few new tests added in test-finally.js.
303
304         * stress/deeply-nested-finallys.js: Copied from JSTests/stress/deeply-nested-finallys.js.
305         - Tests many levels of finally nesting.  This causes the old code to hang (and
306           crashes eventually) while trying to generate bytecode for the exponentially
307           duplicated finally blocks.  The new code completes this test almost instantly.
308
309         * stress/test-finally.js: Copied from JSTests/stress/test-finally.js.
310         - Tests control flow through various permutations of finally blocks.
311
312 2016-12-22  Saam Barati  <sbarati@apple.com>
313
314         WebAssembly: Make the spec-tests/address.wast.js test pass
315         https://bugs.webkit.org/show_bug.cgi?id=166429
316         <rdar://problem/29793220>
317
318         Reviewed by Keith Miller.
319
320         * wasm.yaml:
321
322 2016-12-22  Keith Miller  <keith_miller@apple.com>
323
324         WebAssembly: The validator should not allow unused stack entries at the end of a block
325         https://bugs.webkit.org/show_bug.cgi?id=166411
326
327         Reviewed by Saam Barati.
328
329         Test cleanup and enable new passing tests.
330
331         * wasm.yaml:
332         * wasm/function-tests/br-if-as-return.js:
333
334 2016-12-22  Saam Barati  <sbarati@apple.com>
335
336         WebAssembly: Make the spec-tests/start.wast.js test pass
337         https://bugs.webkit.org/show_bug.cgi?id=166416
338         <rdar://problem/29784532>
339
340         Reviewed by Yusuke Suzuki.
341
342         * wasm.yaml:
343
344 2016-12-21  Keith Miller  <keith_miller@apple.com>
345
346         WebAssembly: Fix decode floating point constants in unreachable code
347         https://bugs.webkit.org/show_bug.cgi?id=166400
348
349         Reviewed by Saam Barati.
350
351         * wasm.yaml:
352
353 2016-12-21  Keith Miller  <keith_miller@apple.com>
354
355         WebAssembly: Allow br, br_if, and br_table to act as a return
356         https://bugs.webkit.org/show_bug.cgi?id=166393
357
358         Reviewed by Saam Barati.
359
360         Add tests for breaks acting as returns and fix tests that
361         validate error messages.
362
363         * wasm/function-tests/br-as-return.js: Added.
364         * wasm/function-tests/br-if-as-return.js: Added.
365         * wasm/function-tests/br-table-as-return.js: Added.
366         * wasm/function-tests/if-no-else-non-void.js:
367         * wasm/function-tests/struct.js: Added.
368         * wasm/js-api/global-error.js:
369         (assert.throws):
370         * wasm/js-api/table.js:
371         (assert.throws):
372
373 2016-12-21  Saam Barati  <sbarati@apple.com>
374
375         WebAssembly: Import spec tests
376         https://bugs.webkit.org/show_bug.cgi?id=166395
377
378         Rubber stamped by Keith Miller.
379
380         This patch implements the Wasm spec's tests found here:
381         https://github.com/WebAssembly/spec/tree/master/interpreter/test
382         
383         These tests are in .wast s-epxression format. To convert
384         them to JS, I use a script from the wabt library, found here:
385         https://github.com/WebAssembly/wabt/blob/master/test/run-gen-spec-js.py
386         
387         I also added a script that automatically imports the tests as
388         JS files. The inputs to the script is the path to the Wasm spec
389         git repo and the path to the wabt git repo. This will make importing
390         new tests easy in the future.
391
392         The wasm spec imported is at commit: b055d01ea1dfdd7a5231ae779095435f836de97f
393         The wabt used to do the import is at commit: 622b42dced6d793e9d49e9b1fd1d1524defd1387
394
395         * wasm.yaml:
396         * wasm/import-spec-tests.rb: Added.
397         * wasm/spec-tests: Added.
398         * wasm/spec-tests/address.wast.js: Added.
399         (register):
400         (module):
401         (instance):
402         (assert_malformed):
403         (assert_invalid):
404         (assert_soft_invalid):
405         (assert_unlinkable):
406         (assert_uninstantiable):
407         (assert_trap):
408         (assert_return):
409         (assert_return_nan):
410         * wasm/spec-tests/binary.wast.js: Added.
411         (register):
412         (module):
413         (instance):
414         (assert_malformed):
415         (assert_invalid):
416         (assert_soft_invalid):
417         (assert_unlinkable):
418         (assert_uninstantiable):
419         (assert_trap):
420         (assert_return):
421         (assert_return_nan):
422         * wasm/spec-tests/block.wast.js: Added.
423         (register):
424         (module):
425         (instance):
426         (assert_malformed):
427         (assert_invalid):
428         (assert_soft_invalid):
429         (assert_unlinkable):
430         (assert_uninstantiable):
431         (assert_trap):
432         (assert_return):
433         (assert_return_nan):
434         * wasm/spec-tests/br.wast.js: Added.
435         (register):
436         (module):
437         (instance):
438         (assert_malformed):
439         (assert_invalid):
440         (assert_soft_invalid):
441         (assert_unlinkable):
442         (assert_uninstantiable):
443         (assert_trap):
444         (assert_return):
445         (assert_return_nan):
446         * wasm/spec-tests/br_if.wast.js: Added.
447         (register):
448         (module):
449         (instance):
450         (assert_malformed):
451         (assert_invalid):
452         (assert_soft_invalid):
453         (assert_unlinkable):
454         (assert_uninstantiable):
455         (assert_trap):
456         (assert_return):
457         (assert_return_nan):
458         * wasm/spec-tests/br_table.wast.js: Added.
459         (register):
460         (module):
461         (instance):
462         (assert_malformed):
463         (assert_invalid):
464         (assert_soft_invalid):
465         (assert_unlinkable):
466         (assert_uninstantiable):
467         (assert_trap):
468         (assert_return):
469         (assert_return_nan):
470         * wasm/spec-tests/break-drop.wast.js: Added.
471         (register):
472         (module):
473         (instance):
474         (assert_malformed):
475         (assert_invalid):
476         (assert_soft_invalid):
477         (assert_unlinkable):
478         (assert_uninstantiable):
479         (assert_trap):
480         (assert_return):
481         (assert_return_nan):
482         * wasm/spec-tests/call.wast.js: Added.
483         (register):
484         (module):
485         (instance):
486         (assert_malformed):
487         (assert_invalid):
488         (assert_soft_invalid):
489         (assert_unlinkable):
490         (assert_uninstantiable):
491         (assert_trap):
492         (assert_return):
493         (assert_return_nan):
494         * wasm/spec-tests/call_indirect.wast.js: Added.
495         (register):
496         (module):
497         (instance):
498         (assert_malformed):
499         (assert_invalid):
500         (assert_soft_invalid):
501         (assert_unlinkable):
502         (assert_uninstantiable):
503         (assert_trap):
504         (assert_return):
505         (assert_return_nan):
506         * wasm/spec-tests/comments.wast.js: Added.
507         (register):
508         (module):
509         (instance):
510         (assert_malformed):
511         (assert_invalid):
512         (assert_soft_invalid):
513         (assert_unlinkable):
514         (assert_uninstantiable):
515         (assert_trap):
516         (assert_return):
517         (assert_return_nan):
518         * wasm/spec-tests/conversions.wast.js: Added.
519         (register):
520         (module):
521         (instance):
522         (assert_malformed):
523         (assert_invalid):
524         (assert_soft_invalid):
525         (assert_unlinkable):
526         (assert_uninstantiable):
527         (assert_trap):
528         (assert_return):
529         (assert_return_nan):
530         * wasm/spec-tests/custom_section.wast.js: Added.
531         (register):
532         (module):
533         (instance):
534         (assert_malformed):
535         (assert_invalid):
536         (assert_soft_invalid):
537         (assert_unlinkable):
538         (assert_uninstantiable):
539         (assert_trap):
540         (assert_return):
541         (assert_return_nan):
542         * wasm/spec-tests/endianness.wast.js: Added.
543         (register):
544         (module):
545         (instance):
546         (assert_malformed):
547         (assert_invalid):
548         (assert_soft_invalid):
549         (assert_unlinkable):
550         (assert_uninstantiable):
551         (assert_trap):
552         (assert_return):
553         (assert_return_nan):
554         * wasm/spec-tests/exports.wast.js: Added.
555         (register):
556         (module):
557         (instance):
558         (assert_malformed):
559         (assert_invalid):
560         (assert_soft_invalid):
561         (assert_unlinkable):
562         (assert_uninstantiable):
563         (assert_trap):
564         (assert_return):
565         (assert_return_nan):
566         * wasm/spec-tests/f32.wast.js: Added.
567         (register):
568         (module):
569         (instance):
570         (assert_malformed):
571         (assert_invalid):
572         (assert_soft_invalid):
573         (assert_unlinkable):
574         (assert_uninstantiable):
575         (assert_trap):
576         (assert_return):
577         (assert_return_nan):
578         * wasm/spec-tests/f32_cmp.wast.js: Added.
579         (register):
580         (module):
581         (instance):
582         (assert_malformed):
583         (assert_invalid):
584         (assert_soft_invalid):
585         (assert_unlinkable):
586         (assert_uninstantiable):
587         (assert_trap):
588         (assert_return):
589         (assert_return_nan):
590         * wasm/spec-tests/f64.wast.js: Added.
591         (register):
592         (module):
593         (instance):
594         (assert_malformed):
595         (assert_invalid):
596         (assert_soft_invalid):
597         (assert_unlinkable):
598         (assert_uninstantiable):
599         (assert_trap):
600         (assert_return):
601         (assert_return_nan):
602         * wasm/spec-tests/f64_cmp.wast.js: Added.
603         (register):
604         (module):
605         (instance):
606         (assert_malformed):
607         (assert_invalid):
608         (assert_soft_invalid):
609         (assert_unlinkable):
610         (assert_uninstantiable):
611         (assert_trap):
612         (assert_return):
613         (assert_return_nan):
614         * wasm/spec-tests/fac.wast.js: Added.
615         (register):
616         (module):
617         (instance):
618         (assert_malformed):
619         (assert_invalid):
620         (assert_soft_invalid):
621         (assert_unlinkable):
622         (assert_uninstantiable):
623         (assert_trap):
624         (assert_return):
625         (assert_return_nan):
626         * wasm/spec-tests/float_exprs.wast.js: Added.
627         (register):
628         (module):
629         (instance):
630         (assert_malformed):
631         (assert_invalid):
632         (assert_soft_invalid):
633         (assert_unlinkable):
634         (assert_uninstantiable):
635         (assert_trap):
636         (assert_return):
637         (assert_return_nan):
638         * wasm/spec-tests/float_literals.wast.js: Added.
639         (register):
640         (module):
641         (instance):
642         (assert_malformed):
643         (assert_invalid):
644         (assert_soft_invalid):
645         (assert_unlinkable):
646         (assert_uninstantiable):
647         (assert_trap):
648         (assert_return):
649         (assert_return_nan):
650         * wasm/spec-tests/float_memory.wast.js: Added.
651         (register):
652         (module):
653         (instance):
654         (assert_malformed):
655         (assert_invalid):
656         (assert_soft_invalid):
657         (assert_unlinkable):
658         (assert_uninstantiable):
659         (assert_trap):
660         (assert_return):
661         (assert_return_nan):
662         * wasm/spec-tests/float_misc.wast.js: Added.
663         (register):
664         (module):
665         (instance):
666         (assert_malformed):
667         (assert_invalid):
668         (assert_soft_invalid):
669         (assert_unlinkable):
670         (assert_uninstantiable):
671         (assert_trap):
672         (assert_return):
673         (assert_return_nan):
674         * wasm/spec-tests/forward.wast.js: Added.
675         (register):
676         (module):
677         (instance):
678         (assert_malformed):
679         (assert_invalid):
680         (assert_soft_invalid):
681         (assert_unlinkable):
682         (assert_uninstantiable):
683         (assert_trap):
684         (assert_return):
685         (assert_return_nan):
686         * wasm/spec-tests/func.wast.js: Added.
687         (register):
688         (module):
689         (instance):
690         (assert_malformed):
691         (assert_invalid):
692         (assert_soft_invalid):
693         (assert_unlinkable):
694         (assert_uninstantiable):
695         (assert_trap):
696         (assert_return):
697         (assert_return_nan):
698         * wasm/spec-tests/func_ptrs.wast.js: Added.
699         (register):
700         (module):
701         (instance):
702         (assert_malformed):
703         (assert_invalid):
704         (assert_soft_invalid):
705         (assert_unlinkable):
706         (assert_uninstantiable):
707         (assert_trap):
708         (assert_return):
709         (assert_return_nan):
710         * wasm/spec-tests/get_local.wast.js: Added.
711         (register):
712         (module):
713         (instance):
714         (assert_malformed):
715         (assert_invalid):
716         (assert_soft_invalid):
717         (assert_unlinkable):
718         (assert_uninstantiable):
719         (assert_trap):
720         (assert_return):
721         (assert_return_nan):
722         * wasm/spec-tests/globals.wast.js: Added.
723         (register):
724         (module):
725         (instance):
726         (assert_malformed):
727         (assert_invalid):
728         (assert_soft_invalid):
729         (assert_unlinkable):
730         (assert_uninstantiable):
731         (assert_trap):
732         (assert_return):
733         (assert_return_nan):
734         * wasm/spec-tests/i32.wast.js: Added.
735         (register):
736         (module):
737         (instance):
738         (assert_malformed):
739         (assert_invalid):
740         (assert_soft_invalid):
741         (assert_unlinkable):
742         (assert_uninstantiable):
743         (assert_trap):
744         (assert_return):
745         (assert_return_nan):
746         * wasm/spec-tests/i64.wast.js: Added.
747         (register):
748         (module):
749         (instance):
750         (assert_malformed):
751         (assert_invalid):
752         (assert_soft_invalid):
753         (assert_unlinkable):
754         (assert_uninstantiable):
755         (assert_trap):
756         (assert_return):
757         (assert_return_nan):
758         * wasm/spec-tests/imports.wast.js: Added.
759         (register):
760         (module):
761         (instance):
762         (assert_malformed):
763         (assert_invalid):
764         (assert_soft_invalid):
765         (assert_unlinkable):
766         (assert_uninstantiable):
767         (assert_trap):
768         (assert_return):
769         (assert_return_nan):
770         * wasm/spec-tests/int_exprs.wast.js: Added.
771         (register):
772         (module):
773         (instance):
774         (assert_malformed):
775         (assert_invalid):
776         (assert_soft_invalid):
777         (assert_unlinkable):
778         (assert_uninstantiable):
779         (assert_trap):
780         (assert_return):
781         (assert_return_nan):
782         * wasm/spec-tests/int_literals.wast.js: Added.
783         (register):
784         (module):
785         (instance):
786         (assert_malformed):
787         (assert_invalid):
788         (assert_soft_invalid):
789         (assert_unlinkable):
790         (assert_uninstantiable):
791         (assert_trap):
792         (assert_return):
793         (assert_return_nan):
794         * wasm/spec-tests/left-to-right.wast.js: Added.
795         (register):
796         (module):
797         (instance):
798         (assert_malformed):
799         (assert_invalid):
800         (assert_soft_invalid):
801         (assert_unlinkable):
802         (assert_uninstantiable):
803         (assert_trap):
804         (assert_return):
805         (assert_return_nan):
806         * wasm/spec-tests/linking.wast.js: Added.
807         (register):
808         (module):
809         (instance):
810         (assert_malformed):
811         (assert_invalid):
812         (assert_soft_invalid):
813         (assert_unlinkable):
814         (assert_uninstantiable):
815         (assert_trap):
816         (assert_return):
817         (assert_return_nan):
818         * wasm/spec-tests/loop.wast.js: Added.
819         (register):
820         (module):
821         (instance):
822         (assert_malformed):
823         (assert_invalid):
824         (assert_soft_invalid):
825         (assert_unlinkable):
826         (assert_uninstantiable):
827         (assert_trap):
828         (assert_return):
829         (assert_return_nan):
830         * wasm/spec-tests/memory.wast.js: Added.
831         (register):
832         (module):
833         (instance):
834         (assert_malformed):
835         (assert_invalid):
836         (assert_soft_invalid):
837         (assert_unlinkable):
838         (assert_uninstantiable):
839         (assert_trap):
840         (assert_return):
841         (assert_return_nan):
842         * wasm/spec-tests/memory_redundancy.wast.js: Added.
843         (register):
844         (module):
845         (instance):
846         (assert_malformed):
847         (assert_invalid):
848         (assert_soft_invalid):
849         (assert_unlinkable):
850         (assert_uninstantiable):
851         (assert_trap):
852         (assert_return):
853         (assert_return_nan):
854         * wasm/spec-tests/memory_trap.wast.js: Added.
855         (register):
856         (module):
857         (instance):
858         (assert_malformed):
859         (assert_invalid):
860         (assert_soft_invalid):
861         (assert_unlinkable):
862         (assert_uninstantiable):
863         (assert_trap):
864         (assert_return):
865         (assert_return_nan):
866         * wasm/spec-tests/names.wast.js: Added.
867         (register):
868         (module):
869         (instance):
870         (assert_malformed):
871         (assert_invalid):
872         (assert_soft_invalid):
873         (assert_unlinkable):
874         (assert_uninstantiable):
875         (assert_trap):
876         (assert_return):
877         (assert_return_nan):
878         * wasm/spec-tests/nop.wast.js: Added.
879         (register):
880         (module):
881         (instance):
882         (assert_malformed):
883         (assert_invalid):
884         (assert_soft_invalid):
885         (assert_unlinkable):
886         (assert_uninstantiable):
887         (assert_trap):
888         (assert_return):
889         (assert_return_nan):
890         * wasm/spec-tests/resizing.wast.js: Added.
891         (register):
892         (module):
893         (instance):
894         (assert_malformed):
895         (assert_invalid):
896         (assert_soft_invalid):
897         (assert_unlinkable):
898         (assert_uninstantiable):
899         (assert_trap):
900         (assert_return):
901         (assert_return_nan):
902         * wasm/spec-tests/return.wast.js: Added.
903         (register):
904         (module):
905         (instance):
906         (assert_malformed):
907         (assert_invalid):
908         (assert_soft_invalid):
909         (assert_unlinkable):
910         (assert_uninstantiable):
911         (assert_trap):
912         (assert_return):
913         (assert_return_nan):
914         * wasm/spec-tests/select.wast.js: Added.
915         (register):
916         (module):
917         (instance):
918         (assert_malformed):
919         (assert_invalid):
920         (assert_soft_invalid):
921         (assert_unlinkable):
922         (assert_uninstantiable):
923         (assert_trap):
924         (assert_return):
925         (assert_return_nan):
926         * wasm/spec-tests/set_local.wast.js: Added.
927         (register):
928         (module):
929         (instance):
930         (assert_malformed):
931         (assert_invalid):
932         (assert_soft_invalid):
933         (assert_unlinkable):
934         (assert_uninstantiable):
935         (assert_trap):
936         (assert_return):
937         (assert_return_nan):
938         * wasm/spec-tests/skip-stack-guard-page.wast.js: Added.
939         (register):
940         (module):
941         (instance):
942         (assert_malformed):
943         (assert_invalid):
944         (assert_soft_invalid):
945         (assert_unlinkable):
946         (assert_uninstantiable):
947         (assert_trap):
948         (assert_return):
949         (assert_return_nan):
950         * wasm/spec-tests/stack.wast.js: Added.
951         (register):
952         (module):
953         (instance):
954         (assert_malformed):
955         (assert_invalid):
956         (assert_soft_invalid):
957         (assert_unlinkable):
958         (assert_uninstantiable):
959         (assert_trap):
960         (assert_return):
961         (assert_return_nan):
962         * wasm/spec-tests/start.wast.js: Added.
963         (register):
964         (module):
965         (instance):
966         (assert_malformed):
967         (assert_invalid):
968         (assert_soft_invalid):
969         (assert_unlinkable):
970         (assert_uninstantiable):
971         (assert_trap):
972         (assert_return):
973         (assert_return_nan):
974         * wasm/spec-tests/store_retval.wast.js: Added.
975         (register):
976         (module):
977         (instance):
978         (assert_malformed):
979         (assert_invalid):
980         (assert_soft_invalid):
981         (assert_unlinkable):
982         (assert_uninstantiable):
983         (assert_trap):
984         (assert_return):
985         (assert_return_nan):
986         * wasm/spec-tests/switch.wast.js: Added.
987         (register):
988         (module):
989         (instance):
990         (assert_malformed):
991         (assert_invalid):
992         (assert_soft_invalid):
993         (assert_unlinkable):
994         (assert_uninstantiable):
995         (assert_trap):
996         (assert_return):
997         (assert_return_nan):
998         * wasm/spec-tests/tee_local.wast.js: Added.
999         (register):
1000         (module):
1001         (instance):
1002         (assert_malformed):
1003         (assert_invalid):
1004         (assert_soft_invalid):
1005         (assert_unlinkable):
1006         (assert_uninstantiable):
1007         (assert_trap):
1008         (assert_return):
1009         (assert_return_nan):
1010         * wasm/spec-tests/traps.wast.js: Added.
1011         (register):
1012         (module):
1013         (instance):
1014         (assert_malformed):
1015         (assert_invalid):
1016         (assert_soft_invalid):
1017         (assert_unlinkable):
1018         (assert_uninstantiable):
1019         (assert_trap):
1020         (assert_return):
1021         (assert_return_nan):
1022         * wasm/spec-tests/typecheck.wast.js: Added.
1023         (register):
1024         (module):
1025         (instance):
1026         (assert_malformed):
1027         (assert_invalid):
1028         (assert_soft_invalid):
1029         (assert_unlinkable):
1030         (assert_uninstantiable):
1031         (assert_trap):
1032         (assert_return):
1033         (assert_return_nan):
1034         * wasm/spec-tests/unreachable.wast.js: Added.
1035         (register):
1036         (module):
1037         (instance):
1038         (assert_malformed):
1039         (assert_invalid):
1040         (assert_soft_invalid):
1041         (assert_unlinkable):
1042         (assert_uninstantiable):
1043         (assert_trap):
1044         (assert_return):
1045         (assert_return_nan):
1046         * wasm/spec-tests/unwind.wast.js: Added.
1047         (register):
1048         (module):
1049         (instance):
1050         (assert_malformed):
1051         (assert_invalid):
1052         (assert_soft_invalid):
1053         (assert_unlinkable):
1054         (assert_uninstantiable):
1055         (assert_trap):
1056         (assert_return):
1057         (assert_return_nan):
1058
1059 2016-12-20  Keith Miller  <keith_miller@apple.com>
1060
1061         Add support for global
1062         https://bugs.webkit.org/show_bug.cgi?id=165171
1063
1064         Reviewed by Filip Pizlo.
1065
1066         * stress/global.js: Added.
1067
1068 2016-12-20  JF Bastien  <jfbastien@apple.com>
1069
1070         WebAssembly API: implement WebAssembly.LinkError
1071         https://bugs.webkit.org/show_bug.cgi?id=165805
1072         <rdar://problem/29747874>
1073
1074         Reviewed by Mark lam.
1075
1076         Update all exception sites which now throw WebAssembly.LinkError.
1077
1078         * wasm/js-api/element-data.js:
1079         * wasm/js-api/element.js:
1080         (assert.throws):
1081         * wasm/js-api/global-error.js:
1082         (new.Number):
1083         * wasm/js-api/table.js:
1084         (assert.throws):
1085         (new.WebAssembly.Table):
1086         * wasm/js-api/test_Data.js:
1087         * wasm/js-api/test_basic_api.js:
1088         (const.c.in.constructorProperties.switch):
1089         * wasm/js-api/test_memory.js:
1090         (test):
1091         (test.testMemImportError): Deleted.
1092
1093 2016-12-20  JF Bastien  <jfbastien@apple.com>
1094
1095         WebAssembly: unique function signatures
1096         https://bugs.webkit.org/show_bug.cgi?id=165957
1097         <rdar://problem/29735737>
1098
1099         Reviewed by Saam Barati.
1100
1101         * wasm/function-tests/table-basic.js: FIXME is now addressed,
1102         though instance to instance calls still need work which bug
1103         #165282 will address
1104         (i.assert.eq.foo):
1105         * wasm/js-api/unique-signature.js: Added.
1106         (CallIndirectWithDuplicateSignatures):
1107
1108 2016-12-19  Mark Lam  <mark.lam@apple.com>
1109
1110         Rolling out r209974 and r209952. They break some websites in mysterious ways. Step 2: Rollout r209952.
1111         https://bugs.webkit.org/show_bug.cgi?id=166049
1112
1113         Not reviewed.
1114
1115         * stress/deeply-nested-finallys.js: Removed.
1116         * stress/test-finally.js: Removed.
1117
1118 2016-12-19  Saam Barati  <sbarati@apple.com>
1119
1120         WebAssembly: Make running Wasm tests take less time by reducing some tests' iteration count and by splitting some tests into different files
1121         https://bugs.webkit.org/show_bug.cgi?id=166017
1122
1123         Reviewed by Yusuke Suzuki.
1124
1125         * wasm/function-tests/trap-load-2.js: Added.
1126         (assert):
1127         (wasmFrameCountFromError):
1128         (continuation):
1129         (i.catch):
1130         * wasm/function-tests/trap-load.js:
1131         (assert.continuation): Deleted.
1132         * wasm/function-tests/trap-store-2.js: Added.
1133         (import.Builder.from.string_appeared_here.assert):
1134         (continuation):
1135         (i.catch):
1136         * wasm/function-tests/trap-store.js:
1137         (assert.continuation): Deleted.
1138         (assert): Deleted.
1139         * wasm/js-api/test_memory.js:
1140         (test):
1141
1142 2016-12-18  Saam Barati  <sbarati@apple.com>
1143
1144         WebAssembly: Implement the WebAssembly.compile and WebAssembly.validate
1145         https://bugs.webkit.org/show_bug.cgi?id=165936
1146
1147         Reviewed by Mark Lam.
1148
1149         * wasm/js-api/Module-compile.js: Added.
1150         (async.testPromiseAPI):
1151         * wasm/js-api/test_basic_api.js:
1152         (const.c.in.constructorProperties.switch):
1153         * wasm/js-api/validate.js: Added.
1154         (assert.truthy.WebAssembly.validate.builder.WebAssembly):
1155
1156 2016-12-16  Mark Lam  <mark.lam@apple.com>
1157
1158         De-duplicate finally blocks.
1159         https://bugs.webkit.org/show_bug.cgi?id=160168
1160
1161         Reviewed by Keith Miller.
1162
1163         * stress/deeply-nested-finallys.js: Added.
1164         - Tests many levels of finally nesting.  This causes the old code to hang (and
1165           crashes eventually) while trying to generate bytecode for the exponentially
1166           duplicated finally blocks.  The new code completes this test almost instantly.
1167
1168         * stress/test-finally.js: Added.
1169         - Tests control flow through various permutations of finally blocks.
1170
1171 2016-12-16  Saam Barati  <sbarati@apple.com>
1172
1173         WebAssembly: WasmB3IRGenerator should throw exceptions instead of crash
1174         https://bugs.webkit.org/show_bug.cgi?id=165834
1175
1176         Reviewed by Keith Miller.
1177
1178         * wasm/function-tests/exceptions.js: Added.
1179         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1180         * wasm/function-tests/table-basic.js:
1181         (i.i.42.throw.new.Error):
1182
1183 2016-12-16  Keith Miller  <keith_miller@apple.com>
1184
1185         i64.eqz should use an Int64 zero
1186         https://bugs.webkit.org/show_bug.cgi?id=165942
1187
1188         Reviewed by Mark Lam.
1189
1190         * wasm/wasm.json:
1191
1192 2016-12-15  Keith Miller  <keith_miller@apple.com>
1193
1194         Fix validation of non-void if blocks with no else
1195         https://bugs.webkit.org/show_bug.cgi?id=165938
1196
1197         Reviewed by Saam Barati.
1198
1199         Add a new failing test and a fix an existing one.
1200
1201         * wasm/function-tests/dead-call.js:
1202         * wasm/function-tests/if-no-else-non-void.js: Added.
1203
1204 2016-12-15  Keith Miller  <keith_miller@apple.com>
1205
1206         Wasm should not create empty unlinked callsites
1207         https://bugs.webkit.org/show_bug.cgi?id=165933
1208
1209         Reviewed by Mark Lam.
1210
1211         * wasm/function-tests/dead-call.js: Added.
1212
1213 2016-12-15  JF Bastien  <jfbastien@apple.com>
1214
1215         WebAssembly: improve compilation error messages
1216         https://bugs.webkit.org/show_bug.cgi?id=163919
1217
1218         Reviewed by Saam Barati.
1219
1220         Update error messages in these tests.
1221         Use the assert.throws facility in many of them which weren't already.
1222
1223         * wasm/js-api/element.js:
1224         (assert.throws.new.WebAssembly.Module.builder.WebAssembly):
1225         (assert.throws):
1226         * wasm/js-api/global-error.js:
1227         (assert.throws.new.WebAssembly.Module.bin):
1228         (assert.throws):
1229         (new.Number):
1230         * wasm/js-api/table.js:
1231         (assert.throws.new.WebAssembly.Module.builder.WebAssembly):
1232         (assert.throws):
1233         (assertBadTableImport):
1234         * wasm/js-api/test_Data.js:
1235         (DataSectionWithoutMemory):
1236         * wasm/js-api/test_Start.js:
1237         (InvalidStartFunctionIndex):
1238         * wasm/js-api/test_basic_api.js:
1239         (const.c.in.constructorProperties.switch):
1240
1241 2016-12-15  JF Bastien  <jfbastien@apple.com>
1242
1243         WebAssembly API: improve data section errors
1244         https://bugs.webkit.org/show_bug.cgi?id=165733
1245
1246         Reviewed by Keith Miller.
1247
1248         * wasm/js-api/element-data.js: Added.
1249         (ElementBeforeData.set const):
1250         (ElementBeforeData): check the order of initialization, which is observable on failure
1251         * wasm/js-api/test_Data.js:
1252         (DataSectionWithoutMemory):
1253         (DataSectionOffTheEnd): Deleted.
1254         (DataSectionPartlyOffTheEnd): Deleted.
1255         (DataSectionEmptyOffTheEnd): Deleted.
1256         (DataSectionSeenByStart): Deleted.
1257
1258 2016-12-15  Keith Miller  <keith_miller@apple.com>
1259
1260         Fix 64-bit shift family Wasm opcodes
1261         https://bugs.webkit.org/show_bug.cgi?id=165902
1262
1263         Reviewed by Geoffrey Garen.
1264
1265         Add tests for shift family of instructions. Since
1266         we can't generate i64 values to pass to wasm we only compile
1267         the code for those functions. Attempting to generate any i64
1268         code using these instructions would have been enough to cause
1269         the B3 Validation error anyway.
1270
1271         * wasm/assert.js:
1272         * wasm/function-tests/rotl.js: Added.
1273         * wasm/function-tests/rotr.js: Added.
1274         * wasm/function-tests/shl.js: Added.
1275         * wasm/function-tests/shr-s.js: Added.
1276         * wasm/function-tests/shr-u.js: Added.
1277         * wasm/wasm.json:
1278
1279 2016-12-14  Keith Miller  <keith_miller@apple.com>
1280
1281         WebAssembly: test_BuilderJSON.js is broken
1282         https://bugs.webkit.org/show_bug.cgi?id=165893
1283
1284         Reviewed by Michael Saboff.
1285
1286         * wasm/Builder.js:
1287         (const._isValidValue):
1288         * wasm/self-test/test_BuilderJSON.js:
1289
1290 2016-12-14  Keith Miller  <keith_miller@apple.com>
1291
1292         Unreviewed, fix test.
1293
1294         * wasm/function-tests/i32-const.js:
1295
1296 2016-12-14  Keith Miller  <keith_miller@apple.com>
1297
1298         Wasm should decode constants correctly
1299         https://bugs.webkit.org/show_bug.cgi?id=165886
1300
1301         Reviewed by Saam Barati.
1302
1303         * wasm/Builder.js:
1304         (const._isValidValue):
1305         * wasm/Builder_WebAssemblyBinary.js:
1306         (const.putOp):
1307         * wasm/LowLevelBinary.js:
1308         (export.default.LowLevelBinary.prototype.float):
1309         (export.default.LowLevelBinary.prototype.double):
1310         * wasm/function-tests/f32-const.js: Added.
1311         * wasm/function-tests/f64-const.js: Added.
1312         * wasm/function-tests/i32-const.js: Added.
1313         * wasm/wasm.json:
1314
1315 2016-12-14  Saam Barati  <sbarati@apple.com>
1316
1317         WebAssembly: Add various low hanging fruit that will allow us to run the LLVM torture tests in Wasm
1318         https://bugs.webkit.org/show_bug.cgi?id=165883
1319
1320         Reviewed by Keith Miller.
1321
1322         * wasm/Builder.js:
1323         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1324         * wasm/Builder_WebAssemblyBinary.js:
1325         (const.emitters.Export):
1326         * wasm/js-api/table.js:
1327         (assertBadBinary):
1328         (assertBadTable):
1329         (assert.truthy):
1330         * wasm/js-api/test_memory.js:
1331         (binaryShouldNotParse):
1332         (test):
1333         (test.testMemImportError):
1334         (assert.truthy):
1335         (assert): Deleted.
1336
1337 2016-12-14  Filip Pizlo  <fpizlo@apple.com>
1338
1339         DirectTailCall implementation needs to tell the shuffler what to put into the ArgumentCount explicitly
1340         https://bugs.webkit.org/show_bug.cgi?id=165882
1341
1342         Reviewed by Mark Lam.
1343
1344         * stress/direct-tail-call-arity-mismatch-count-args.js: Added.
1345         (foo):
1346         (bar):
1347
1348 2016-12-14  Keith Miller  <keith_miller@apple.com>
1349
1350         WebAssembly JS API: implement Global
1351         https://bugs.webkit.org/show_bug.cgi?id=164133
1352
1353         Reviewed by Saam Barati.
1354
1355         * wasm/Builder.js:
1356         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1357         * wasm/Builder_WebAssemblyBinary.js:
1358         (const.valueType.WASM.description.type.i32.type.const.putGlobalType):
1359         (const.putOp):
1360         (const.putInitExpr):
1361         (const.emitters.Import):
1362         (const.emitters.Global):
1363         (const.emitters.Export):
1364         (const.emitters.Code):
1365         * wasm/LowLevelBinary.js:
1366         (export.default.LowLevelBinary.prototype.varuint32):
1367         (export.default.LowLevelBinary.prototype.varint32):
1368         * wasm/js-api/global-error.js: Added.
1369         (catch):
1370         (assert.truthy):
1371         * wasm/js-api/global-external-init-from-import.js: Added.
1372         * wasm/js-api/global-internal-init-from-import.js: Added.
1373         * wasm/js-api/global-mutate.js: Added.
1374         (createInternalGlobalModule):
1375         * wasm/js-api/globals-export.js: Added.
1376         * wasm/js-api/globals-import.js: Added.
1377         * wasm/wasm.json:
1378
1379 2016-12-13  Saam Barati  <sbarati@apple.com>
1380
1381         WebAssembly: implement the elements section
1382         https://bugs.webkit.org/show_bug.cgi?id=165715
1383
1384         Reviewed by Keith Miller.
1385
1386         * wasm/Builder.js:
1387         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1388         (export.default.Builder.prototype._registerSectionBuilders.switch):
1389         * wasm/Builder_WebAssemblyBinary.js:
1390         (const.emitters.Element):
1391         * wasm/function-tests/basic-element.js: Added.
1392         * wasm/js-api/element.js: Added.
1393         (assertBadBinary):
1394         (assertBadBinary.badInstantiation):
1395
1396 2016-12-13  Saam Barati  <sbarati@apple.com>
1397
1398         WebAssembly: implement the table section and table import
1399         https://bugs.webkit.org/show_bug.cgi?id=165716
1400
1401         Reviewed by Keith Miller.
1402
1403         * wasm/Builder.js:
1404         (const._importMemoryContinuation):
1405         (const._importTableContinuation):
1406         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1407         (const._importMemoryContinuation.section): Deleted.
1408         (const): Deleted.
1409         (const._importMemoryContinuation.assert): Deleted.
1410         * wasm/Builder_WebAssemblyBinary.js:
1411         (const.putResizableLimits):
1412         (const.putTable):
1413         (const.emitters.Import):
1414         (const.emitters.Table):
1415         * wasm/function-tests/call-indirect-params.js:
1416         * wasm/function-tests/call-indirect.js:
1417         * wasm/function-tests/table-basic-2.js: Added.
1418         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1419         (func):
1420         * wasm/function-tests/table-basic.js: Added.
1421         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1422         * wasm/js-api/call-indirect-results.js:
1423         (const.wasmModuleWhichImportJS): Deleted.
1424         (MonomorphicImport): Deleted.
1425         * wasm/js-api/call-indirect.js:
1426         (const.wasmModuleWhichImportJS):
1427         (const.makeTable):
1428         (Polyphic2Import):
1429         (VirtualImport):
1430         (MonomorphicImport): Deleted.
1431         * wasm/js-api/table.js: Added.
1432         (assertBadBinary):
1433         (assert.truthy):
1434         (assertBadTable):
1435         (assertBadTableImport):
1436         (assertBadBinary.assertBadTableInstance):
1437         (assertBadTableInstance):
1438         (new.WebAssembly.Table):
1439         * wasm/js-api/test_basic_api.js:
1440         (const.c.in.constructorProperties.switch):
1441
1442 2016-12-13  Commit Queue  <commit-queue@webkit.org>
1443
1444         Unreviewed, rolling out r209725.
1445         https://bugs.webkit.org/show_bug.cgi?id=165811
1446
1447         "Broke ARMv7 builds" (Requested by msaboff on #webkit).
1448
1449         Reverted changeset:
1450
1451         "REGRESSION(r209653): speedometer crashes making virtual slow
1452         path tailcalls"
1453         https://bugs.webkit.org/show_bug.cgi?id=165748
1454         http://trac.webkit.org/changeset/209725
1455
1456 2016-12-12  Michael Saboff  <msaboff@apple.com>
1457
1458         REGRESSION(r209653): speedometer crashes making virtual slow path tailcalls
1459         https://bugs.webkit.org/show_bug.cgi?id=165748
1460
1461         Reviewed by Filip Pizlo.
1462
1463         New regression test.
1464
1465         * stress/regress-165748.js: Added.
1466         (sum1):
1467         (sum2):
1468         (sum3):
1469         (sum4):
1470         (sum5):
1471         (sum6):
1472         (tailCaller):
1473         (test):
1474
1475 2016-12-12  Mark Lam  <mark.lam@apple.com>
1476
1477         Debug JSC test timeout: stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js.ftl-no-cjit.
1478         https://bugs.webkit.org/show_bug.cgi?id=164630
1479
1480         Reviewed by Keith Miller.
1481
1482         Speculative fix for timeout issue.  It looks like this test just runs a bit
1483         slower on debug builds.  So, we'll give it a little more time to run.
1484
1485         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
1486
1487 2016-12-11  Saam Barati  <sbarati@apple.com>
1488
1489         We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
1490         https://bugs.webkit.org/show_bug.cgi?id=165429
1491
1492         Reviewed by Keith Miller.
1493
1494         * wasm/function-tests/trap-load.js: Added.
1495         (assert):
1496         (wasmFrameCountFromError):
1497         (i.catch):
1498         (assert.continuation):
1499         * wasm/function-tests/trap-store.js: Added.
1500         (import.Builder.from.string_appeared_here.assert):
1501         (i.catch):
1502         (assert.continuation):
1503         (assert):
1504         * wasm/js-api/test_memory_constructor.js:
1505         (assert):
1506
1507 2016-12-10  Commit Queue  <commit-queue@webkit.org>
1508
1509         Unreviewed, rolling out r209653, r209654, r209663, and
1510         r209673.
1511         https://bugs.webkit.org/show_bug.cgi?id=165739
1512
1513         speedometer crashes (Requested by pizlo on #webkit).
1514
1515         Reverted changesets:
1516
1517         "JSVALUE64: Pass arguments in platform argument registers when
1518         making JavaScript calls"
1519         https://bugs.webkit.org/show_bug.cgi?id=160355
1520         http://trac.webkit.org/changeset/209653
1521
1522         "Unreviewed build fix for 32 bit builds."
1523         http://trac.webkit.org/changeset/209654
1524
1525         "Unreviewed build fix for the CLOOP after r209653"
1526         http://trac.webkit.org/changeset/209663
1527
1528         "REGRESSION(r209653) Crash in CallFrameShuffler::snapshot()"
1529         https://bugs.webkit.org/show_bug.cgi?id=165728
1530         http://trac.webkit.org/changeset/209673
1531
1532 2016-12-10  Michael Saboff  <msaboff@apple.com>
1533
1534         REGRESSION(r209653) Crash in CallFrameShuffler::snapshot()
1535         https://bugs.webkit.org/show_bug.cgi?id=165728
1536
1537         Reviewed by Filip Pizlo.
1538
1539         New regression test.
1540
1541         * stress/regress-165728.js: Added.
1542         (sum1):
1543         (sum2):
1544         (tailCaller):
1545         (test):
1546
1547 2016-12-10  Keith Miller  <keith_miller@apple.com>
1548
1549         Fix indirect_call if the result type is used.
1550         https://bugs.webkit.org/show_bug.cgi?id=165727
1551
1552         Reviewed by Michael Saboff.
1553
1554         * wasm/js-api/call-indirect-results.js: Added.
1555         (const.wasmModuleWhichImportJS):
1556         (MonomorphicImport):
1557
1558 2016-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>
1559
1560         [JSC] Module namespace object behaves like immutable prototype exotic object
1561         https://bugs.webkit.org/show_bug.cgi?id=165598
1562
1563         Reviewed by Mark Lam.
1564
1565         * modules/namespace-prototype-assignment.js: Added.
1566         (else):
1567         (reportError):
1568         (shouldEqual):
1569         (shouldThrow):
1570         (stringify):
1571         (makeTestID):
1572         (doInternalSetPrototypeOf):
1573         (ordinarySetPrototypeOf):
1574         (setImmutablePrototype):
1575         (windowProxySetPrototypeOf):
1576         (initSetterExpectation):
1577         (throwIfNoExceptionPending):
1578         (objectSetPrototypeOf):
1579         (setUnderscoreProto):
1580         (reflectSetPrototypeOf):
1581         (setPrototypeOf):
1582         (newObjectProto.toString):
1583         (Symbol):
1584         (test):
1585         (runTests):
1586         * modules/namespace-set-prototype-of.js: Added.
1587         (shouldThrow):
1588         (TypeError.Cannot.set prototype):
1589
1590 2016-12-09  Michael Saboff  <msaboff@apple.com>
1591
1592         JSVALUE64: Pass arguments in platform argument registers when making JavaScript calls
1593         https://bugs.webkit.org/show_bug.cgi?id=160355
1594
1595         Reviewed by Filip Pizlo.
1596
1597         New microbenchmarks to measure call type performance.
1598
1599         * microbenchmarks/calling-computed-args.js: Added.
1600         * microbenchmarks/calling-many-callees.js: Added.
1601         * microbenchmarks/calling-one-callee-fixed.js: Added.
1602         * microbenchmarks/calling-one-callee.js: Added.
1603         * microbenchmarks/calling-poly-callees.js: Added.
1604         * microbenchmarks/calling-poly-extra-arity-callees.js: Added.
1605         * microbenchmarks/calling-tailcall.js: Added.
1606         * microbenchmarks/calling-virtual-arity-fixup-callees.js: Added.
1607         * microbenchmarks/calling-virtual-arity-fixup-stackargs.js: Added.
1608         * microbenchmarks/calling-virtual-callees.js: Added.
1609         * microbenchmarks/calling-virtual-extra-arity-callees.js: Added.
1610
1611 2016-12-09  Keith Miller  <keith_miller@apple.com>
1612
1613         Wasm should support call_indirect
1614         https://bugs.webkit.org/show_bug.cgi?id=165718
1615
1616         Reviewed by Filip Pizlo.
1617
1618         * wasm/Builder.js:
1619         * wasm/function-tests/call-indirect-params.js: Added.
1620         * wasm/function-tests/call-indirect.js: Added.
1621         * wasm/js-api/call-indirect.js: Added.
1622         (const.wasmModuleWhichImportJS):
1623         (MonomorphicImport):
1624         (Polyphic2Import):
1625         (VirtualImport):
1626         * wasm/wasm.json:
1627
1628 2016-12-09  JF Bastien  <jfbastien@apple.com>
1629
1630         WebAssembly: implement data section
1631         https://bugs.webkit.org/show_bug.cgi?id=165696
1632
1633         Reviewed by Keith Miller.
1634
1635         As specified in https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#data-section
1636         Note that some of the interesting corner cases are ill-defined by the spec: https://github.com/WebAssembly/design/issues/897
1637
1638         * wasm/Builder.js: create a data section from JavaScript
1639         * wasm/Builder_WebAssemblyBinary.js: assemble the data section into the proper binary encoding
1640         (const.emitters.Data):
1641         * wasm/js-api/test_Data.js: Added.
1642         (DataSection):
1643         (DataSectionOffTheEnd):
1644         (DataSectionPartlyOffTheEnd):
1645         (DataSectionEmptyOffTheEnd):
1646         (DataSectionSeenByStart):
1647         * wasm/self-test/test_BuilderJSON.js: make sure the JSON structure is fine (this sanity checks before going to binary)
1648
1649 2016-12-09  JF Bastien  <jfbastien@apple.com>
1650
1651         WebAssembly JS API: implement start function
1652         https://bugs.webkit.org/show_bug.cgi?id=165150
1653
1654         Reviewed by Saam Barati.
1655
1656         * wasm/Builder.js: allow building a .Start()
1657         * wasm/Builder_WebAssemblyBinary.js:
1658         * wasm/js-api/test_Start.js: Added.
1659         (const.emitters.Start): serialize a start section
1660         * wasm/self-test/test_BuilderJSON.js: validate the start section's content
1661
1662 2016-12-09  Saam Barati  <sbarati@apple.com>
1663
1664         WebAssembly JS API: implement importing and defining Memory
1665         https://bugs.webkit.org/show_bug.cgi?id=164134
1666
1667         Reviewed by Keith Miller.
1668
1669         * wasm/Builder.js:
1670         (const._importMemoryContinuation.section):
1671         (const._importMemoryContinuation.assert):
1672         (const._importMemoryContinuation):
1673         (const._exportFunctionContinuation.const): Deleted.
1674         (const._exportFunctionContinuation): Deleted.
1675         * wasm/Builder_WebAssemblyBinary.js:
1676         (const.emitters.Import):
1677         * wasm/js-api/test_basic_api.js:
1678         (const.c.in.constructorProperties.switch):
1679         * wasm/js-api/test_memory.js: Added.
1680         (assert):
1681         (binaryShouldNotParse):
1682         (test):
1683         (test.testMemImportError):
1684         * wasm/js-api/test_memory_constructor.js: Added.
1685         (assert):
1686         (throw.new.Error):
1687         (testInvalidSize):
1688         (assert.testInvalidInitial):
1689         (testInvalidInitial.testInvalidMaximum):
1690         (testInvalidInitial):
1691         (testInvalidMaximum):
1692         * wasm/self-test/test_BuilderJSON.js:
1693
1694 2016-12-08  JF Bastien  <jfbastien@apple.com>
1695
1696         WebAssembly: JSC::link* shouldn't need a CodeBlock
1697         https://bugs.webkit.org/show_bug.cgi?id=165591
1698
1699         Reviewed by Keith Miller.
1700
1701         test that wasm -> JS works, including the IC
1702
1703         * wasm/js-api/test_Instance.js:
1704         (const.wasmModuleWhichImportJS):
1705         (MonomorphicImport):
1706         (Polyphic2Import):
1707         (Polyphic3Import):
1708         (VirtualImport):
1709
1710 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
1711
1712         Green the cloop bot by raising this threshold.
1713
1714         * mozilla/js1_5/Array/regress-101964.js:
1715
1716 2016-12-08  JF Bastien  <jfbastien@apple.com>
1717
1718         WebAssembly JS API: wire up Instance imports
1719         https://bugs.webkit.org/show_bug.cgi?id=165118
1720
1721         Reviewed by Saam Barati.
1722
1723         * wasm/js-api/test_Instance.js: add the test, disabled for now
1724
1725 2016-12-07  Keith Miller  <keith_miller@apple.com>
1726
1727         Add more missing trivial wasm ops.
1728         https://bugs.webkit.org/show_bug.cgi?id=165564
1729
1730         Add tests for drop and tee_local.
1731
1732         Reviewed by Geoffrey Garen.
1733
1734         * wasm/function-tests/drop.js: Added.
1735         * wasm/function-tests/nop.js: Added.
1736         * wasm/function-tests/tee-local.js: Added.
1737
1738 2016-12-06  Keith Miller  <keith_miller@apple.com>
1739
1740         Add support for truncation operators
1741         https://bugs.webkit.org/show_bug.cgi?id=165519
1742
1743         Reviewed by Geoffrey Garen.
1744
1745         * wasm/function-tests/i32-trunc-s-f32.js: Added.
1746         * wasm/function-tests/i32-trunc-s-f64.js: Added.
1747         * wasm/function-tests/i32-trunc-u-f32.js: Added.
1748         * wasm/function-tests/i32-trunc-u-f64.js: Added.
1749         * wasm/function-tests/i64-trunc-s-f32.js: Added.
1750         * wasm/function-tests/i64-trunc-s-f64.js: Added.
1751         * wasm/function-tests/i64-trunc-u-f32.js: Added.
1752         * wasm/function-tests/i64-trunc-u-f64.js: Added.
1753
1754 2016-12-06  Mark Lam  <mark.lam@apple.com>
1755
1756         Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
1757         https://bugs.webkit.org/show_bug.cgi?id=165227
1758         <rdar://problem/29442665>
1759
1760         Reviewed by Saam Barati.
1761
1762         * stress/get-from-scope-dynamic-onto-proxy.js:
1763         - Updated error message.
1764
1765         * stress/proxy-dont-infinite-loop.js: Removed.
1766         * stress/proxy-json-path.js: Removed.
1767         * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed.
1768         - Removed these tests because the issue they are testing relies on being able to
1769           set Object.prototype.__proto__ to something else (which is now not possible).
1770
1771 2016-12-05  Caitlin Potter  <caitp@igalia.com>
1772
1773         [JSC] report unexpected token when "async" is followed by identifier 
1774         https://bugs.webkit.org/show_bug.cgi?id=165091
1775
1776         Reviewed by Mark Lam.
1777
1778         * stress/bug-165091.js:
1779
1780 2016-12-05  Keith Miller  <keith_miller@apple.com>
1781
1782         Add Wasm i64 to i32 conversion.
1783         https://bugs.webkit.org/show_bug.cgi?id=165378
1784
1785         Reviewed by Filip Pizlo.
1786
1787         It turns out the wrap operation is just B3's Trunc.
1788
1789         * wasm/wasm.json:
1790
1791 2016-12-04  Keith Miller  <keith_miller@apple.com>
1792
1793         Add support for Wasm ctz and popcnt
1794         https://bugs.webkit.org/show_bug.cgi?id=165369
1795
1796         Reviewed by Saam Barati.
1797
1798         * wasm/function-tests/ctz.js: Added.
1799         * wasm/function-tests/popcnt.js: Added.
1800
1801 2016-12-03  JF Bastien  <jfbastien@apple.com>
1802
1803         WebAssembly: update binary format to 0xD version
1804         https://bugs.webkit.org/show_bug.cgi?id=165345
1805
1806         Reviewed by Keith Miller.
1807
1808         As described in the following PR: https://github.com/WebAssembly/design/pull/836
1809         Originally committed in r209175, reverted in r209242, and fixed in r209284.
1810
1811         * wasm/Builder.js:
1812         (const._normalizeFunctionSignature):
1813         * wasm/Builder_WebAssemblyBinary.js:
1814         (const.emitters.Type):
1815         (const.emitters.Code):
1816         * wasm/LowLevelBinary.js:
1817         (export.default.LowLevelBinary.prototype.block_type):
1818         (export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
1819         * wasm/WASM.js:
1820         * wasm/js-api/test_basic_api.js:
1821         * wasm/self-test/test_BuilderWebAssembly.js:
1822         (EmptyModule):
1823         (CustomSection):
1824         * wasm/self-test/test_WASM.js:
1825         * wasm/wasm.json:
1826
1827 2016-12-02  Keith Miller  <keith_miller@apple.com>
1828
1829         Add Wasm copysign
1830         https://bugs.webkit.org/show_bug.cgi?id=165355
1831
1832         Reviewed by Filip Pizlo.
1833
1834         * wasm/function-tests/copysign.js: Added.
1835
1836 2016-12-03  Commit Queue  <commit-queue@webkit.org>
1837
1838         Unreviewed, rolling out r209298.
1839         https://bugs.webkit.org/show_bug.cgi?id=165359
1840
1841         broke the build (Requested by smfr on #webkit).
1842
1843         Reverted changeset:
1844
1845         "Add Wasm copysign"
1846         https://bugs.webkit.org/show_bug.cgi?id=165355
1847         http://trac.webkit.org/changeset/209298
1848
1849 2016-12-02  Keith Miller  <keith_miller@apple.com>
1850
1851         Add Wasm copysign
1852         https://bugs.webkit.org/show_bug.cgi?id=165355
1853
1854         Reviewed by Filip Pizlo.
1855
1856         * wasm/function-tests/copysign.js: Added.
1857
1858 2016-12-02  Keith Miller  <keith_miller@apple.com>
1859
1860         Unreviewed, fix git having a breakdown over trying to reland a rollout.
1861
1862 2016-12-02  Keith Miller  <keith_miller@apple.com>
1863
1864         Add Wasm floating point nearest and trunc
1865         https://bugs.webkit.org/show_bug.cgi?id=165339
1866
1867         Reviewed by Saam Barati.
1868
1869         * wasm/function-tests/nearest.js: Added.
1870         * wasm/function-tests/trunc.js: Added.
1871
1872 2016-12-02  Caitlin Potter  <caitp@igalia.com>
1873
1874 [JSC] add additional bit to JSTokenType bitfield
1875         https://bugs.webkit.org/show_bug.cgi?id=165091
1876
1877         Reviewed by Geoffrey Garen.
1878
1879         * stress/bug-165091.js: Added.
1880         (shouldThrowSyntaxError):
1881
1882 2016-12-02  Commit Queue  <commit-queue@webkit.org>
1883
1884         Unreviewed, rolling out r209275 and r209276.
1885         https://bugs.webkit.org/show_bug.cgi?id=165348
1886
1887         "broke the arm build" (Requested by keith_miller on #webkit).
1888
1889         Reverted changesets:
1890
1891         "Add Wasm floating point nearest and trunc"
1892         https://bugs.webkit.org/show_bug.cgi?id=165339
1893         http://trac.webkit.org/changeset/209275
1894
1895         "Unreviewed, forgot to change instruction after renaming."
1896         http://trac.webkit.org/changeset/209276
1897
1898 2016-12-02  Keith Miller  <keith_miller@apple.com>
1899
1900         Add Wasm floating point nearest and trunc
1901         https://bugs.webkit.org/show_bug.cgi?id=165339
1902
1903         Reviewed by Filip Pizlo.
1904
1905         * wasm/function-tests/nearest.js: Added.
1906         * wasm/function-tests/trunc.js: Added.
1907
1908 2016-12-02  JF Bastien  <jfbastien@apple.com>
1909
1910         WebAssembly: revert patch causing odd breakage
1911         https://bugs.webkit.org/show_bug.cgi?id=165308
1912
1913         Unreviewed.
1914
1915         Bug #164724 seems to cause build issues which I haven't tracked down yet. WasmOps.h can't be found:
1916         ./Source/JavaScriptCore/wasm/WasmFormat.h:34:10: fatal error: 'WasmOps.h' file not found
1917
1918         It's weird since the file is auto-generated and has been for a while. #164724 merely includes it in WasmFormat.h.
1919
1920         * wasm/Builder.js:
1921         (const._normalizeFunctionSignature):
1922         * wasm/Builder_WebAssemblyBinary.js:
1923         (const.emitters.Type):
1924         (const.emitters.Code):
1925         * wasm/LowLevelBinary.js:
1926         (export.default.LowLevelBinary.prototype.inline_signature_type):
1927         (export.default.LowLevelBinary.prototype.block_type): Deleted.
1928         * wasm/WASM.js:
1929         * wasm/js-api/test_basic_api.js:
1930         * wasm/self-test/test_BuilderWebAssembly.js:
1931         (EmptyModule):
1932         (CustomSection):
1933         * wasm/self-test/test_WASM.js:
1934         * wasm/wasm.json:
1935
1936 2016-12-01  Ryan Haddad  <ryanhaddad@apple.com>
1937
1938         Skip flaky test ChakraCore/test/fieldopts/objtypespec-newobj-invalidation.1.js
1939         https://bugs.webkit.org/show_bug.cgi?id=162567
1940
1941         Reviewed by Saam Barati.
1942
1943         * ChakraCore.yaml:
1944
1945 2016-12-01  Keith Miller  <keith_miller@apple.com>
1946
1947         Add wasm int to floating point opcodes
1948         https://bugs.webkit.org/show_bug.cgi?id=165252
1949
1950         Reviewed by Geoffrey Garen.
1951
1952         Add tests for Wasm integral to floating point conversion opcodes.
1953
1954         * wasm/function-tests/int-to-floating-point.js: Added.
1955         * wasm/wasm.json:
1956
1957 2016-12-01  Geoffrey Garen  <ggaren@apple.com>
1958
1959         Land a test case for <rdar://problem/27889416>
1960         https://bugs.webkit.org/show_bug.cgi?id=165272
1961
1962         Reviewed by Saam Barati.
1963
1964         * stress/marked-argument-buffer.js: Added.
1965         (allocate):
1966         (test.o.toString):
1967         (test):
1968
1969 2016-11-29  Per Arne Vollan  <pvollan@apple.com>
1970
1971         [Win] Skip failing JSC tests.
1972         https://bugs.webkit.org/show_bug.cgi?id=165140
1973
1974         Reviewed by Mark Lam.
1975
1976         * ChakraCore.yaml:
1977         * microbenchmarks/tan.js:
1978
1979 2016-11-30  JF Bastien  <jfbastien@apple.com>
1980
1981         WebAssembly builder: don't throw when checker not implemented
1982         https://bugs.webkit.org/show_bug.cgi?id=165219
1983
1984         Reviewed by Mark Lam.
1985
1986         We should perform whichever checks we've implemented, and assume the rest are OK until bug #163421 is fixed.
1987
1988         * wasm/Builder.js:
1989         * wasm/README.md:
1990         * wasm/function-tests/add-12.js:
1991         * wasm/function-tests/br-if-loop-less-than.js:
1992         * wasm/function-tests/brTableAsIf.js:
1993         * wasm/function-tests/brTableManyValues.js:
1994         * wasm/function-tests/brTableWithLoop.js:
1995         * wasm/function-tests/dumb-eq-if-then-else.js:
1996         * wasm/function-tests/dumb-less-than-fallthrough.js:
1997         * wasm/function-tests/dumb-less-than-ite.js:
1998         * wasm/function-tests/eqz.js:
1999         * wasm/function-tests/factorial.js:
2000         * wasm/function-tests/float-sub.js:
2001         * wasm/function-tests/i32-load.js:
2002         * wasm/function-tests/i32-load8-s.js:
2003         * wasm/function-tests/if-then-else-fallthrough.js:
2004         * wasm/function-tests/if-then-fallthrough.js:
2005         * wasm/function-tests/loop-mult.js:
2006         * wasm/function-tests/loop-sum.js:
2007         * wasm/function-tests/max.js:
2008         * wasm/function-tests/min.js:
2009         * wasm/function-tests/ret5.js:
2010         * wasm/function-tests/select.js:
2011         * wasm/self-test/test_BuilderJSON.js:
2012
2013 2016-11-29  JF Bastien  <jfbastien@apple.com>
2014
2015         WebAssembly JS API: improve Instance
2016         https://bugs.webkit.org/show_bug.cgi?id=164757
2017
2018         Reviewed by Keith Miller.
2019
2020         An Instance's `exports` property wasn't populated with exports.
2021
2022         A follow-up patch will do imports.
2023
2024         A few things of note:
2025
2026          - LowLevelBinary: support 3-byte integers.
2027          - LowLevelBinary: support proper UTF-8 2003 code points (instead of UTF-16).
2028
2029         * wasm/Builder.js:
2030         * wasm/Builder_WebAssemblyBinary.js: wire up exports, stub other things out some more
2031         (const.emitters.Export):
2032         * wasm/LowLevelBinary.js:
2033         (export.default.LowLevelBinary.prototype.uint24): add, used for UTF-8
2034         (export.default.LowLevelBinary.prototype.string): support UTF-8
2035         (export.default.LowLevelBinary.prototype.getUint24): add, used for UTF-8
2036         (export.default.LowLevelBinary.prototype.getVaruint1): was missing
2037         (export.default.LowLevelBinary.prototype.getString): support UTF-8
2038         (export.default.LowLevelBinary):
2039         * wasm/js-api/test_Instance.js: instance.exports.answer() // <-- this is where the magic of this entire patch is
2040         (ExportedAnswerI32):
2041         * wasm/js-api/test_basic_api.js: punt test to later
2042         (const.c.in.constructorProperties.switch):
2043         * wasm/self-test/test_BuilderWebAssembly.js: UTF-8
2044         (CustomSection):
2045         * wasm/self-test/test_LowLevelBinary_string.js: UTF-8 now works
2046         * wasm/self-test/test_LowLevelBinary_uint16.js: was missing one value
2047         * wasm/self-test/test_LowLevelBinary_uint24.js: Copied from JSTests/wasm/self-test/test_LowLevelBinary_uint8.js.
2048         * wasm/self-test/test_LowLevelBinary_uint8.js: was missing one value
2049         * wasm/self-test/test_LowLevelBinary_varuint1.js: Added.
2050         * wasm/utilities.js: this `dump` thing was useful
2051         (const._dump):
2052
2053 2016-11-29  Saam Barati  <sbarati@apple.com>
2054
2055         We should be able optimize the pattern where we spread a function's rest parameter to another call
2056         https://bugs.webkit.org/show_bug.cgi?id=163865
2057
2058         Reviewed by Filip Pizlo.
2059
2060         * microbenchmarks/default-derived-constructor.js: Added.
2061         (createClassHierarchy.let.currentClass):
2062         (createClassHierarchy):
2063         * stress/call-varargs-spread.js: Added.
2064         (assert):
2065         (bar):
2066         (foo):
2067         * stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js: Added.
2068         (assert):
2069         (baz):
2070         (bar):
2071         (foo):
2072         * stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js: Added.
2073         (assert):
2074         (foo):
2075         (escape):
2076         (bar):
2077         * stress/phantom-new-array-with-spread-osr-exit.js: Added.
2078         (assert):
2079         (baz):
2080         (bar):
2081         (effects):
2082         (foo):
2083         * stress/phantom-spread-forward-varargs.js: Added.
2084         (assert):
2085         (test1.bar):
2086         (test1.foo):
2087         (test1):
2088         (test2.bar):
2089         (test2.foo):
2090         (test3.baz):
2091         (test3.bar):
2092         (test3.foo):
2093         (test4.baz):
2094         (test4.bar):
2095         (test4.foo):
2096         (test5.baz):
2097         (test5.bar):
2098         (test5.foo):
2099         * stress/phantom-spread-osr-exit.js: Added.
2100         (assert):
2101         (baz):
2102         (bar):
2103         (effects):
2104         (foo):
2105         * stress/spread-call-convert-to-static-call.js: Added.
2106         (assert):
2107         (baz):
2108         (bar):
2109         (foo):
2110         * stress/spread-forward-call-varargs-stack-overflow.js: Added.
2111         (assert):
2112         (identity):
2113         (bar):
2114         (foo):
2115         * stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js: Added.
2116         (assert):
2117         (baz.Array.prototype.Symbol.iterator):
2118         (baz):
2119         (bar):
2120         (foo):
2121         (test):
2122         * stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js: Added.
2123         (assert):
2124         (baz.Array.prototype.Symbol.iterator):
2125         (baz):
2126         (bar):
2127         (foo):
2128         * stress/spread-forward-varargs-stack-overflow.js: Added.
2129         (assert):
2130         (bar):
2131         (foo):
2132
2133 2016-11-29  Caitlin Potter  <caitp@igalia.com>
2134
2135         [JSC] always wrap AwaitExpression operand in a new Promise
2136         https://bugs.webkit.org/show_bug.cgi?id=165181
2137
2138         Reviewed by Yusuke Suzuki.
2139
2140         * stress/async-await-basic.js:
2141         (async.awaitedPromisesAreWrapped):
2142
2143 2016-11-29  Keith Miller  <keith_miller@apple.com>
2144
2145         Add simple way to implement Wasm ops that require more than one B3 opcode
2146         https://bugs.webkit.org/show_bug.cgi?id=165129
2147
2148         Reviewed by Geoffrey Garen.
2149
2150         * wasm/function-tests/eqz.js: Added.
2151         * wasm/function-tests/max.js: Added.
2152         * wasm/function-tests/min.js: Added.
2153         * wasm/wasm.json:
2154
2155 2016-11-21  Yusuke Suzuki  <utatane.tea@gmail.com>
2156
2157         Crash in com.apple.JavaScriptCore: WTF::ThreadSpecific<WTF::WTFThreadData, + 142
2158         https://bugs.webkit.org/show_bug.cgi?id=164898
2159
2160         Reviewed by Darin Adler.
2161
2162         * stress/tagged-template-registry-key-collect.js: Added.
2163         (shouldBe):
2164         (tag):
2165         (i.eval):
2166         * stress/tagged-template-registry-key.js: Added.
2167         (shouldBe):
2168         (tag):
2169         (a):
2170         (b):
2171
2172 2016-11-20  Caitlin Potter  <caitp@igalia.com>
2173
2174         [JSC] speed up parsing of async functions
2175         https://bugs.webkit.org/show_bug.cgi?id=164808
2176
2177         Reviewed by Yusuke Suzuki.
2178
2179         Add tests for line terminator following "async" keyword in async
2180         function syntax.
2181
2182         * stress/async-await-syntax.js:
2183         (shouldBe):
2184
2185 2016-11-19  Mark Lam  <mark.lam@apple.com>
2186
2187         op_mod-* JSC tests needs a longer timeout too.
2188         https://bugs.webkit.org/show_bug.cgi?id=164994
2189
2190         Reviewed by Yusuke Suzuki.
2191
2192         * stress/op_mod-ConstVar.js:
2193         * stress/op_mod-VarConst.js:
2194         * stress/op_mod-VarVar.js:
2195
2196 2016-11-19  Mark Lam  <mark.lam@apple.com>
2197
2198         Add --timeoutMultiplier option to allow some tests more time to run.
2199         https://bugs.webkit.org/show_bug.cgi?id=164951
2200
2201         Reviewed by Yusuke Suzuki.
2202
2203         Extended the timeout for these tests by 50% more because they run quite slow on
2204         low-end machines.
2205
2206         * stress/op_div-ConstVar.js:
2207         * stress/op_div-VarConst.js:
2208         * stress/op_div-VarVar.js:
2209
2210 2016-11-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2211
2212         REGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05.arguments_sm.js.default
2213         https://bugs.webkit.org/show_bug.cgi?id=164929
2214
2215         Reviewed by Mark Lam.
2216
2217         ES2017 drops arguments.caller and JavaScriptCore is updated to meet the spec.
2218         This patch rebaselines the result of ChakraCore test for JSC.
2219
2220         * ChakraCore/test/strict/05.arguments_sm.baseline-jsc:
2221
2222 2016-11-18  Joseph Pecoraro  <pecoraro@apple.com>
2223
2224         Web Inspector: Generator functions should have a displayable name when shown in stack traces
2225         https://bugs.webkit.org/show_bug.cgi?id=164844
2226         <rdar://problem/29300697>
2227
2228         Reviewed by Yusuke Suzuki.
2229
2230         * stress/generator-function-name.js:
2231         Add another test now that we name the inner generator function
2232         that we do not break the lexical resolution of names.
2233
2234 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2235
2236         [JSC] Drop arguments.caller
2237         https://bugs.webkit.org/show_bug.cgi?id=164859
2238
2239         Reviewed by Saam Barati.
2240
2241         * stress/strict-mode-arguments-caller.js: Added.
2242         (strictArguments):
2243         (shouldBe):
2244
2245 2016-11-17  Keith Miller  <keith_miller@apple.com>
2246
2247         Add rotate to Wasm
2248         https://bugs.webkit.org/show_bug.cgi?id=164871
2249
2250         Reviewed by Filip Pizlo.
2251
2252         * wasm/wasm.json:
2253
2254 2016-11-17  Keith Miller  <keith_miller@apple.com>
2255
2256         Add sqrt to Wasm
2257         https://bugs.webkit.org/show_bug.cgi?id=164877
2258
2259         Reviewed by Mark Lam.
2260
2261         B3 already has a Sqrt opcode we just need to map Wasm to it.
2262
2263         * wasm/wasm.json:
2264
2265 2016-11-17  Saam Barati  <sbarati@apple.com>
2266
2267         Remove async/await compile time flag and enable tests
2268         https://bugs.webkit.org/show_bug.cgi?id=164828
2269         <rdar://problem/28639334>
2270
2271         Reviewed by Yusuke Suzuki.
2272
2273         * stress/async-arrow-functions-lexical-arguments-binding.js:
2274         * stress/async-arrow-functions-lexical-new.target-binding.js:
2275         * stress/async-arrow-functions-lexical-super-binding.js:
2276         * stress/async-arrow-functions-lexical-this-binding.js:
2277         * stress/async-await-basic.js:
2278         * stress/async-await-long-loop.js:
2279         * stress/async-await-module-reserved-word.js:
2280         * stress/async-await-mozilla.js:
2281         (mozSyntaxErrors):
2282         * stress/async-await-reserved-word.js:
2283         * stress/async-await-syntax.js:
2284         * stress/async-await-throw-loop.js:
2285         * stress/async-function-create-nobaseline.js:
2286         * stress/async-function-create-optimized.js:
2287         * stress/async-function-declaration-sinking-no-double-allocate.js:
2288         * stress/async-function-declaration-sinking-osrexit.js:
2289         * stress/async-function-declaration-sinking-put.js:
2290         * stress/async-function-expression-sinking-no-double-allocate.js:
2291         * stress/async-function-expression-sinking-osrexit.js:
2292         * stress/async-function-expression-sinking-put.js:
2293         * test262.yaml:
2294
2295 2016-11-15  Mark Lam  <mark.lam@apple.com>
2296
2297         Make JSC test functions more robust.
2298         https://bugs.webkit.org/show_bug.cgi?id=164807
2299
2300         Reviewed by Keith Miller.
2301
2302         * stress/jsc-test-functions-should-be-more-robust.js: Added.
2303
2304 2016-11-15  Keith Miller  <keith_miller@apple.com>
2305
2306         B3 should support UDiv/UMod
2307         https://bugs.webkit.org/show_bug.cgi?id=164811
2308
2309         Reviewed by Filip Pizlo.
2310
2311         Link new instructions to wasm.
2312
2313         * wasm/wasm.json:
2314
2315 2016-11-15  Saam Barati  <sbarati@apple.com>
2316
2317         Debug JSC test timeout: stress/has-own-property-name-cache-symbols-and-strings.js.ftl-no-cjit-small-pool
2318         https://bugs.webkit.org/show_bug.cgi?id=163012
2319
2320         Unreviewed. This patch makes a test run for less time because it's timing out on the bots.
2321
2322         * stress/has-own-property-name-cache-symbols-and-strings.js:
2323
2324 2016-11-15  Mark Lam  <mark.lam@apple.com>
2325
2326         The jsc shell's setImpureGetterDelegate() should ensure that the set value is an ImpureGetter.
2327         https://bugs.webkit.org/show_bug.cgi?id=164781
2328         <rdar://problem/28418590>
2329
2330         Reviewed by Geoffrey Garen and Michael Saboff.
2331
2332         * stress/jsc-setImpureGetterDelegate-on-bad-type.js: Added.
2333
2334 2016-11-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2335
2336         [DOMJIT] Allow using macro assembler scratches in FTL CheckDOM
2337         https://bugs.webkit.org/show_bug.cgi?id=164727
2338
2339         Reviewed by Filip Pizlo.
2340
2341         * stress/check-dom-with-signature.js: Added.
2342         (shouldBe):
2343         (calling):
2344         (i.array.forEach):
2345
2346 2016-11-14  Caitlin Potter  <caitp@igalia.com>
2347
2348         [JSC] do not reference AwaitExpression Promises in async function Promise chain
2349         https://bugs.webkit.org/show_bug.cgi?id=164753
2350
2351         Reviewed by Yusuke Suzuki.
2352
2353         * asyncFunctionTests.yaml:
2354         * stress/async-await-long-loop.js: Added.
2355         (shouldBe):
2356         (async.longLoop):
2357         * stress/async-await-throw-loop.js: Added.
2358         (shouldBe):
2359         (async.thrower):
2360         (async.throwLoop):
2361
2362 2016-11-14  Keith Miller  <keith_miller@apple.com>
2363
2364         Add Wasm select
2365         https://bugs.webkit.org/show_bug.cgi?id=164743
2366
2367         Reviewed by Saam Barati.
2368
2369         * wasm/function-tests/select.js: Added.
2370
2371 2016-11-14  Caitlin Potter  <caitp@igalia.com>
2372
2373         [JSC] Handle new_async_func / new_async_func_exp in DFG / FTL
2374         https://bugs.webkit.org/show_bug.cgi?id=164037
2375
2376         Reviewed by Yusuke Suzuki.
2377
2378         Add tests based on tests from https://trac.webkit.org/changeset/194216.
2379
2380         * asyncFunctionTests.yaml:
2381         * stress/async-function-create-nobaseline.js: Added.
2382         * stress/async-function-create-optimized.js: Added.
2383         * stress/async-function-declaration-sinking-no-double-allocate.js: Added.
2384         * stress/async-function-declaration-sinking-osrexit.js: Added.
2385         * stress/async-function-declaration-sinking-put.js: Added.
2386         * stress/async-function-expression-sinking-no-double-allocate.js: Added.
2387         * stress/async-function-expression-sinking-osrexit.js: Added.
2388         * stress/async-function-expression-sinking-put.js: Added.
2389
2390 2016-11-14  Mark Lam  <mark.lam@apple.com>
2391
2392         Some of JSStringView::SafeView methods are not idiomatically safe for JSString to StringView conversions.
2393         https://bugs.webkit.org/show_bug.cgi?id=164701
2394         <rdar://problem/27462104>
2395
2396         Reviewed by Darin Adler.
2397
2398         * stress/string-prototype-charCodeAt-on-too-long-rope.js: Added.
2399
2400 2016-11-14  Mark Lam  <mark.lam@apple.com>
2401
2402         RegExpObject::exec/match should handle errors gracefully.
2403         https://bugs.webkit.org/show_bug.cgi?id=155145
2404         <rdar://problem/27435934>
2405
2406         Reviewed by Keith Miller.
2407
2408         * stress/regexp-prototype-exec-on-too-long-rope.js: Added.
2409         * stress/regexp-prototype-match-on-too-long-rope.js: Added.
2410         * stress/regexp-prototype-test-on-too-long-rope.js: Added.
2411
2412 2016-11-14  Mark Lam  <mark.lam@apple.com>
2413
2414         Enhance run-jsc-stress-test script to allow optional test specific options to be added for all test run configurations.
2415         https://bugs.webkit.org/show_bug.cgi?id=164695
2416
2417         Reviewed by Keith Miller.
2418
2419         Replace use of runMisc* test run configurations with equivalents.
2420
2421         * stress/licm-no-pre-header-nested.js:
2422         * stress/licm-no-pre-header.js:
2423         * stress/licm-pre-header-cannot-exit-nested.js:
2424         * stress/licm-pre-header-cannot-exit.js:
2425         * stress/make-dictionary-repatch.js:
2426         * stress/retry-cache-later.js:
2427         * stress/shadow-chicken-reading-from-scope-after-ftl-osr-exit-bytecode-liveness.js:
2428         * stress/slow-path-generator-updating-current-node-dfg.js:
2429         * stress/unshift-array-storage.js:
2430
2431 2016-11-11  Joseph Pecoraro  <pecoraro@apple.com>
2432
2433         test262: DataView with explicit undefined byteLength should be the same as it not being present
2434         https://bugs.webkit.org/show_bug.cgi?id=164453
2435
2436         Reviewed by Darin Adler.
2437
2438         * stress/dataview-construct.js: Added.
2439         (assert):
2440         (shouldThrow):
2441         * test262.yaml:
2442
2443 2016-11-11  Joseph Pecoraro  <pecoraro@apple.com>
2444
2445         test262: DataView get methods should allow for missing offset, set methods should allow for missing value
2446         https://bugs.webkit.org/show_bug.cgi?id=164451
2447
2448         Reviewed by Darin Adler.
2449
2450         * test262.yaml:
2451
2452 2016-11-11  Saam Barati  <sbarati@apple.com>
2453
2454         We should have a more concise way of determining when we're varargs calling a function using rest parameters
2455         https://bugs.webkit.org/show_bug.cgi?id=164258
2456
2457         Reviewed by Yusuke Suzuki.
2458
2459         * microbenchmarks/call-using-spread.js: Added.
2460         (bar):
2461         (foo):
2462         * microbenchmarks/spread-large-array.js: Added.
2463         (foo):
2464         (arrays.push):
2465         * microbenchmarks/spread-small-array.js: Added.
2466         (foo):
2467         * stress/spread-array-iterator-watchpoint-2.js: Added.
2468         (foo):
2469         (arrayIterator.next):
2470         * stress/spread-array-iterator-watchpoint.js: Added.
2471         (foo):
2472         (Array.prototype.Symbol.iterator):
2473         * stress/spread-non-array.js: Added.
2474         (assert):
2475         (foo):
2476         (let.customIterator.Symbol.iterator):
2477         (bar):
2478
2479 2016-11-11  Keith Miller  <keith_miller@apple.com>
2480
2481         Relocate wasm tests and actually add them to the test runner
2482         https://bugs.webkit.org/show_bug.cgi?id=164668
2483
2484         Reviewed by Yusuke Suzuki.
2485
2486         This moves the Wasm tests from their current location down a level.
2487         Without relocating, the tests cannot properly be run by the wasm test runner.
2488
2489         * wasm.yaml:
2490         * wasm/Builder.js: Fix typos, yay lazy synatx checking!
2491         * wasm/LowLevelBinary.js: Fix typos, yay lazy synatx checking!
2492         (export.default.LowLevelBinary.prototype.get return):
2493         * wasm/function-tests/add-12.js: Renamed from JSTests/wasm/js-api/function-tests/add-12.js.
2494         * wasm/function-tests/br-if-loop-less-than.js: Renamed from JSTests/wasm/js-api/function-tests/br-if-loop-less-than.js.
2495         * wasm/function-tests/brTableAsIf.js: Renamed from JSTests/wasm/js-api/function-tests/brTableAsIf.js.
2496         * wasm/function-tests/brTableManyValues.js: Renamed from JSTests/wasm/js-api/function-tests/brTableManyValues.js.
2497         * wasm/function-tests/brTableWithLoop.js: Renamed from JSTests/wasm/js-api/function-tests/brTableWithLoop.js.
2498         * wasm/function-tests/dumb-eq-if-then-else.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-eq-if-then-else.js.
2499         * wasm/function-tests/dumb-less-than-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-less-than-fallthrough.js.
2500         * wasm/function-tests/dumb-less-than-ite.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-less-than-ite.js.
2501         * wasm/function-tests/factorial.js: Renamed from JSTests/wasm/js-api/function-tests/factorial.js.
2502         * wasm/function-tests/float-sub.js: Renamed from JSTests/wasm/js-api/function-tests/float-sub.js.
2503         * wasm/function-tests/i32-load.js: Renamed from JSTests/wasm/js-api/function-tests/i32-load.js.
2504         * wasm/function-tests/i32-load8-s.js: Renamed from JSTests/wasm/js-api/function-tests/i32-load8-s.js.
2505         * wasm/function-tests/if-then-else-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/if-then-else-fallthrough.js.
2506         * wasm/function-tests/if-then-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/if-then-fallthrough.js.
2507         * wasm/function-tests/loop-mult.js: Renamed from JSTests/wasm/js-api/function-tests/loop-mult.js.
2508         * wasm/function-tests/loop-sum.js: Renamed from JSTests/wasm/js-api/function-tests/loop-sum.js.
2509         * wasm/function-tests/ret5.js: Renamed from JSTests/wasm/js-api/function-tests/ret5.js.
2510         * wasm/self-test/test_BuilderJSON.js: Rebasline
2511
2512 2016-11-11  Keith Miller  <keith_miller@apple.com>
2513
2514         Move Wasm tests to JS
2515         https://bugs.webkit.org/show_bug.cgi?id=164611
2516
2517         Reviewed by Geoffrey Garen.
2518
2519         This patch translates most of the tests from testWasm.cpp to the JS testing api. Most of the
2520         ommited tests were earliest tests, which tested trivial things, like adding two
2521         constants. Some tests are ommited for other reasons, however. These are:
2522
2523         1) Tests using I64 since the testing api does not yet know how to handle 64-bit numbers.  2)
2524         Tests that would validate the memory of the module once wasm was done with it since that's
2525         not really possible in JS.
2526
2527         In order to make such a translation easier this patch also adds some features to the JS
2528         testing api:
2529
2530         1) Blocks can now be done lexically by adding a lambda as the last argument of the block
2531         opcode. For example one can do:
2532             ...
2533             .Block("i32", b => b.I32Const(1) )
2534
2535         and the nested lambda will automatically have an end attached.
2536
2537         2) The JS testing api can now handle inline signature types.
2538
2539         3) Relocate some code to make it easier to follow and prevent 44 space indentation.
2540
2541         4) Rename varuint/varint to varuint32/varint32, this lets them be directly called from the
2542         wasm.json without being remapped.
2543
2544         5) Add support for Memory and Function sections to the Builder.
2545
2546         6) Add support for local variables.
2547
2548         On the JSC side, we needed to expose a new function to validate the compiled wasm code
2549         behaves the way we expect. At least until the JS Wasm API is finished. The new validation
2550         function, testWasmModuleFunctions, takes an array buffer containing the wasm binary, the
2551         number of functions in the blob and tests for each of those functions.
2552
2553         * wasm/Builder.js:
2554         (const._maybeRegisterType):
2555         (const): Deleted.
2556         (switch.typeof): Deleted.
2557         * wasm/Builder_WebAssemblyBinary.js:
2558         (const.emitters.Type):
2559         (const.emitters.Import):
2560         (const.emitters.Function):
2561         (const.emitters.Memory):
2562         (const.emitters.Code):
2563         (export.const.Binary):
2564         * wasm/LowLevelBinary.js:
2565         (export.default.LowLevelBinary.prototype.get return):
2566         (export.default.LowLevelBinary.prototype.varuint32):
2567         (export.default.LowLevelBinary.prototype.varint32):
2568         (export.default.LowLevelBinary.prototype.varuint1):
2569         (export.default.LowLevelBinary.prototype.varint7):
2570         (export.default.LowLevelBinary.prototype.varuint7):
2571         (export.default.LowLevelBinary.prototype.inline_signature_type):
2572         (export.default.LowLevelBinary.prototype.string):
2573         (export.default.LowLevelBinary.prototype.getVaruint32):
2574         (export.default.LowLevelBinary.prototype.getVarint32):
2575         (export.default.LowLevelBinary.prototype.getVaruint7):
2576         (export.default.LowLevelBinary.prototype.getString):
2577         (export.default.LowLevelBinary):
2578         (export.default.LowLevelBinary.prototype.varuint): Deleted.
2579         (export.default.LowLevelBinary.prototype.varint): Deleted.
2580         (export.default.LowLevelBinary.prototype.getVaruint): Deleted.
2581         (export.default.LowLevelBinary.prototype.getVarint): Deleted.
2582         * wasm/js-api/test_old_tests.js: Added.
2583         (ret5):
2584         (brTableWithLoop):
2585         (brTableManyValues):
2586         (run.brTableManyValues.brTableAsIf):
2587         (ifThenFallthrough):
2588         (ifThenElseFallthrough):
2589         (dumbLessThanFallthrough):
2590         (run.dumbLessThanFallthrough.floatSub):
2591         (run.floatSub.add12):
2592         (run.add12.factorial):
2593         (i32load):
2594         (run.i32load.i32load8s):
2595         (run.i32load8s.dumbEqIfThenElse):
2596         (run.dumbEqIfThenElse.dumbEqIfThenElse):
2597         (run.dumbEqIfThenElse.dumbLessThanIfThenElse):
2598         (run.dumbLessThanIfThenElse.loopSum):
2599         (run.loopSum.loopMult):
2600         (brIfLoopLessThan):
2601         (run.brIfLoopLessThan.run):
2602         * wasm/self-test/test_LowLevelBinary_varint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varint.js.
2603         * wasm/self-test/test_LowLevelBinary_varuint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varuint.js.
2604
2605         * wasm/Builder.js:
2606         (const._maybeRegisterType):
2607         (const): Deleted.
2608         (switch.typeof): Deleted.
2609         * wasm/Builder_WebAssemblyBinary.js:
2610         (const.emitters.Type):
2611         (const.emitters.Import):
2612         (const.emitters.Function):
2613         (const.emitters.Memory):
2614         (const.emitters.Code):
2615         (export.const.Binary):
2616         * wasm/LowLevelBinary.js:
2617         (export.default.LowLevelBinary.prototype.get return):
2618         (export.default.LowLevelBinary.prototype.varuint32):
2619         (export.default.LowLevelBinary.prototype.varint32):
2620         (export.default.LowLevelBinary.prototype.varuint1):
2621         (export.default.LowLevelBinary.prototype.varint7):
2622         (export.default.LowLevelBinary.prototype.varuint7):
2623         (export.default.LowLevelBinary.prototype.inline_signature_type):
2624         (export.default.LowLevelBinary.prototype.string):
2625         (export.default.LowLevelBinary.prototype.getVaruint32):
2626         (export.default.LowLevelBinary.prototype.getVarint32):
2627         (export.default.LowLevelBinary.prototype.getVaruint7):
2628         (export.default.LowLevelBinary.prototype.getString):
2629         (export.default.LowLevelBinary):
2630         (export.default.LowLevelBinary.prototype.varuint): Deleted.
2631         (export.default.LowLevelBinary.prototype.varint): Deleted.
2632         (export.default.LowLevelBinary.prototype.getVaruint): Deleted.
2633         (export.default.LowLevelBinary.prototype.getVarint): Deleted.
2634         * wasm/js-api/function-tests/add-12.js: Added.
2635         * wasm/js-api/function-tests/br-if-loop-less-than.js: Added.
2636         * wasm/js-api/function-tests/brTableAsIf.js: Added.
2637         * wasm/js-api/function-tests/brTableManyValues.js: Added.
2638         * wasm/js-api/function-tests/brTableWithLoop.js: Added.
2639         * wasm/js-api/function-tests/dumb-eq-if-then-else.js: Added.
2640         * wasm/js-api/function-tests/dumb-less-than-fallthrough.js: Added.
2641         * wasm/js-api/function-tests/dumb-less-than-ite.js: Added.
2642         * wasm/js-api/function-tests/factorial.js: Added.
2643         * wasm/js-api/function-tests/float-sub.js: Added.
2644         * wasm/js-api/function-tests/i32-load.js: Added.
2645         * wasm/js-api/function-tests/i32-load8-s.js: Added.
2646         * wasm/js-api/function-tests/if-then-else-fallthrough.js: Added.
2647         * wasm/js-api/function-tests/if-then-fallthrough.js: Added.
2648         * wasm/js-api/function-tests/loop-mult.js: Added.
2649         * wasm/js-api/function-tests/loop-sum.js: Added.
2650         * wasm/js-api/function-tests/ret5.js: Added.
2651         * wasm/self-test/test_LowLevelBinary_varint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varint.js.
2652         * wasm/self-test/test_LowLevelBinary_varuint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varuint.js.
2653
2654 2016-11-11  Saam Barati  <sbarati@apple.com>
2655
2656         We recursively grab a lock in the DFGBytecodeParser causing us to deadlock
2657         https://bugs.webkit.org/show_bug.cgi?id=164650
2658
2659         Reviewed by Geoffrey Garen.
2660
2661         * stress/dont-dead-lock-put-by-val-as-put-by-id.js: Added.
2662         (ident):
2663         (let.o.set foo):
2664         (foo):
2665
2666 2016-11-11  Chris Dumez  <cdumez@apple.com>
2667
2668         Unreviewed, rolling out r208584.
2669
2670         Seems to have regressed Speedometer by 1% on Mac
2671
2672         Reverted changeset:
2673
2674         "We should have a more concise way of determining when we're
2675         varargs calling a function using rest parameters"
2676         https://bugs.webkit.org/show_bug.cgi?id=164258
2677         http://trac.webkit.org/changeset/208584
2678
2679 2016-11-11  Chris Dumez  <cdumez@apple.com>
2680
2681         Unreviewed, rolling out r208117 and r208160.
2682
2683         Regressed Speedometer by >1.5%
2684
2685         Reverted changesets:
2686
2687         "We should have a way of profiling when a get_by_id is pure
2688         and to emit a PureGetById in the DFG/FTL"
2689         https://bugs.webkit.org/show_bug.cgi?id=163305
2690         http://trac.webkit.org/changeset/208117
2691
2692         "Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing
2693         out"
2694         https://bugs.webkit.org/show_bug.cgi?id=164227
2695         http://trac.webkit.org/changeset/208160
2696
2697 2016-11-11  Saam Barati  <sbarati@apple.com>
2698
2699         We should have a more concise way of determining when we're varargs calling a function using rest parameters
2700         https://bugs.webkit.org/show_bug.cgi?id=164258
2701
2702         Reviewed by Yusuke Suzuki.
2703
2704         * microbenchmarks/call-using-spread.js: Added.
2705         (bar):
2706         (foo):
2707         * microbenchmarks/spread-large-array.js: Added.
2708         (foo):
2709         (arrays.push):
2710         * microbenchmarks/spread-small-array.js: Added.
2711         (foo):
2712         * stress/spread-array-iterator-watchpoint-2.js: Added.
2713         (foo):
2714         (arrayIterator.next):
2715         * stress/spread-array-iterator-watchpoint.js: Added.
2716         (foo):
2717         (Array.prototype.Symbol.iterator):
2718         * stress/spread-non-array.js: Added.
2719         (assert):
2720         (foo):
2721         (let.customIterator.Symbol.iterator):
2722         (bar):
2723
2724 2016-11-10  Mark Lam  <mark.lam@apple.com>
2725
2726         Fix broken have-a-bad-time-with-arguments.js test.
2727         https://bugs.webkit.org/show_bug.cgi?id=164626
2728
2729         Reviewed by Filip Pizlo.
2730
2731         But also saved a copy of the broken one as broken-have-a-bad-time-with-arguments-for-gc-testing.js
2732         because coincidentally, it stresses the GC in ways that help reveal bugs.
2733
2734         * stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js: Added.
2735         (testFunction):
2736         (warmupFunction):
2737         (let.argsDeclIndex.in.argumentsDecls.let.indexToReturnIndex.in.indicesToReturn.let.insertElementActionIndex.in.insertElementActions.let.tierWarmupCountIndex.in.tierWarmupCounts.let.testArgsIndex.in.testArgsList.catch):
2738         * stress/have-a-bad-time-with-arguments.js:
2739
2740 2016-11-10  JF Bastien  <jfbastien@apple.com>
2741
2742         ASSERTION FAILED: length > offset encountered with wasm.yaml/wasm/js-api/test_Module.js.default-wasm
2743         https://bugs.webkit.org/show_bug.cgi?id=164597
2744
2745         Reviewed by Keith Miller.
2746
2747         Trim the array buffer before returning it: it's optimistically
2748         over-allocated to avoid growing all the time, but when parsed it
2749         can't have extra content.
2750
2751         * wasm/Builder_WebAssemblyBinary.js:
2752         (export.const.Binary):
2753         * wasm/LowLevelBinary.js:
2754         (export.default.LowLevelBinary.prototype.get return):
2755
2756 2016-11-10  Joseph Pecoraro  <pecoraro@apple.com>
2757
2758         test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
2759         https://bugs.webkit.org/show_bug.cgi?id=164450
2760
2761         Reviewed by Darin Adler.
2762
2763         * stress/dataview-typedarray-toindex.js: Added.
2764         Tests for all cases where ToIndex should be used.
2765
2766         * test262.yaml:
2767         New passing tests.
2768
2769 2016-11-10  Mark Lam  <mark.lam@apple.com>
2770
2771         Graph::methodOfGettingAValueProfileFor() should be returning the profile for the operand node.
2772         https://bugs.webkit.org/show_bug.cgi?id=164600
2773         <rdar://problem/28828676>
2774
2775         Reviewed by Filip Pizlo.
2776
2777         * stress/osr-exit-on-op-negate-should-no-fail-assertions.js: Added.
2778
2779 2016-11-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2780
2781         [JSC] Avoid cloned arguments allocation in ArrayPrototype methods
2782         https://bugs.webkit.org/show_bug.cgi?id=164502
2783
2784         Reviewed by Saam Barati.
2785
2786         * stress/argument-intrinsic-basic.js: Added.
2787         (shouldBe):
2788         (builtin.createBuiltin):
2789         * stress/argument-intrinsic-inlining-with-result-escape.js: Added.
2790         (shouldBe):
2791         (builtin.createBuiltin):
2792         (escape):
2793         * stress/argument-intrinsic-nested-inlining.js: Added.
2794         (shouldBe):
2795         (builtin.createBuiltin):
2796         (builtinCaller1):
2797         (builtinCaller2):
2798         (escape):
2799         * stress/argument-intrinsic-not-convert-to-get-argument.js: Added.
2800         (shouldBe):
2801         (builtin.createBuiltin):
2802         * stress/argument-intrinsic-with-stack-write.js: Added.
2803         (shouldBe):
2804         (builtin.createBuiltin):
2805
2806 2016-11-09  Saam Barati  <sbarati@apple.com>
2807
2808         Math.min()/Math.max() with no arguments is lowered incorrectly in the BytecodeParser
2809         https://bugs.webkit.org/show_bug.cgi?id=164464
2810         <rdar://problem/29131452>
2811
2812         Reviewed by Darin Adler.
2813
2814         * stress/math-max-min-no-arguments.js: Added.
2815         (assert):
2816         (min):
2817         (max):
2818         (test):
2819
2820 2016-11-09  Saam Barati  <sbarati@apple.com>
2821
2822         TypeProfiler and running GC collection on another thread don't play nicely with each other
2823         https://bugs.webkit.org/show_bug.cgi?id=164441
2824         <rdar://problem/29132174>
2825
2826         Reviewed by Geoffrey Garen.
2827
2828         * typeProfiler/type-profiler-gc.js: Added.
2829         (bar):
2830         (foo):
2831
2832 2016-11-04  Mark Lam  <mark.lam@apple.com>
2833
2834         Error description code should be able to handle Symbol values.
2835         https://bugs.webkit.org/show_bug.cgi?id=164436
2836         <rdar://problem/29115583>
2837
2838         Reviewed by Filip Pizlo and Saam Barati.
2839
2840         * stress/error-description-on-symbols-should-not-crash.js: Added.
2841
2842 2016-11-03  Geoffrey Garen  <ggaren@apple.com>
2843
2844         EvalCodeCache should not give up in strict mode and other cases
2845         https://bugs.webkit.org/show_bug.cgi?id=164357
2846
2847         Reviewed by Michael Saboff.
2848
2849         * microbenchmarks/eval-cached.js: Added. 45x faster now.
2850         * stress/eval-cached.js: Added. Try running the same eval text in a bunch
2851         of different scopes and verify that we access the right scope.
2852
2853 2016-11-04  JF Bastien  <jfbastien@apple.com>
2854
2855         WebAssembly JS API: implement more sections
2856         https://bugs.webkit.org/show_bug.cgi?id=164023
2857
2858         Reviewed by Keith Miller.
2859
2860         On the JSC side:
2861
2862          - Put in parser stubs for all WebAssembly sections.
2863          - Parse Import, Export sections.
2864          - Use tryReserveCapacity instead of reserve, and bail out of the parser if it fails. This prevents the parser from bringing everything down when faced with a malicious input.
2865          - Encapsulate all parsed module information into its own structure, making it easier to pass around (from parser to Plan to Module to Instance).
2866          - Create WasmFormat.cpp to hold parsed module information's dtor to avoid including WasmMemory.h needlessly.
2867          - parseCode: avoid overflow through function size.
2868          - Remove all remainders of polyfill-prototype-1, and update license.
2869          - Add missing WasmOps.h and WasmValidateInlines.h auto-generation for cmake build.
2870
2871         On the Builder.js testing side:
2872
2873          - Implement Type, Import (function only), Export (function only) sections.
2874          - Check section order and uniqueness.
2875          - Optionally auto-generate the Type section from subsequent Export / Import / Code entries.
2876          - Allow re-exporting an import.
2877
2878         * wasm/Builder.js: build type, import, and export sections
2879         (const._normalizeFunctionSignature):
2880         * wasm/Builder_WebAssemblyBinary.js: Added. Forked from Builder.js
2881         (const.emitters.Type):
2882         (const.emitters.Import):
2883         (const.emitters.Function):
2884         (const.emitters.Table):
2885         (const.emitters.Memory):
2886         (const.emitters.Global):
2887         (const.emitters.Export):
2888         (const.emitters.Start):
2889         (const.emitters.Element):
2890         (const.emitters.Code):
2891         (const.emitters.Data):
2892         (export.const.Binary):
2893         * wasm/LowLevelBinary.js: Add a few useful outputs
2894         (export.default.LowLevelBinary.prototype.varuint1):
2895         (export.default.LowLevelBinary.prototype.varint7):
2896         * wasm/WASM.js: value type and external kind helpers
2897         * wasm/assert.js: array element-wise equality comparison
2898         (const._eq):
2899         * wasm/js-api/test_Module.js:
2900         (ModuleWithImports):
2901         * wasm/self-test/test_BuilderJSON.js: many more tests for all the new Builder APIs, and update to some older tests which now require a Type section or rejiggered Function signature
2902         (const.assertOpThrows):
2903         (SectionsWithSameCustomName):
2904         (TwoTypeSections):
2905         (EmptyImportSection):
2906         (ImportBeforeTypeSections):
2907         * wasm/self-test/test_BuilderWebAssembly.js: remove a test which wasn't helpful and is now obsolete
2908         (CustomSection):
2909
2910 2016-11-03  Mark Lam  <mark.lam@apple.com>
2911
2912         ClonedArguments need to also support haveABadTime mode.
2913         https://bugs.webkit.org/show_bug.cgi?id=164200
2914         <rdar://problem/27211336>
2915
2916         Reviewed by Geoffrey Garen.
2917
2918         * stress/have-a-bad-time-with-arguments.js: Added.
2919
2920 2016-11-03  Filip Pizlo  <fpizlo@apple.com>
2921
2922         DFG plays fast and loose with the shadow values of a Phi
2923         https://bugs.webkit.org/show_bug.cgi?id=164309
2924
2925         Reviewed by Saam Barati.
2926         
2927         This test demonstrates why the DFG needs to recognize the shadow value of a Phi.
2928
2929         * stress/dfg-ssa-swap.js: Added.
2930         (foo):
2931
2932 2016-11-03  Commit Queue  <commit-queue@webkit.org>
2933
2934         Unreviewed, rolling out r208364.
2935         https://bugs.webkit.org/show_bug.cgi?id=164402
2936
2937         broke the build (Requested by smfr on #webkit).
2938
2939         Reverted changeset:
2940
2941         "DFG plays fast and loose with the shadow values of a Phi"
2942         https://bugs.webkit.org/show_bug.cgi?id=164309
2943         http://trac.webkit.org/changeset/208364
2944
2945 2016-11-03  Filip Pizlo  <fpizlo@apple.com>
2946
2947         DFG plays fast and loose with the shadow values of a Phi
2948         https://bugs.webkit.org/show_bug.cgi?id=164309
2949
2950         Reviewed by Saam Barati.
2951         
2952         This test demonstrates why the DFG needs to recognize the shadow value of a Phi.
2953
2954         * stress/dfg-ssa-swap.js: Added.
2955         (foo):
2956
2957 2016-11-03  Saam Barati  <sbarati@apple.com>
2958
2959         Asking for a value profile prediction should be defensive against not finding a value profile
2960         https://bugs.webkit.org/show_bug.cgi?id=164306
2961
2962         Reviewed by Mark Lam.
2963
2964         * stress/inlined-tail-call-in-inlined-setter-should-not-crash-when-getting-value-profile.js: Added.
2965         (let.o.set foo):
2966         (bar):
2967
2968 2016-11-02  Saam Barati  <sbarati@apple.com>
2969
2970         Allocation elimination of rest parameter doesn't take into account indexed properties on Array.prototype/Object.prototype
2971         https://bugs.webkit.org/show_bug.cgi?id=164301
2972
2973         Reviewed by Geoffrey Garen.
2974
2975         * stress/rest-parameter-allocation-elimination-watchpoints-2.js: Added.
2976         (assert):
2977         (foo):
2978         * stress/rest-parameter-allocation-elimination-watchpoints-3.js: Added.
2979         (assert):
2980         (foo):
2981         * stress/rest-parameter-allocation-elimination-watchpoints-4.js: Added.
2982         (assert):
2983         (foo):
2984         * stress/rest-parameter-allocation-elimination-watchpoints-5.js: Added.
2985         (assert):
2986         (foo):
2987         * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Added.
2988         (assert):
2989         (foo):
2990         * stress/rest-parameter-allocation-elimination-watchpoints.js: Added.
2991         (assert):
2992         (foo):
2993
2994 2016-11-01  Saam Barati  <sbarati@apple.com>
2995
2996         We should be able to eliminate rest parameter allocations
2997         https://bugs.webkit.org/show_bug.cgi?id=163925
2998
2999         Reviewed by Filip Pizlo.
3000
3001         * microbenchmarks/rest-parameter-allocation-elimination.js: Added.
3002         (assert):
3003         (test1.bar):
3004         (test1):
3005         (test2.jaz):
3006         (test2.jaz2.kaz):
3007         (test2.jaz2):
3008         (test2):
3009         (test3.foo):
3010         (test3.baz):
3011         (test3.jaz):
3012         (test3):
3013         (test4.baz):
3014         (test4.jaz):
3015         (test4):
3016         (test5.baz):
3017         (test5.jaz):
3018         (test5):
3019         (test6.baz):
3020         (test6.jaz):
3021         (test6):
3022         (test7.baz):
3023         (test7.jaz):
3024         (test7.check):
3025         (test7):
3026         (test8.baz):
3027         (test8.jaz):
3028         (test8.check):
3029         (test8):
3030         (test9.baz):
3031         (test9.jaz):
3032         (test9.check):
3033         (test9):
3034         (test10.baz):
3035         (test10.jaz):
3036         (test10):
3037         (test11.bar):
3038         (test11.foo):
3039         (test11.makeArguments):
3040         (test11.):
3041         (test12):
3042         (test12.bar):
3043         (test12.foo):
3044         (test12.makeArguments):
3045         (test12.):
3046         (test13.bar):
3047         (test13.top):
3048         (test13.foo):
3049         (test13.makeArguments):
3050         (test13.):
3051         (test13):
3052         (test14.bar):
3053         (test14.top):
3054         (test14.foo):
3055         (test14.makeArguments):
3056         (test14.):
3057         (test14):
3058         (test15.bar):
3059         (test15.top):
3060         (test15.foo):
3061         (test15.makeArguments):
3062         (test15.):
3063         (test15):
3064
3065 2016-11-01  Commit Queue  <commit-queue@webkit.org>
3066
3067         Unreviewed, rolling out r208208 and r208210.
3068         https://bugs.webkit.org/show_bug.cgi?id=164276
3069
3070         This change caused 28 JSC test failures. (Requested by
3071         ryanhaddad on #webkit).
3072
3073         Reverted changesets:
3074
3075         "We should be able to eliminate rest parameter allocations"
3076         https://bugs.webkit.org/show_bug.cgi?id=163925
3077         http://trac.webkit.org/changeset/208208
3078
3079         "Fix the EFL build."
3080         http://trac.webkit.org/changeset/208210
3081
3082 2016-10-31  Filip Pizlo  <fpizlo@apple.com>
3083
3084         JSC should support SharedArrayBuffer
3085         https://bugs.webkit.org/show_bug.cgi?id=163986
3086
3087         Reviewed by Keith Miller.
3088         
3089         This adds our own test for the various corner cases of SharedArrayBuffer. This test is meant to
3090         check all of the things that don't require concurrency.
3091
3092         * stress/SharedArrayBuffer.js: Added.
3093         (checkAtomics):
3094         (shouldFail):
3095         (Symbol):
3096         (runAtomic):
3097
3098 2016-10-31  Saam Barati  <sbarati@apple.com>
3099
3100         We should be able to eliminate rest parameter allocations
3101         https://bugs.webkit.org/show_bug.cgi?id=163925
3102
3103         Reviewed by Filip Pizlo.
3104
3105         * microbenchmarks/rest-parameter-allocation-elimination.js: Added.
3106         (assert):
3107         (test1.bar):
3108         (test1):
3109         (test2.jaz):
3110         (test2.jaz2.kaz):
3111         (test2.jaz2):
3112         (test2):
3113         (test3.foo):
3114         (test3.baz):
3115         (test3.jaz):
3116         (test3):
3117         (test4.baz):
3118         (test4.jaz):
3119         (test4):
3120         (test5.baz):
3121         (test5.jaz):
3122         (test5):
3123         (test6.baz):
3124         (test6.jaz):
3125         (test6):
3126         (test7.baz):
3127         (test7.jaz):
3128         (test7.check):
3129         (test7):
3130         (test8.baz):
3131         (test8.jaz):
3132         (test8.check):
3133         (test8):
3134         (test9.baz):
3135         (test9.jaz):
3136         (test9.check):
3137         (test9):
3138         (test10.baz):
3139         (test10.jaz):
3140         (test10):
3141         (test11.bar):
3142         (test11.foo):
3143         (test11.makeArguments):
3144         (test11.):
3145         (test12):
3146         (test12.bar):
3147         (test12.foo):
3148         (test12.makeArguments):
3149         (test12.):
3150         (test13.bar):
3151         (test13.top):
3152         (test13.foo):
3153         (test13.makeArguments):
3154         (test13.):
3155         (test13):
3156         (test14.bar):
3157         (test14.top):
3158         (test14.foo):
3159         (test14.makeArguments):
3160         (test14.):
3161         (test14):
3162         (test15.bar):
3163         (test15.top):
3164         (test15.foo):
3165         (test15.makeArguments):
3166         (test15.):
3167         (test15):
3168
3169 2016-10-31  Saam Barati  <sbarati@apple.com>
3170
3171         Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing out
3172         https://bugs.webkit.org/show_bug.cgi?id=164227
3173
3174         Unreviewed timeout fix.
3175
3176         * microbenchmarks/pure-get-by-id-cse-2.js:
3177
3178 2016-10-31  Keith Miller  <keith_miller@apple.com>
3179
3180         autogenerated files from wasm.json should be in derived sources.
3181         https://bugs.webkit.org/show_bug.cgi?id=164152
3182
3183         Reviewed by Filip Pizlo.
3184
3185         Delete generation script since it is no longer used.
3186
3187         * wasm/generate-wasmops-header.js: Removed.
3188
3189 2016-10-29  Yusuke Suzuki  <utatane.tea@gmail.com>
3190
3191         [JSC] JSON.stringify should handle Proxy which is non JSArray but isArray is true
3192         https://bugs.webkit.org/show_bug.cgi?id=164123
3193
3194         Reviewed by Mark Lam.
3195
3196         * stress/json-stringify-with-non-jsarray-array.js: Added.
3197         (shouldBe):
3198         (shouldBe.JSON.stringify.new.Proxy):
3199
3200 2016-10-29  Saam Barati  <sbarati@apple.com>
3201
3202         We should have a way of profiling when a get_by_id is pure and to emit a PureGetById in the DFG/FTL
3203         https://bugs.webkit.org/show_bug.cgi?id=163305
3204
3205         Reviewed by Keith Miller.
3206
3207         * microbenchmarks/pure-get-by-id-cse-2.js: Added.
3208         (foo):
3209         * microbenchmarks/pure-get-by-id-cse.js: Added.
3210         (foo):
3211         * stress/pure-get-by-id-cse-correctness.js: Added.
3212         (assert):
3213         (foo):
3214         * stress/pure-get-by-id-on-non-object.js: Added.
3215         (assert):
3216         (foo):
3217
3218 2016-10-28  Csaba Osztrogonác  <ossy@webkit.org>
3219
3220         Skip JSTests/microbenchmarks/dense-set.js on memory limited devices
3221         https://bugs.webkit.org/show_bug.cgi?id=164128
3222
3223         Reviewed by Mark Lam.
3224
3225         * microbenchmarks/dense-set.js:
3226
3227 2016-10-20  Caitlin Potter  <caitp@igalia.com>
3228
3229         [JSC] implement runtime for async functions
3230         https://bugs.webkit.org/show_bug.cgi?id=163760
3231
3232         Reviewed by Yusuke Suzuki.
3233
3234         * stress/async-await-basic.js: Added.
3235         (shouldBe):
3236         (shouldBeAsync):
3237         (shouldThrow):
3238         (shouldThrowAsync):
3239         (shouldThrowSyntaxError):
3240         (let.AsyncFunction.async):
3241         (async.asyncFunctionForProto):
3242         (Object.getPrototypeOf.async):
3243         (Object.getPrototypeOf.async.method):
3244         (async):
3245         (async.method):
3246         (async.asyncNonConstructorDecl):
3247         (shouldThrow.new.async):
3248         (shouldThrow.new.async.nonConstructor):
3249         (async.asyncDecl):
3250         (async.f):
3251         (MyError):
3252         (async.asyncDeclThrower):
3253         (shouldThrowAsync.async):
3254         (resolveLater):
3255         (rejectLater):
3256         (async.resumeAfterNormal):
3257         (O.async.resumeAfterNormal):
3258         (resumeAfterNormalArrow.async):
3259         (async.resumeAfterThrow):
3260         (O.async.resumeAfterThrow):
3261         (resumeAfterThrowArrow.async):
3262         (catch):
3263         * stress/async-await-module-reserved-word.js: Added.
3264         (shouldThrow):
3265         (SyntaxError.Canstring_appeared_hereawait.checkModuleSyntaxError.String.raw.await):
3266         (checkModuleSyntaxError.String.raw.await):
3267         (checkModuleSyntaxError.String.raw.async.await):
3268         (SyntaxError.Cannot.declare.named):
3269         * stress/async-await-mozilla.js: Added.
3270         (shouldBe):
3271         (shouldBeAsync):
3272         (shouldThrow):
3273         (shouldThrowAsync):
3274         (assert):
3275         (shouldThrowSyntaxError):
3276         (mozSemantics.async.empty):
3277         (mozSemantics.async.simpleReturn):
3278         (mozSemantics.async.simpleAwait):
3279         (mozSemantics.async.simpleAwaitAsync):
3280         (mozSemantics.async.returnOtherAsync):
3281         (mozSemantics.async.simpleThrower):
3282         (mozSemantics.async.delegatedThrower):
3283         (mozSemantics.async.tryCatch):
3284         (mozSemantics.async.tryCatchThrow):
3285         (mozSemantics.async.wellFinally):
3286         (mozSemantics.async.finallyMayFail):
3287         (mozSemantics.async.embedded.async.inner):
3288         (mozSemantics.async.embedded):
3289         (mozSemantics.async.fib):
3290         (mozSemantics.async.isOdd.async.isEven):
3291         (mozSemantics.async.isOdd):
3292         (mozSemantics.hardcoreFib.async.fib2):
3293         (mozSemantics.namedAsyncExpr.async.simple):
3294         (mozSemantics.async.executionOrder.async.first):
3295         (mozSemantics.async.executionOrder.async.second):
3296         (mozSemantics.async.executionOrder.async.third):
3297         (mozSemantics.async.executionOrder):
3298         (mozSemantics.async.miscellaneous):
3299         (mozSemantics.thrower):
3300         (mozSemantics.async.defaultArgs):
3301         (mozSemantics.shouldThrow):
3302         (mozSemantics):
3303         (mozMethods.X):
3304         (mozMethods.X.prototype.async.getValue):
3305         (mozMethods.X.prototype.setValue):
3306         (mozMethods.X.prototype.async.increment):
3307         (mozMethods.X.prototype.async.getBaseClassName):
3308         (mozMethods.X.async.getStaticValue):
3309         (mozMethods.Y.prototype.async.getBaseClassName):
3310         (mozMethods.Y):
3311         (mozFunctionNameInferrence.async.test):
3312         (mozSyntaxErrors):
3313         * stress/async-await-reserved-word.js: Added.
3314         (assert):
3315         (shouldThrowSyntaxError):
3316         (AsyncFunction.async):
3317         * stress/async_arrow_functions_lexical_arguments_binding.js: Added.
3318         (shouldBe):
3319         (shouldBeAsync):
3320         (shouldThrowAsync):
3321         (noArgumentsArrow2.async):
3322         * stress/async_arrow_functions_lexical_new.target_binding.js: Added.
3323         (shouldBe):
3324         (shouldBeAsync):
3325         (shouldThrowAsync):
3326         (C1):
3327         (C2):
3328         (shouldThrowAsync.async):
3329         * stress/async_arrow_functions_lexical_super_binding.js: Added.
3330         (shouldBe):
3331         (shouldBeAsync):
3332         (BaseClass.prototype.baseClassValue):
3333         (BaseClass.prototype.get property):
3334         (BaseClass):
3335         (ChildClass.prototype.asyncSuperProp):
3336         (ChildClass.prototype.asyncSuperProp2):
3337         (ChildClass):
3338         (ChildClass2):
3339         * stress/async_arrow_functions_lexical_this_binding.js: Added.
3340         (shouldBe):
3341         (shouldBeAsync):
3342         (d.y):
3343
3344 2016-10-28  Csaba Osztrogonác  <ossy@webkit.org>
3345
3346         Skip 2 JS stress tests on memory limited devices
3347         https://bugs.webkit.org/show_bug.cgi?id=164125
3348
3349         Unreviewed quick fix to unbreak JSCOnly ARM bots as soon as possible.
3350
3351         * stress/joined-strings-should-not-exceed-max-string-length.js:
3352         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
3353
3354 2016-10-27  Caitlin Potter  <caitp@igalia.com>
3355
3356         [JSC] forbid lexical redeclaration of generator formal parameters
3357         https://bugs.webkit.org/show_bug.cgi?id=163930
3358
3359         Reviewed by Yusuke Suzuki.
3360
3361         * stress/async-await-syntax.js:
3362         * stress/generator-syntax.js:
3363         (testSyntaxError.gen):
3364         (testSyntaxError.arguments):
3365         (testSyntaxError.eval):
3366         * test262.yaml:
3367
3368 2016-10-26  JF Bastien  <jfbastien@apple.com>
3369
3370         WebAssembly API: implement Instance
3371
3372         As described in: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-objects
3373
3374          - Take ownership of Wasm::Plan's compilation result when successfully creating a JSWebAssemblyModule object.
3375          - Construct a basic Instance with a Module.
3376          - Handle second argument (importObject) of WebAssembly.Instance.
3377          - Add reference text from the spec to WebAssembly.Module's code.
3378          - Expose and test an empty 'exports' ModuleNamespaceObject on WebAssembly.Instance.
3379
3380         The implementation isn't complete yet: it relies on further work for which I've filed bugs.
3381
3382         WebAssembly API: implement Instance
3383         https://bugs.webkit.org/show_bug.cgi?id=163998
3384
3385         Reviewed by Keith Miller.
3386
3387         * wasm/js-api/test_Instance.js: Added.
3388         (EmptyModule): use the Builder, create the simplest Module possible, and create an Instance from it
3389         * wasm/js-api/test_basic_api.js:
3390         (const.c.in.constructorProperties.switch): basic tests of the API
3391
3392 2016-10-26  Mark Lam  <mark.lam@apple.com>
3393
3394         JSGenericTypedArrayView::set() should check for exceptions.
3395         https://bugs.webkit.org/show_bug.cgi?id=164007
3396         <rdar://problem/28853775>
3397
3398         Reviewed by Filip Pizlo.
3399
3400         * stress/typed-array-view-set-should-not-crash-on-exception.js: Added.
3401
3402 2016-10-25  Mark Lam  <mark.lam@apple.com>
3403
3404         String.prototype.replace() should throw an OutOfMemoryError when using too much memory.
3405         https://bugs.webkit.org/show_bug.cgi?id=163996
3406         <rdar://problem/28263117>
3407
3408         Reviewed by Geoffrey Garen.
3409
3410         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js: Added.
3411
3412 2016-10-25  Mark Lam  <mark.lam@apple.com>
3413
3414         JSStringJoiner::joinedLength() should limit joined string lengths to INT_MAX.
3415         https://bugs.webkit.org/show_bug.cgi?id=163937
3416         <rdar://problem/28642990>
3417
3418         Reviewed by Geoffrey Garen.
3419
3420         * stress/joined-strings-should-not-exceed-max-string-length.js: Added.
3421
3422 2016-10-25  JF Bastien  <jfbastien@apple.com>
3423
3424         WebAssembly JS API: simple Module test
3425         https://bugs.webkit.org/show_bug.cgi?id=163963
3426
3427         Reviewed by Filip Pizlo.
3428
3429         * wasm/LowLevelBinary.js:
3430         (export.default.LowLevelBinary.prototype.get return): get the ArrayBuffer
3431         (export.default.LowLevelBinary.prototype.hexdump): Deleted.
3432         (export.default.LowLevelBinary.prototype._maybeGrow): Deleted.
3433         * wasm/js-api/test_Module.js: Added.
3434         (EmptyModule): The most basic module possible
3435
3436 2016-10-25  JF Bastien  <jfbastien@apple.com>
3437
3438         WebAssembly JS API: implement Module
3439
3440         This implementation allows us to:
3441          - Syncrhonously create a WebAssembly.Module with a typed array.
3442          - Creates a compilation plan.
3443          - Parse the Module and creates corresponding code.
3444          - Throw WebAssembly.CompileError with mildly helpful [*] error messages on
3445            failure.
3446
3447         Consult the API documentation for expected behavior: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodule-constructor
3448
3449         For now the implementation discards the generated code.
3450
3451         The next steps will be:
3452          - Expose a Module's exports.
3453          - Implement WebAssembly.Instance, which allows instantiating and running a
3454            compiled Module.
3455          - Beef up the testing infrastructure under JSTests/wasm so that more complex
3456            modules can be created and tested (instead of writing the bits by hand).
3457
3458         This patch also:
3459          - Adds assert.instanceof in assert.js.
3460          - Refactors Wasm::Parser and friends to accept const uint8_t* as well as a
3461            Vector, to avoid copying when invoked synchronously.
3462          - Remove useless Structure from some of the wasm constructors: they're already
3463            on the JSGlobalObject, visited properly and all.
3464          - Fix off-by-one error in parsing: Parser::parseUInt32 failed if the integer
3465            was exactly at end of file.
3466
3467          [*] On error messages while parsing: I filed https://bugs.webkit.org/show_bug.cgi?id=163919
3468
3469         WebAssembly JS API: implement Module
3470         https://bugs.webkit.org/show_bug.cgi?id=163903
3471
3472         Reviewed by Keith Miller.
3473
3474         * wasm/assert.js: use underscore in name, and remove when exporting to avoid clasing with builtin names
3475         (const._notUndef):
3476         (const._isUndef):
3477         (const._eq):
3478         (const._ge):
3479         (const._throws):
3480         * wasm/js-api/test_basic_api.js: test the WebAssembly.Module API
3481         (const.c.in.constructorProperties.switch):
3482
3483 2016-10-25  Keith Miller  <keith_miller@apple.com>
3484
3485         Add trivial Wasm conversion opcodes
3486         https://bugs.webkit.org/show_bug.cgi?id=163950
3487
3488         Reviewed by Filip Pizlo.
3489
3490         This patch differentiates between Wasm opcodes that are trivially mapped to a B3 opcode and
3491         those that are not.  Some of the Wasm opcodes that are currently a non-simple opcode will
3492         become simple as we add B3 opcodes for Wasm operations.  The remaining opcodes will need to
3493         be added via patchpoints in a later patch.
3494
3495         * wasm/generate-wasmops-header.js:
3496         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.Wasm.inline.bool.isSimple):
3497         * wasm/wasm.json:
3498
3499 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3500
3501         Arrow functions with concise bodies cannot return regular expressions
3502         https://bugs.webkit.org/show_bug.cgi?id=163162
3503
3504         Reviewed by Filip Pizlo.
3505
3506         * ChakraCore/test/Operators/instanceof.baseline-jsc:
3507         * ChakraCore/test/Regex/nul_character.baseline-jsc:
3508         * ChakraCore/test/es5/Lex_u3.baseline-jsc:
3509         * stress/parse-regexp-as-token.js: Added.
3510         (shouldBe):
3511
3512 2016-10-24  Keith Miller  <keith_miller@apple.com>
3513
3514         Wasm should support floating point operations.
3515         https://bugs.webkit.org/show_bug.cgi?id=163770
3516
3517         Reviewed by Michael Saboff.
3518
3519         Add appropriate b3op names for floating point wasm bytecodes, where they exist.
3520         Also, fix some WASM => Wasm in WasmOps.h generator script that I missed
3521         the first time I made the change.
3522
3523         * wasm/generate-wasmops-header.js:
3524         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.template.typename.Int.inline.bool.isValidOpType): Deleted.
3525         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.BinaryOpType): Deleted.
3526         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.UnaryOpType): Deleted.
3527         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.LoadOpType): Deleted.
3528         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.StoreOpType): Deleted.
3529         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.undef.CREATE_ENUM_VALUE.inline.bool.isControlOp): Deleted.
3530         * wasm/wasm.json:
3531
3532 2016-10-21  Saam Barati  <sbarati@apple.com>
3533
3534         SpeculativeJIT::compileTryGetById needs to pass in NeedsToSpill along both the cell speculation and untyped speculation path
3535         https://bugs.webkit.org/show_bug.cgi?id=163622
3536
3537         Reviewed by Yusuke Suzuki.
3538
3539         * stress/try-get-by-id-should-spill-registers-dfg.js: Added.
3540         (let.f.createBuiltin):
3541
3542 2016-10-21  Caitlin Potter  <caitp@igalia.com>
3543
3544         [JSC] don't crash when arguments to `new Function()` produce unexpected AST
3545         https://bugs.webkit.org/show_bug.cgi?id=163748
3546
3547         Reviewed by Mark Lam.
3548
3549         * stress/regress-163748.js: Added.
3550         (assert):
3551         (shouldThrowSyntaxError):
3552         (GeneratorFunction):
3553
3554 2016-10-20  Keith Miller  <keith_miller@apple.com>
3555
3556         Add support for WASM calls
3557         https://bugs.webkit.org/show_bug.cgi?id=161727
3558
3559         Reviewed by Filip Pizlo and Michael Saboff.
3560
3561         Add members of the Call category to the WASMOps special group.
3562
3563         * wasm/generate-wasmops-header.js:
3564
3565 2016-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3566
3567         [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
3568         https://bugs.webkit.org/show_bug.cgi?id=163761
3569
3570         Reviewed by Keith Miller.
3571
3572         * modules/string-prototype-module-scope.js: Added.
3573         (shouldBe):
3574         (catch):
3575         (refer):
3576         * stress/string-prototype-scopes-global-lexical-environment-strict.js: Added.
3577         (shouldBe):
3578         (catch):
3579         * stress/string-prototype-scopes-global-lexical-environment.js: Added.
3580         (shouldBe):
3581         (catch):
3582         * stress/string-prototype-scopes-strict.js: Added.
3583         (shouldBe):
3584         (catch):
3585         (try.refer):
3586         (refer):
3587         * stress/string-prototype-scopes.js: Added.
3588         (shouldBe):
3589         (catch):
3590         (try.refer):
3591         (refer):
3592         (object.toString):
3593         (with):
3594
3595 2016-10-20  JF Bastien  <jfbastien@apple.com>
3596
3597         WebAssembly API: implement exception constructors properly
3598
3599          - Rename WebAssemblyObject to JSWebAssembly for consistency.
3600          - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
3601            use it to register JSWebAssembly's function properties through auto-generated
3602            .lut.h, instead of manually.
3603          - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
3604          - Register WebAssembly's constructors from the global object, and hold a
3605            reference to their structure and prototype so that invoking the constructor
3606            can use the structure directly from the global object.
3607          - Add a prototype base field to global object creation. Previous ones all had
3608            Object's prototype as their base, but WebAssembly's error constructors have
3609            Error as their base.
3610          - Test for the error object's correctness.
3611          - Add missing #if ENABLE(WEBASSEMBLY)
3612
3613         WebAssembly API: implement exception constructors properly
3614         https://bugs.webkit.org/show_bug.cgi?id=163699
3615
3616         Reviewed by Keith Miller.
3617
3618         * wasm/js-api/test_basic_api.js:
3619         (const.c.in.constructorProperties): more tests
3620
3621 2016-10-20  Caitlin Potter  <caitp@igalia.com>
3622
3623         [JSC] disallow references to `await` in AsyncFunction formal parameters
3624         https://bugs.webkit.org/show_bug.cgi?id=163694
3625
3626         Reviewed by Saam Barati.
3627
3628         * stress/async-await-syntax.js:
3629
3630 2016-10-20  Keith Miller  <keith_miller@apple.com>
3631
3632         Invalid assertion in arguments elimination
3633         https://bugs.webkit.org/show_bug.cgi?id=163740
3634         <rdar://problem/27911462>
3635
3636         Reviewed by Michael Saboff.
3637
3638         * stress/direct-arguments-osr-entry.js: Added.
3639         (foo.):
3640         (foo):
3641
3642 2016-10-20  Caitlin Potter  <caitp@igalia.com>
3643
3644         [JSC] throw TypeError when constructing dynamically created JSGeneratorFunction
3645         https://bugs.webkit.org/show_bug.cgi?id=163714
3646
3647         Reviewed by Mark Lam.
3648
3649         Add missing test coverage that dynamically created
3650         JSGeneratorFunctions can not be constructed.
3651
3652         * stress/generator-function-constructor.js:
3653         (shouldThrow):
3654
3655 2016-10-19  JF Bastien  <jfbastien@apple.com>
3656
3657         JavaScript WebAssembly API: baby steps
3658
3659          - Expand WebAssembly constructors into their own files. This requires a lot of
3660            boilerplate, as well as adding the .lut.h files. All of the
3661            JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
3662            currently the same between the 4 specified WebAssembly constructors. It'll be
3663            easy to implement individual functions on constructed objects as per the
3664            spec, and have each of these files diverge. The error constructors are also
3665            similar, except that their instance derives from ErrorInstance.
3666          - Use constructor macro when initializing the global object.
3667          - Dramatically improve testing of the WebAssembly API by checking for
3668            properties specified in the spec [*].
3669          - Clean up assert.js' exception testing.
3670          - Fix a copy-paste bug in wasm.json: floating-point const return values were
3671            swapped.
3672
3673         [*] https://github.com/WebAssembly/design/blob/master/JS.md
3674
3675         Implement more of the JavaScript WebAssembly API
3676         https://bugs.webkit.org/show_bug.cgi?id=163571
3677
3678         Reviewed by Keith Miller.
3679
3680         * wasm/assert.js:
3681         (export.const.isUndef): add this useful helper
3682         (export.const.throws): fold other throw checks into this one, and check message as well
3683         * wasm/js-api/test_basic_api.js:
3684         (const.checkOwnPropertyDescriptor): check own property descriptor follows the spec
3685         * wasm/self-test/test_BuilderJSON.js:
3686         (const.assertOpThrows): use new assert API
3687         (CheckedOpcodeArgumentsTooMany): ditto
3688         (CheckedOpcodeArgumentsNotEnough): ditto
3689         (CallInvalid): ditto
3690         (I32ConstInvalid): ditto
3691         (F32ConstInvalid): ditto (and this caugth the JSON copy-paste bug)
3692         (F64ConstInvalid): ditto
3693         * wasm/self-test/test_LowLevelBinary_varint.js: use new assert API
3694         * wasm/self-test/test_LowLevelBinary_varuint.js: use new assert API
3695         * wasm/utilities.js: add "global" object, used in basic API test (to access global.WebAssembly).
3696         * wasm/wasm.json: fix copy-paste
3697
3698 2016-10-19  Caitlin Potter  <caitp@igalia.com>
3699
3700         [JSC] forbid "use strict" directive in generator functions with non-simple parameters
3701         https://bugs.webkit.org/show_bug.cgi?id=163683
3702
3703         Reviewed by Geoffrey Garen.
3704
3705         Update various generator*-non-simple-param.js tests to be passing.
3706
3707         * test262.yaml: