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