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