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