e011b442c37aaf2dfadad329430aab1f10df2be1
[WebKit-https.git] / JSTests / ChangeLog
1 2017-01-25  Saam Barati  <sbarati@apple.com>
2
3         WebAssembly JS API: coerce return values from imports
4         https://bugs.webkit.org/show_bug.cgi?id=165480
5         <rdar://problem/29760318>
6
7         Reviewed by Yusuke Suzuki.
8
9         * wasm/function-tests/function-import-return-value.js: Added.
10         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.const.tests.x.assert.eq):
11         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.const.tests.Math.fround):
12         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.let.type.of.Reflect.ownKeys):
13         (test.1):
14         (assert.truthy):
15         (assert.throws):
16
17 2017-01-25  Filip Pizlo  <fpizlo@apple.com>
18
19         jsc.cpp should have the $.agent stuff for testing SAB
20         https://bugs.webkit.org/show_bug.cgi?id=167431
21
22         Reviewed by Saam Barati.
23         
24         Add a very basic test of Atomics using $.agent. This is based on
25         LayoutTests/workers/sab/simple.html.
26
27         * stress/lars-sab-workers.js: Added.
28         (startWorker):
29         (resources):
30         (wake):
31         (else):
32
33 2017-01-24  Filip Pizlo  <fpizlo@apple.com>
34
35         Atomics.store should return the int-converted value according to toInteger
36         https://bugs.webkit.org/show_bug.cgi?id=167399
37
38         Reviewed by Saam Barati.
39
40         * stress/atomics-add-uint32.js: Added.
41         * stress/atomics-store-return.js: Fix the test to match what the spec wants.
42
43 2017-01-24  Yusuke Suzuki  <utatane.tea@gmail.com>
44
45         [JSC] Optimize Number#toString with Int52
46         https://bugs.webkit.org/show_bug.cgi?id=167303
47
48         Reviewed by Sam Weinig.
49
50         * stress/to-string-with-int52.js: Added.
51         (shouldBe):
52
53 2017-01-24  Filip Pizlo  <fpizlo@apple.com>
54
55         Atomics.store should return the int-converted value, not the value that it stored
56         https://bugs.webkit.org/show_bug.cgi?id=167395
57
58         Reviewed by Saam Barati.
59
60         * stress/atomics-store-return.js: Added.
61
62 2017-01-24  Filip Pizlo  <fpizlo@apple.com>
63
64         -0 is a valid array index and AtomicsObject should know this
65         https://bugs.webkit.org/show_bug.cgi?id=167386
66
67         Reviewed by Mark Lam.
68
69         * stress/atomics-neg-zero.js: Added.
70
71 2017-01-23  Saam Barati  <sbarati@apple.com>
72
73         https://bugs.webkit.org/show_bug.cgi?id=167247
74         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
75         <rdar://problem/30121809>
76
77         Reviewed by Filip Pizlo.
78
79         * stress/spread-consults-correct-global-object.js: Added.
80         (assert):
81         (spread):
82         * stress/spread-correct-global-object-on-exception.js: Added.
83         (assert):
84         (spread):
85         (const.objectText.let.o.Symbol.iterator):
86         (catch):
87
88 2017-01-21  Yusuke Suzuki  <utatane.tea@gmail.com>
89
90         dynamic import is ambiguous with import declaration at module code
91         https://bugs.webkit.org/show_bug.cgi?id=167098
92
93         Reviewed by Darin Adler.
94
95         * modules/import-call.js: Added.
96         (from.string_appeared_here.import.string_appeared_here.then):
97         * modules/import-call/main.js: Added.
98         * stress/import-syntax.js:
99         (async):
100
101 2017-01-19  Skachkov Oleksandr  <gskachkov@gmail.com>
102
103         "this" missing after await in async arrow function
104         https://bugs.webkit.org/show_bug.cgi?id=166919
105
106         Reviewed by Saam Barati.
107
108         * stress/async-arrow-functions-lexical-binding-in-class.js:
109         (ChildClass.prototype.asyncThisPropWithAwaitBody):
110         (ChildClass.prototype.asyncThisPropInEvalWithAwaitBody):
111         (ChildClass.prototype.asyncThisValueBodyWithAwait):
112         (ChildClass.prototype.asyncThisValueInEvalWithAwaitBody):
113         (ChildClass):
114         (ChildClass3):
115         (ChildClass3.prototype.classValue):
116         (ChildClass3.prototype.get classProperty):
117         * stress/async-arrow-functions-lexical-new.target-binding.js:
118         (C2WithAwait):
119
120 2017-01-16  Filip Pizlo  <fpizlo@apple.com>
121
122         Make opaque root scanning truly constraint-based
123         https://bugs.webkit.org/show_bug.cgi?id=165760
124
125         Reviewed by Geoffrey Garen.
126         
127         Added this test, which demonstrates the benefit of having a dedicated string subspace.
128
129         * microbenchmarks/stringalloc.js: Added.
130
131 2017-01-17  Michael Saboff  <msaboff@apple.com>
132
133         Nested parenthesized regular expressions with non-zero minimum counts appear to hang and use lots of memory
134         https://bugs.webkit.org/show_bug.cgi?id=167125
135
136         Reviewed by Filip Pizlo.
137
138         * microbenchmarks/regexp-nested-nonzero-min-counted-parens.js: Added.
139         New test with limits that run slow and take a reasonable amount of memory
140         before the change and run fast, using little memory with the change.
141
142 2017-01-14  Yusuke Suzuki  <utatane.tea@gmail.com>
143
144         Annotate large string tests with largeHeap
145         https://bugs.webkit.org/show_bug.cgi?id=167054
146
147         Reviewed by Filip Pizlo.
148
149         * microbenchmarks/dense-set.js:
150         * microbenchmarks/lots-of-fields.js:
151         * stress/joined-strings-should-not-exceed-max-string-length.js:
152         * stress/make-large-string-jit-strcat.js:
153         * stress/make-large-string-jit.js:
154         * stress/make-large-string-strcat.js:
155         * stress/make-large-string.js:
156         * stress/string-joining-long-strings-should-not-crash.js:
157         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
158
159 2017-01-14  Yusuke Suzuki  <utatane.tea@gmail.com>
160
161         Reserve capacity for StringBuilder in unescape
162         https://bugs.webkit.org/show_bug.cgi?id=167008
163
164         Reviewed by Sam Weinig.
165
166         * stress/unescape.js: Added.
167         (shouldBe):
168
169 2017-01-12  Saam Barati  <sbarati@apple.com>
170
171         Add a slice intrinsic to the DFG/FTL
172         https://bugs.webkit.org/show_bug.cgi?id=166707
173         <rdar://problem/29913445>
174
175         Reviewed by Filip Pizlo.
176
177         * stress/array-slice-intrinsic.js: Added.
178         (assert):
179         (shallowEq):
180         (runTest1):
181         (runTest2):
182         * stress/array-slice-jettison-on-constructor-change.js: Added.
183         (assert):
184         (runTest1):
185         (runTest2):
186         (addRandomProperties):
187         (runTests):
188         * stress/array-slice-osr-exit-2.js: Added.
189         (assert):
190         (Foo):
191         (shallowEq):
192         (runTest1):
193         (runTest2):
194         (addRandomProperties):
195         (runTests):
196         * stress/array-slice-osr-exit.js: Added.
197         (assert):
198         (Foo):
199         (shallowEq):
200         (runTest1):
201         (runTest2):
202         (addRandomProperties):
203         (runTests):
204
205 2017-01-11  Ryan Haddad  <ryanhaddad@apple.com>
206
207         Mark es6/typed_arrays_correct_prototype_chains.js as failing after r210570.
208         https://bugs.webkit.org/show_bug.cgi?id=166931i
209
210         Unreviewed test gardening.
211
212         * es6.yaml:
213
214 2017-01-10  Commit Queue  <commit-queue@webkit.org>
215
216         Unreviewed, rolling out r210052.
217         https://bugs.webkit.org/show_bug.cgi?id=166915
218
219         "breaks web compatability" (Requested by keith_miller on
220         #webkit).
221
222         Reverted changeset:
223
224         "Add support for global"
225         https://bugs.webkit.org/show_bug.cgi?id=165171
226         http://trac.webkit.org/changeset/210052
227
228 2017-01-10  Mark Lam  <mark.lam@apple.com>
229
230         Property setters should not be called for bound arguments list entries.
231         https://bugs.webkit.org/show_bug.cgi?id=165631
232
233         Reviewed by Filip Pizlo.
234
235         * stress/property-setters-should-not-be-called-for-bound-arguments-list-entries.js: Added.
236
237 2017-01-10  Skachkov Oleksandr  <gskachkov@gmail.com>
238
239         Calling async arrow function which is in a class's member function will cause error
240         https://bugs.webkit.org/show_bug.cgi?id=166879
241
242         Reviewed by Saam Barati.
243
244         * stress/async-arrow-functions-lexical-binding-in-class.js: Added.
245         (shouldBe):
246         (shouldBeAsync):
247         (BaseClass.prototype.baseClassValue):
248         (BaseClass.prototype.get property):
249         (BaseClass):
250         (runSomething):
251         (ChildClass.prototype.classValue):
252         (ChildClass.prototype.get classProperty):
253         (ChildClass.prototype.asyncValueExp):
254         (ChildClass.prototype.asyncValueBody):
255         (ChildClass.prototype.asyncThisPropExp):
256         (ChildClass.prototype.asyncThisPropBody):
257         (ChildClass.prototype.asyncThisPropInEvalExp):
258         (ChildClass.prototype.asyncThisPropInEvalBody):
259         (ChildClass.prototype.asyncThisValueExp):
260         (ChildClass.prototype.asyncThisValueBody):
261         (ChildClass.prototype.asyncThisValueInEvalExp):
262         (ChildClass.prototype.asyncThisValueInEvalBody):
263         (ChildClass):
264         (ChildClass2):
265         (ChildClass2.prototype.classValue):
266         (ChildClass2.prototype.get classProperty):
267         * stress/async-arrow-functions-lexical-super-binding.js:
268
269 2017-01-09  Yusuke Suzuki  <utatane.tea@gmail.com>
270
271         [JSC] Prototype dynamic-import
272         https://bugs.webkit.org/show_bug.cgi?id=165724
273
274         Reviewed by Saam Barati.
275
276         * stress/import-basic.js: Added.
277         (async.async.load):
278         (async):
279         (catch):
280         * stress/import-from-eval.js: Added.
281         (async):
282         (catch):
283         * stress/import-syntax.js: Added.
284         (testSyntaxError):
285         * stress/import-tests/cocoa.js: Added.
286         (export.Cocoa):
287         (export.hello):
288         * stress/import-tests/multiple.js: Added.
289         (export.result):
290         * stress/import-tests/multiple2.js: Added.
291         (export.ok):
292         * stress/import-tests/should.js: Added.
293         (export.shouldBe):
294         (export.shouldThrow):
295         * stress/modules-syntax-error.js:
296
297 2017-01-09  Commit Queue  <commit-queue@webkit.org>
298
299         Unreviewed, rolling out r210476.
300         https://bugs.webkit.org/show_bug.cgi?id=166859
301
302         "4% JSBench regression" (Requested by keith_mi_ on #webkit).
303
304         Reverted changeset:
305
306         "Add a slice intrinsic to the DFG/FTL"
307         https://bugs.webkit.org/show_bug.cgi?id=166707
308         http://trac.webkit.org/changeset/210476
309
310 2017-01-06  Saam Barati  <sbarati@apple.com>
311
312         Add a slice intrinsic to the DFG/FTL
313         https://bugs.webkit.org/show_bug.cgi?id=166707
314
315         Reviewed by Filip Pizlo.
316
317         * stress/array-slice-intrinsic.js: Added.
318         (assert):
319         (shallowEq):
320         (runTest1):
321         (runTest2):
322         * stress/array-slice-jettison-on-constructor-change.js: Added.
323         (assert):
324         (runTest1):
325         (runTest2):
326         (addRandomProperties):
327         (runTests):
328         * stress/array-slice-osr-exit-2.js: Added.
329         (assert):
330         (Foo):
331         (shallowEq):
332         (runTest1):
333         (runTest2):
334         (addRandomProperties):
335         (runTests):
336         * stress/array-slice-osr-exit.js: Added.
337         (assert):
338         (Foo):
339         (shallowEq):
340         (runTest1):
341         (runTest2):
342         (addRandomProperties):
343         (runTests):
344
345 2017-01-06  Michael Saboff  <msaboff@apple.com>
346
347         @putByValDirect in Array.of and Array.from overwrites non-writable/configurable properties
348         https://bugs.webkit.org/show_bug.cgi?id=153486
349
350         Reviewed by Saam Barati.
351
352         New regression test.
353
354         * stress/regress-153486.js: Added.
355         (shouldEqual):
356         (makeUnwriteableUnconfigurableObject):
357         (testArrayOf):
358         (testArrayFrom):
359         (runTest):
360
361 2016-12-30  Filip Pizlo  <fpizlo@apple.com>
362
363         DeferGC::~DeferGC should be super cheap
364         https://bugs.webkit.org/show_bug.cgi?id=166626
365
366         Reviewed by Saam Barati.
367
368         * stress/slow-path-generator-updating-current-node-dfg.js:
369         * stress/unshift-array-storage.js:
370
371 2017-01-04  JF Bastien  <jfbastien@apple.com>
372
373         WebAssembly: sections with the same name are allowed
374         https://bugs.webkit.org/show_bug.cgi?id=166708
375
376         Reviewed by Saam Barati.
377
378         * wasm/self-test/test_BuilderJSON.js:
379         (SectionsWithSameCustomName):
380
381 2017-01-04  Saam Barati  <sbarati@apple.com>
382
383         stress/spread-calling.js timing out on the bots
384         https://bugs.webkit.org/show_bug.cgi?id=166689
385         <rdar://problem/29779182>
386
387         Reviewed by Mark Lam.
388
389         * stress/spread-calling.js:
390
391 2017-01-04  JF Bastien  <jfbastien@apple.com>
392
393         WebAssembly JS API: add Module.sections
394         https://bugs.webkit.org/show_bug.cgi?id=165159
395         <rdar://problem/29760326>
396
397         Reviewed by Mark Lam.
398
399         As described here: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodulecustomsections
400
401         * wasm/Builder.js: allow custom sections to be duplicated
402         * wasm/js-api/Module.customSection.js: Added.
403         (assert.throws.WebAssembly.Module.prototype.customSections):
404         (assert.eq):
405
406 2017-01-04  Saam Barati  <sbarati@apple.com>
407
408         We don't properly handle exceptions inside the nativeCallTrampoline macro in the LLInt
409         https://bugs.webkit.org/show_bug.cgi?id=163720
410
411         Reviewed by Mark Lam.
412
413         * stress/bound-function-tail-call-with-exception.js: Added.
414         (bar):
415         (foo):
416         (catch):
417
418 2017-01-03  JF Bastien  <jfbastien@apple.com>
419
420         WebAssembly JS API: check and test in-call / out-call values
421         https://bugs.webkit.org/show_bug.cgi?id=164876
422         <rdar://problem/29844107>
423
424         Reviewed by Saam Barati.
425
426         * wasm.yaml:
427         * wasm/assert.js: add an assert for NaN comparison
428         * wasm/fuzz/export-function.js: Added. Generate random wasm export
429         signatures, and call them with random parameters.
430         (const.paramExporter):
431         (const.setBuffer):
432         (const.types.generate):
433         (generate):
434         * wasm/js-api/export-arity.js: Added.
435         (const.paramExporter): Test that mismatched arities when JS calls
436         wasm follow the defined semantics: i32 is 0, f32 / f64 are NaN.
437         https://github.com/WebAssembly/design/blob/master/JS.md#exported-function-exotic-objects
438         * wasm/js-api/export-void-is-undef.js: Added. Test that "void"
439         wasm functions return "undefined" in JS.
440
441 2017-01-02  JF Bastien  <jfbastien@apple.com>
442
443         WebAssembly: handle and optimize wasm export → wasm import calls
444         https://bugs.webkit.org/show_bug.cgi?id=165282
445
446         Reviewed by Saam Barati.
447
448         * wasm/Builder.js: Add a Proxy to Builder.js, which intercepts
449         unknown property lookups. This creates way better error messages
450         on typos than 'undefined is not a function', which happens
451         semi-frequently as I typo opcode names (and which one is a typo is
452         hard to find because we chain builders).
453         (const._isValidValue):
454         (get target):
455         (const._importFunctionContinuation):
456         (const._importMemoryContinuation):
457         (const._importTableContinuation):
458         (const._exportFunctionContinuation):
459         (export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
460         (export.default.Builder.prototype._registerSectionBuilders.this.Unknown):
461         * wasm/LowLevelBinary.js: Add limited support for var{u}int64 (only the 32-bit values)
462         (export.default.LowLevelBinary.prototype.varint32):
463         (export.default.LowLevelBinary.prototype.varuint64):
464         (export.default.LowLevelBinary.prototype.varint64):
465         * wasm/function-tests/exceptions.js: update error message
466         * wasm/function-tests/trap-load.js: update error message
467         * wasm/function-tests/trap-store.js: update error message
468         * wasm/js-api/wasm-to-wasm-bad-signature.js: Added. Test a bunch of bad wasm->wasm import signatures
469         (const.makeImportee.signature.switch):
470         (BadSignatureDropStartParams):
471         * wasm/js-api/wasm-to-wasm.js: Added. Test 64-bit wasm->wasm import calls
472         (const.callerModule):
473         (const.calleeModule):
474         (WasmToWasm):
475
476 2017-01-02  Saam Barati  <sbarati@apple.com>
477
478         WebAssembly: Some loads don't take into account the offset
479         https://bugs.webkit.org/show_bug.cgi?id=166616
480         <rdar://problem/29841541>
481
482         Reviewed by Keith Miller.
483
484         * wasm/function-tests/load-offset.js: Added.
485
486 2016-12-29  Saam Barati  <sbarati@apple.com>
487
488         WebAssembly: Rebase spec-tests now that wabt has been updated to produce certain kinds of invalid modules
489         https://bugs.webkit.org/show_bug.cgi?id=166491
490         <rdar://problem/29814999>
491
492         Reviewed by Yusuke Suzuki.
493
494         Based off these revisions:
495         - spec: b055d01ea1dfdd7a5231ae779095435f836de97f
496         - wabt: d0d44702c753f851b094615298a2f4d4e3c21035
497
498         The reason for the rebase is that wabt was updated to stop
499         silently rejecting invalid modules. This was needed because
500         some of the spec tests check to make sure that the module
501         is invalid, but wabt was silently ignoring the errors and
502         generating valid modules:
503         https://github.com/WebAssembly/wabt/issues/256
504
505         * wasm.yaml:
506         * wasm/spec-tests/address.wast.js:
507         * wasm/spec-tests/binary.wast.js:
508         * wasm/spec-tests/block.wast.js:
509         * wasm/spec-tests/br.wast.js:
510         * wasm/spec-tests/br_if.wast.js:
511         * wasm/spec-tests/br_table.wast.js:
512         * wasm/spec-tests/break-drop.wast.js:
513         * wasm/spec-tests/call.wast.js:
514         * wasm/spec-tests/call_indirect.wast.js:
515         * wasm/spec-tests/comments.wast.js:
516         * wasm/spec-tests/conversions.wast.js:
517         * wasm/spec-tests/custom_section.wast.js:
518         * wasm/spec-tests/endianness.wast.js:
519         * wasm/spec-tests/exports.wast.js:
520         * wasm/spec-tests/f32.wast.js:
521         * wasm/spec-tests/f32_cmp.wast.js:
522         * wasm/spec-tests/f64.wast.js:
523         * wasm/spec-tests/f64_cmp.wast.js:
524         * wasm/spec-tests/fac.wast.js:
525         * wasm/spec-tests/float_exprs.wast.js:
526         * wasm/spec-tests/float_literals.wast.js:
527         * wasm/spec-tests/float_memory.wast.js:
528         * wasm/spec-tests/float_misc.wast.js:
529         * wasm/spec-tests/forward.wast.js:
530         * wasm/spec-tests/func.wast.js:
531         * wasm/spec-tests/func_ptrs.wast.js:
532         * wasm/spec-tests/get_local.wast.js:
533         * wasm/spec-tests/globals.wast.js:
534         * wasm/spec-tests/i32.wast.js:
535         * wasm/spec-tests/i64.wast.js:
536         * wasm/spec-tests/imports.wast.js:
537         * wasm/spec-tests/int_exprs.wast.js:
538         * wasm/spec-tests/int_literals.wast.js:
539         * wasm/spec-tests/left-to-right.wast.js:
540         * wasm/spec-tests/linking.wast.js:
541         * wasm/spec-tests/loop.wast.js:
542         * wasm/spec-tests/memory.wast.js:
543         * wasm/spec-tests/memory_redundancy.wast.js:
544         * wasm/spec-tests/memory_trap.wast.js:
545         * wasm/spec-tests/names.wast.js:
546         * wasm/spec-tests/nop.wast.js:
547         * wasm/spec-tests/resizing.wast.js:
548         * wasm/spec-tests/return.wast.js:
549         * wasm/spec-tests/select.wast.js:
550         * wasm/spec-tests/set_local.wast.js:
551         * wasm/spec-tests/skip-stack-guard-page.wast.js:
552         * wasm/spec-tests/stack.wast.js:
553         * wasm/spec-tests/start.wast.js:
554         * wasm/spec-tests/store_retval.wast.js:
555         * wasm/spec-tests/switch.wast.js:
556         * wasm/spec-tests/tee_local.wast.js:
557         * wasm/spec-tests/traps.wast.js:
558         * wasm/spec-tests/typecheck.wast.js:
559         * wasm/spec-tests/unreachable.wast.js:
560         * wasm/spec-tests/unwind.wast.js:
561
562 2016-12-28  Saam Barati  <sbarati@apple.com>
563
564         WebAssembly: Don't allow duplicate export names
565         https://bugs.webkit.org/show_bug.cgi?id=166490
566         <rdar://problem/29815000>
567
568         Reviewed by Keith Miller.
569
570         * wasm.yaml:
571         * wasm/function-tests/invalid-duplicate-export.js: Added.
572
573 2016-12-28  Saam Barati  <sbarati@apple.com>
574
575         WebAssembly: Implement grow_memory and current_memory
576         https://bugs.webkit.org/show_bug.cgi?id=166448
577         <rdar://problem/29803676>
578
579         Reviewed by Keith Miller.
580
581         I rewrote some of the testWasmModuleFunctions that used Memory to use
582         the JS API since the jsc.cpp version can no longer use memory.
583
584         * wasm.yaml:
585         * wasm/function-tests/add-12.js:
586         (testWasmModuleFunctions):
587         * wasm/function-tests/br-if-loop-less-than.js:
588         (testWasmModuleFunctions):
589         * wasm/function-tests/brTableAsIf.js:
590         (testWasmModuleFunctions):
591         * wasm/function-tests/brTableManyValues.js:
592         (testWasmModuleFunctions):
593         * wasm/function-tests/brTableWithLoop.js:
594         (testWasmModuleFunctions):
595         * wasm/function-tests/dumb-eq-if-then-else.js:
596         * wasm/function-tests/eqz.js:
597         * wasm/function-tests/grow-memory-2.js: Added.
598         (const.func):
599         (assert.eq.instance.exports.foo):
600         * wasm/function-tests/grow-memory-3.js: Added.
601         * wasm/function-tests/grow-memory-4.js: Added.
602         (const.func):
603         * wasm/function-tests/grow-memory.js: Added.
604         (binaryShouldNotParse):
605         (assert.truthy):
606         (assert.eq):
607         (memory.grow):
608         * wasm/function-tests/i32-load.js:
609         (testWasmModuleFunctions):
610         * wasm/function-tests/i32-load8-s.js:
611         * wasm/function-tests/max.js:
612         * wasm/function-tests/min.js:
613         * wasm/js-api/memory-grow.js: Added.
614         (i.i):
615         (assertEq):
616         * wasm/js-api/test_memory.js:
617         * wasm/wasm.json:
618
619 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
620
621         Propagate the source origin as much as possible
622         https://bugs.webkit.org/show_bug.cgi?id=166348
623
624         Reviewed by Darin Adler.
625
626         * stress/source-origin.js: Added.
627         (shouldBe):
628
629 2016-12-24  Caio Lima  <ticaiolima@gmail.com>
630
631         [test262] Fixing mapped arguments object property test case
632         https://bugs.webkit.org/show_bug.cgi?id=159398
633
634         Reviewed by Saam Barati.
635
636         * stress/arguments-bizarre-behaviour-disable-enumerability.js:
637         * stress/arguments-define-property.js: Added.
638         (assert):
639         (testProperties):
640         * stress/arguments-non-configurable.js: Added.
641         (assert):
642         (tryChangeNonConfigurableDescriptor):
643         (set tryChangeNonConfigurableDescriptor):
644         (tryChangeWritableOfNonConfigurableDescriptor):
645         * test262.yaml:
646
647 016-12-20  Caio Lima  <ticaiolima@gmail.com>
648
649         [test262] Fixing mapped arguments object property test case
650         https://bugs.webkit.org/show_bug.cgi?id=159398
651
652         Reviewed by .
653
654         * stress/arguments-bizarre-behaviour-disable-enumerability.js:
655         * stress/arguments-define-property.js: Added.
656         (assert):
657         (testProperties):
658         * stress/arguments-non-configurable.js: Added.
659         (assert):
660         (tryChangeNonConfigurableDescriptor):
661         (set tryChangeNonConfigurableDescriptor):
662         (tryChangeWritableOfNonConfigurableDescriptor):
663         * test262.yaml:
664
665 2016-12-23  Keith Miller  <keith_miller@apple.com>
666
667         WebAssembly: trap on bad division.
668         https://bugs.webkit.org/show_bug.cgi?id=164786
669
670         Reviewed by Mark Lam.
671
672         Also, mark conversions as passing.
673
674         * wasm.yaml:
675         * wasm/wasm.json:
676
677 2016-12-22  Keith Miller  <keith_miller@apple.com>
678
679         WebAssembly: Make spec-tests/f32.wast.js and spec-tests/f64.wast.js pass
680         https://bugs.webkit.org/show_bug.cgi?id=166447
681
682         Reviewed by Saam Barati.
683
684         * wasm.yaml:
685         * wasm/wasm.json:
686
687 2016-12-22  Saam Barati  <sbarati@apple.com>
688
689         WebAssembly: Make calling Wasm functions that returns or takes an i64 as a parameter an early exception
690         https://bugs.webkit.org/show_bug.cgi?id=166437
691         <rdar://problem/29793949>
692
693         Reviewed by Keith Miller.
694
695         * wasm.yaml:
696         * wasm/function-tests/i64-from-js-exceptions.js: Added.
697         (const.imp.import.sideEffects):
698         (assert.throws.instance.exports.foo.valueOf):
699
700 2016-12-22  Mark Lam  <mark.lam@apple.com>
701
702         De-duplicate finally blocks.
703         https://bugs.webkit.org/show_bug.cgi?id=160168
704
705         Reviewed by Saam Barati.
706
707         Re-landing r209952 with a few new tests added in test-finally.js.
708
709         * stress/deeply-nested-finallys.js: Copied from JSTests/stress/deeply-nested-finallys.js.
710         - Tests many levels of finally nesting.  This causes the old code to hang (and
711           crashes eventually) while trying to generate bytecode for the exponentially
712           duplicated finally blocks.  The new code completes this test almost instantly.
713
714         * stress/test-finally.js: Copied from JSTests/stress/test-finally.js.
715         - Tests control flow through various permutations of finally blocks.
716
717 2016-12-22  Saam Barati  <sbarati@apple.com>
718
719         WebAssembly: Make the spec-tests/address.wast.js test pass
720         https://bugs.webkit.org/show_bug.cgi?id=166429
721         <rdar://problem/29793220>
722
723         Reviewed by Keith Miller.
724
725         * wasm.yaml:
726
727 2016-12-22  Keith Miller  <keith_miller@apple.com>
728
729         WebAssembly: The validator should not allow unused stack entries at the end of a block
730         https://bugs.webkit.org/show_bug.cgi?id=166411
731
732         Reviewed by Saam Barati.
733
734         Test cleanup and enable new passing tests.
735
736         * wasm.yaml:
737         * wasm/function-tests/br-if-as-return.js:
738
739 2016-12-22  Saam Barati  <sbarati@apple.com>
740
741         WebAssembly: Make the spec-tests/start.wast.js test pass
742         https://bugs.webkit.org/show_bug.cgi?id=166416
743         <rdar://problem/29784532>
744
745         Reviewed by Yusuke Suzuki.
746
747         * wasm.yaml:
748
749 2016-12-21  Keith Miller  <keith_miller@apple.com>
750
751         WebAssembly: Fix decode floating point constants in unreachable code
752         https://bugs.webkit.org/show_bug.cgi?id=166400
753
754         Reviewed by Saam Barati.
755
756         * wasm.yaml:
757
758 2016-12-21  Keith Miller  <keith_miller@apple.com>
759
760         WebAssembly: Allow br, br_if, and br_table to act as a return
761         https://bugs.webkit.org/show_bug.cgi?id=166393
762
763         Reviewed by Saam Barati.
764
765         Add tests for breaks acting as returns and fix tests that
766         validate error messages.
767
768         * wasm/function-tests/br-as-return.js: Added.
769         * wasm/function-tests/br-if-as-return.js: Added.
770         * wasm/function-tests/br-table-as-return.js: Added.
771         * wasm/function-tests/if-no-else-non-void.js:
772         * wasm/function-tests/struct.js: Added.
773         * wasm/js-api/global-error.js:
774         (assert.throws):
775         * wasm/js-api/table.js:
776         (assert.throws):
777
778 2016-12-21  Saam Barati  <sbarati@apple.com>
779
780         WebAssembly: Import spec tests
781         https://bugs.webkit.org/show_bug.cgi?id=166395
782
783         Rubber stamped by Keith Miller.
784
785         This patch implements the Wasm spec's tests found here:
786         https://github.com/WebAssembly/spec/tree/master/interpreter/test
787         
788         These tests are in .wast s-epxression format. To convert
789         them to JS, I use a script from the wabt library, found here:
790         https://github.com/WebAssembly/wabt/blob/master/test/run-gen-spec-js.py
791         
792         I also added a script that automatically imports the tests as
793         JS files. The inputs to the script is the path to the Wasm spec
794         git repo and the path to the wabt git repo. This will make importing
795         new tests easy in the future.
796
797         The wasm spec imported is at commit: b055d01ea1dfdd7a5231ae779095435f836de97f
798         The wabt used to do the import is at commit: 622b42dced6d793e9d49e9b1fd1d1524defd1387
799
800         * wasm.yaml:
801         * wasm/import-spec-tests.rb: Added.
802         * wasm/spec-tests: Added.
803         * wasm/spec-tests/address.wast.js: Added.
804         (register):
805         (module):
806         (instance):
807         (assert_malformed):
808         (assert_invalid):
809         (assert_soft_invalid):
810         (assert_unlinkable):
811         (assert_uninstantiable):
812         (assert_trap):
813         (assert_return):
814         (assert_return_nan):
815         * wasm/spec-tests/binary.wast.js: Added.
816         (register):
817         (module):
818         (instance):
819         (assert_malformed):
820         (assert_invalid):
821         (assert_soft_invalid):
822         (assert_unlinkable):
823         (assert_uninstantiable):
824         (assert_trap):
825         (assert_return):
826         (assert_return_nan):
827         * wasm/spec-tests/block.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/br.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/br_if.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_table.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/break-drop.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/call.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/call_indirect.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/comments.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/conversions.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/custom_section.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/endianness.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/exports.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/f32.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/f32_cmp.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/f64.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/f64_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/fac.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/float_exprs.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/float_literals.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_memory.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_misc.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/forward.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/func.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/func_ptrs.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/get_local.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/globals.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/i32.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/i64.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/imports.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/int_exprs.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/int_literals.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/left-to-right.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/linking.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/loop.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/memory.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/memory_redundancy.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_trap.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/names.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/nop.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/resizing.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/return.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/select.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/set_local.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/skip-stack-guard-page.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/stack.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/start.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/store_retval.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/switch.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/tee_local.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/traps.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/typecheck.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/unreachable.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/unwind.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
1464 2016-12-20  Keith Miller  <keith_miller@apple.com>
1465
1466         Add support for global
1467         https://bugs.webkit.org/show_bug.cgi?id=165171
1468
1469         Reviewed by Filip Pizlo.
1470
1471         * stress/global.js: Added.
1472
1473 2016-12-20  JF Bastien  <jfbastien@apple.com>
1474
1475         WebAssembly API: implement WebAssembly.LinkError
1476         https://bugs.webkit.org/show_bug.cgi?id=165805
1477         <rdar://problem/29747874>
1478
1479         Reviewed by Mark lam.
1480
1481         Update all exception sites which now throw WebAssembly.LinkError.
1482
1483         * wasm/js-api/element-data.js:
1484         * wasm/js-api/element.js:
1485         (assert.throws):
1486         * wasm/js-api/global-error.js:
1487         (new.Number):
1488         * wasm/js-api/table.js:
1489         (assert.throws):
1490         (new.WebAssembly.Table):
1491         * wasm/js-api/test_Data.js:
1492         * wasm/js-api/test_basic_api.js:
1493         (const.c.in.constructorProperties.switch):
1494         * wasm/js-api/test_memory.js:
1495         (test):
1496         (test.testMemImportError): Deleted.
1497
1498 2016-12-20  JF Bastien  <jfbastien@apple.com>
1499
1500         WebAssembly: unique function signatures
1501         https://bugs.webkit.org/show_bug.cgi?id=165957
1502         <rdar://problem/29735737>
1503
1504         Reviewed by Saam Barati.
1505
1506         * wasm/function-tests/table-basic.js: FIXME is now addressed,
1507         though instance to instance calls still need work which bug
1508         #165282 will address
1509         (i.assert.eq.foo):
1510         * wasm/js-api/unique-signature.js: Added.
1511         (CallIndirectWithDuplicateSignatures):
1512
1513 2016-12-19  Mark Lam  <mark.lam@apple.com>
1514
1515         Rolling out r209974 and r209952. They break some websites in mysterious ways. Step 2: Rollout r209952.
1516         https://bugs.webkit.org/show_bug.cgi?id=166049
1517
1518         Not reviewed.
1519
1520         * stress/deeply-nested-finallys.js: Removed.
1521         * stress/test-finally.js: Removed.
1522
1523 2016-12-19  Saam Barati  <sbarati@apple.com>
1524
1525         WebAssembly: Make running Wasm tests take less time by reducing some tests' iteration count and by splitting some tests into different files
1526         https://bugs.webkit.org/show_bug.cgi?id=166017
1527
1528         Reviewed by Yusuke Suzuki.
1529
1530         * wasm/function-tests/trap-load-2.js: Added.
1531         (assert):
1532         (wasmFrameCountFromError):
1533         (continuation):
1534         (i.catch):
1535         * wasm/function-tests/trap-load.js:
1536         (assert.continuation): Deleted.
1537         * wasm/function-tests/trap-store-2.js: Added.
1538         (import.Builder.from.string_appeared_here.assert):
1539         (continuation):
1540         (i.catch):
1541         * wasm/function-tests/trap-store.js:
1542         (assert.continuation): Deleted.
1543         (assert): Deleted.
1544         * wasm/js-api/test_memory.js:
1545         (test):
1546
1547 2016-12-18  Saam Barati  <sbarati@apple.com>
1548
1549         WebAssembly: Implement the WebAssembly.compile and WebAssembly.validate
1550         https://bugs.webkit.org/show_bug.cgi?id=165936
1551
1552         Reviewed by Mark Lam.
1553
1554         * wasm/js-api/Module-compile.js: Added.
1555         (async.testPromiseAPI):
1556         * wasm/js-api/test_basic_api.js:
1557         (const.c.in.constructorProperties.switch):
1558         * wasm/js-api/validate.js: Added.
1559         (assert.truthy.WebAssembly.validate.builder.WebAssembly):
1560
1561 2016-12-16  Mark Lam  <mark.lam@apple.com>
1562
1563         De-duplicate finally blocks.
1564         https://bugs.webkit.org/show_bug.cgi?id=160168
1565
1566         Reviewed by Keith Miller.
1567
1568         * stress/deeply-nested-finallys.js: Added.
1569         - Tests many levels of finally nesting.  This causes the old code to hang (and
1570           crashes eventually) while trying to generate bytecode for the exponentially
1571           duplicated finally blocks.  The new code completes this test almost instantly.
1572
1573         * stress/test-finally.js: Added.
1574         - Tests control flow through various permutations of finally blocks.
1575
1576 2016-12-16  Saam Barati  <sbarati@apple.com>
1577
1578         WebAssembly: WasmB3IRGenerator should throw exceptions instead of crash
1579         https://bugs.webkit.org/show_bug.cgi?id=165834
1580
1581         Reviewed by Keith Miller.
1582
1583         * wasm/function-tests/exceptions.js: Added.
1584         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1585         * wasm/function-tests/table-basic.js:
1586         (i.i.42.throw.new.Error):
1587
1588 2016-12-16  Keith Miller  <keith_miller@apple.com>
1589
1590         i64.eqz should use an Int64 zero
1591         https://bugs.webkit.org/show_bug.cgi?id=165942
1592
1593         Reviewed by Mark Lam.
1594
1595         * wasm/wasm.json:
1596
1597 2016-12-15  Keith Miller  <keith_miller@apple.com>
1598
1599         Fix validation of non-void if blocks with no else
1600         https://bugs.webkit.org/show_bug.cgi?id=165938
1601
1602         Reviewed by Saam Barati.
1603
1604         Add a new failing test and a fix an existing one.
1605
1606         * wasm/function-tests/dead-call.js:
1607         * wasm/function-tests/if-no-else-non-void.js: Added.
1608
1609 2016-12-15  Keith Miller  <keith_miller@apple.com>
1610
1611         Wasm should not create empty unlinked callsites
1612         https://bugs.webkit.org/show_bug.cgi?id=165933
1613
1614         Reviewed by Mark Lam.
1615
1616         * wasm/function-tests/dead-call.js: Added.
1617
1618 2016-12-15  JF Bastien  <jfbastien@apple.com>
1619
1620         WebAssembly: improve compilation error messages
1621         https://bugs.webkit.org/show_bug.cgi?id=163919
1622
1623         Reviewed by Saam Barati.
1624
1625         Update error messages in these tests.
1626         Use the assert.throws facility in many of them which weren't already.
1627
1628         * wasm/js-api/element.js:
1629         (assert.throws.new.WebAssembly.Module.builder.WebAssembly):
1630         (assert.throws):
1631         * wasm/js-api/global-error.js:
1632         (assert.throws.new.WebAssembly.Module.bin):
1633         (assert.throws):
1634         (new.Number):
1635         * wasm/js-api/table.js:
1636         (assert.throws.new.WebAssembly.Module.builder.WebAssembly):
1637         (assert.throws):
1638         (assertBadTableImport):
1639         * wasm/js-api/test_Data.js:
1640         (DataSectionWithoutMemory):
1641         * wasm/js-api/test_Start.js:
1642         (InvalidStartFunctionIndex):
1643         * wasm/js-api/test_basic_api.js:
1644         (const.c.in.constructorProperties.switch):
1645
1646 2016-12-15  JF Bastien  <jfbastien@apple.com>
1647
1648         WebAssembly API: improve data section errors
1649         https://bugs.webkit.org/show_bug.cgi?id=165733
1650
1651         Reviewed by Keith Miller.
1652
1653         * wasm/js-api/element-data.js: Added.
1654         (ElementBeforeData.set const):
1655         (ElementBeforeData): check the order of initialization, which is observable on failure
1656         * wasm/js-api/test_Data.js:
1657         (DataSectionWithoutMemory):
1658         (DataSectionOffTheEnd): Deleted.
1659         (DataSectionPartlyOffTheEnd): Deleted.
1660         (DataSectionEmptyOffTheEnd): Deleted.
1661         (DataSectionSeenByStart): Deleted.
1662
1663 2016-12-15  Keith Miller  <keith_miller@apple.com>
1664
1665         Fix 64-bit shift family Wasm opcodes
1666         https://bugs.webkit.org/show_bug.cgi?id=165902
1667
1668         Reviewed by Geoffrey Garen.
1669
1670         Add tests for shift family of instructions. Since
1671         we can't generate i64 values to pass to wasm we only compile
1672         the code for those functions. Attempting to generate any i64
1673         code using these instructions would have been enough to cause
1674         the B3 Validation error anyway.
1675
1676         * wasm/assert.js:
1677         * wasm/function-tests/rotl.js: Added.
1678         * wasm/function-tests/rotr.js: Added.
1679         * wasm/function-tests/shl.js: Added.
1680         * wasm/function-tests/shr-s.js: Added.
1681         * wasm/function-tests/shr-u.js: Added.
1682         * wasm/wasm.json:
1683
1684 2016-12-14  Keith Miller  <keith_miller@apple.com>
1685
1686         WebAssembly: test_BuilderJSON.js is broken
1687         https://bugs.webkit.org/show_bug.cgi?id=165893
1688
1689         Reviewed by Michael Saboff.
1690
1691         * wasm/Builder.js:
1692         (const._isValidValue):
1693         * wasm/self-test/test_BuilderJSON.js:
1694
1695 2016-12-14  Keith Miller  <keith_miller@apple.com>
1696
1697         Unreviewed, fix test.
1698
1699         * wasm/function-tests/i32-const.js:
1700
1701 2016-12-14  Keith Miller  <keith_miller@apple.com>
1702
1703         Wasm should decode constants correctly
1704         https://bugs.webkit.org/show_bug.cgi?id=165886
1705
1706         Reviewed by Saam Barati.
1707
1708         * wasm/Builder.js:
1709         (const._isValidValue):
1710         * wasm/Builder_WebAssemblyBinary.js:
1711         (const.putOp):
1712         * wasm/LowLevelBinary.js:
1713         (export.default.LowLevelBinary.prototype.float):
1714         (export.default.LowLevelBinary.prototype.double):
1715         * wasm/function-tests/f32-const.js: Added.
1716         * wasm/function-tests/f64-const.js: Added.
1717         * wasm/function-tests/i32-const.js: Added.
1718         * wasm/wasm.json:
1719
1720 2016-12-14  Saam Barati  <sbarati@apple.com>
1721
1722         WebAssembly: Add various low hanging fruit that will allow us to run the LLVM torture tests in Wasm
1723         https://bugs.webkit.org/show_bug.cgi?id=165883
1724
1725         Reviewed by Keith Miller.
1726
1727         * wasm/Builder.js:
1728         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1729         * wasm/Builder_WebAssemblyBinary.js:
1730         (const.emitters.Export):
1731         * wasm/js-api/table.js:
1732         (assertBadBinary):
1733         (assertBadTable):
1734         (assert.truthy):
1735         * wasm/js-api/test_memory.js:
1736         (binaryShouldNotParse):
1737         (test):
1738         (test.testMemImportError):
1739         (assert.truthy):
1740         (assert): Deleted.
1741
1742 2016-12-14  Filip Pizlo  <fpizlo@apple.com>
1743
1744         DirectTailCall implementation needs to tell the shuffler what to put into the ArgumentCount explicitly
1745         https://bugs.webkit.org/show_bug.cgi?id=165882
1746
1747         Reviewed by Mark Lam.
1748
1749         * stress/direct-tail-call-arity-mismatch-count-args.js: Added.
1750         (foo):
1751         (bar):
1752
1753 2016-12-14  Keith Miller  <keith_miller@apple.com>
1754
1755         WebAssembly JS API: implement Global
1756         https://bugs.webkit.org/show_bug.cgi?id=164133
1757
1758         Reviewed by Saam Barati.
1759
1760         * wasm/Builder.js:
1761         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1762         * wasm/Builder_WebAssemblyBinary.js:
1763         (const.valueType.WASM.description.type.i32.type.const.putGlobalType):
1764         (const.putOp):
1765         (const.putInitExpr):
1766         (const.emitters.Import):
1767         (const.emitters.Global):
1768         (const.emitters.Export):
1769         (const.emitters.Code):
1770         * wasm/LowLevelBinary.js:
1771         (export.default.LowLevelBinary.prototype.varuint32):
1772         (export.default.LowLevelBinary.prototype.varint32):
1773         * wasm/js-api/global-error.js: Added.
1774         (catch):
1775         (assert.truthy):
1776         * wasm/js-api/global-external-init-from-import.js: Added.
1777         * wasm/js-api/global-internal-init-from-import.js: Added.
1778         * wasm/js-api/global-mutate.js: Added.
1779         (createInternalGlobalModule):
1780         * wasm/js-api/globals-export.js: Added.
1781         * wasm/js-api/globals-import.js: Added.
1782         * wasm/wasm.json:
1783
1784 2016-12-13  Saam Barati  <sbarati@apple.com>
1785
1786         WebAssembly: implement the elements section
1787         https://bugs.webkit.org/show_bug.cgi?id=165715
1788
1789         Reviewed by Keith Miller.
1790
1791         * wasm/Builder.js:
1792         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1793         (export.default.Builder.prototype._registerSectionBuilders.switch):
1794         * wasm/Builder_WebAssemblyBinary.js:
1795         (const.emitters.Element):
1796         * wasm/function-tests/basic-element.js: Added.
1797         * wasm/js-api/element.js: Added.
1798         (assertBadBinary):
1799         (assertBadBinary.badInstantiation):
1800
1801 2016-12-13  Saam Barati  <sbarati@apple.com>
1802
1803         WebAssembly: implement the table section and table import
1804         https://bugs.webkit.org/show_bug.cgi?id=165716
1805
1806         Reviewed by Keith Miller.
1807
1808         * wasm/Builder.js:
1809         (const._importMemoryContinuation):
1810         (const._importTableContinuation):
1811         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
1812         (const._importMemoryContinuation.section): Deleted.
1813         (const): Deleted.
1814         (const._importMemoryContinuation.assert): Deleted.
1815         * wasm/Builder_WebAssemblyBinary.js:
1816         (const.putResizableLimits):
1817         (const.putTable):
1818         (const.emitters.Import):
1819         (const.emitters.Table):
1820         * wasm/function-tests/call-indirect-params.js:
1821         * wasm/function-tests/call-indirect.js:
1822         * wasm/function-tests/table-basic-2.js: Added.
1823         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1824         (func):
1825         * wasm/function-tests/table-basic.js: Added.
1826         (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
1827         * wasm/js-api/call-indirect-results.js:
1828         (const.wasmModuleWhichImportJS): Deleted.
1829         (MonomorphicImport): Deleted.
1830         * wasm/js-api/call-indirect.js:
1831         (const.wasmModuleWhichImportJS):
1832         (const.makeTable):
1833         (Polyphic2Import):
1834         (VirtualImport):
1835         (MonomorphicImport): Deleted.
1836         * wasm/js-api/table.js: Added.
1837         (assertBadBinary):
1838         (assert.truthy):
1839         (assertBadTable):
1840         (assertBadTableImport):
1841         (assertBadBinary.assertBadTableInstance):
1842         (assertBadTableInstance):
1843         (new.WebAssembly.Table):
1844         * wasm/js-api/test_basic_api.js:
1845         (const.c.in.constructorProperties.switch):
1846
1847 2016-12-13  Commit Queue  <commit-queue@webkit.org>
1848
1849         Unreviewed, rolling out r209725.
1850         https://bugs.webkit.org/show_bug.cgi?id=165811
1851
1852         "Broke ARMv7 builds" (Requested by msaboff on #webkit).
1853
1854         Reverted changeset:
1855
1856         "REGRESSION(r209653): speedometer crashes making virtual slow
1857         path tailcalls"
1858         https://bugs.webkit.org/show_bug.cgi?id=165748
1859         http://trac.webkit.org/changeset/209725
1860
1861 2016-12-12  Michael Saboff  <msaboff@apple.com>
1862
1863         REGRESSION(r209653): speedometer crashes making virtual slow path tailcalls
1864         https://bugs.webkit.org/show_bug.cgi?id=165748
1865
1866         Reviewed by Filip Pizlo.
1867
1868         New regression test.
1869
1870         * stress/regress-165748.js: Added.
1871         (sum1):
1872         (sum2):
1873         (sum3):
1874         (sum4):
1875         (sum5):
1876         (sum6):
1877         (tailCaller):
1878         (test):
1879
1880 2016-12-12  Mark Lam  <mark.lam@apple.com>
1881
1882         Debug JSC test timeout: stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js.ftl-no-cjit.
1883         https://bugs.webkit.org/show_bug.cgi?id=164630
1884
1885         Reviewed by Keith Miller.
1886
1887         Speculative fix for timeout issue.  It looks like this test just runs a bit
1888         slower on debug builds.  So, we'll give it a little more time to run.
1889
1890         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
1891
1892 2016-12-11  Saam Barati  <sbarati@apple.com>
1893
1894         We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
1895         https://bugs.webkit.org/show_bug.cgi?id=165429
1896
1897         Reviewed by Keith Miller.
1898
1899         * wasm/function-tests/trap-load.js: Added.
1900         (assert):
1901         (wasmFrameCountFromError):
1902         (i.catch):
1903         (assert.continuation):
1904         * wasm/function-tests/trap-store.js: Added.
1905         (import.Builder.from.string_appeared_here.assert):
1906         (i.catch):
1907         (assert.continuation):
1908         (assert):
1909         * wasm/js-api/test_memory_constructor.js:
1910         (assert):
1911
1912 2016-12-10  Commit Queue  <commit-queue@webkit.org>
1913
1914         Unreviewed, rolling out r209653, r209654, r209663, and
1915         r209673.
1916         https://bugs.webkit.org/show_bug.cgi?id=165739
1917
1918         speedometer crashes (Requested by pizlo on #webkit).
1919
1920         Reverted changesets:
1921
1922         "JSVALUE64: Pass arguments in platform argument registers when
1923         making JavaScript calls"
1924         https://bugs.webkit.org/show_bug.cgi?id=160355
1925         http://trac.webkit.org/changeset/209653
1926
1927         "Unreviewed build fix for 32 bit builds."
1928         http://trac.webkit.org/changeset/209654
1929
1930         "Unreviewed build fix for the CLOOP after r209653"
1931         http://trac.webkit.org/changeset/209663
1932
1933         "REGRESSION(r209653) Crash in CallFrameShuffler::snapshot()"
1934         https://bugs.webkit.org/show_bug.cgi?id=165728
1935         http://trac.webkit.org/changeset/209673
1936
1937 2016-12-10  Michael Saboff  <msaboff@apple.com>
1938
1939         REGRESSION(r209653) Crash in CallFrameShuffler::snapshot()
1940         https://bugs.webkit.org/show_bug.cgi?id=165728
1941
1942         Reviewed by Filip Pizlo.
1943
1944         New regression test.
1945
1946         * stress/regress-165728.js: Added.
1947         (sum1):
1948         (sum2):
1949         (tailCaller):
1950         (test):
1951
1952 2016-12-10  Keith Miller  <keith_miller@apple.com>
1953
1954         Fix indirect_call if the result type is used.
1955         https://bugs.webkit.org/show_bug.cgi?id=165727
1956
1957         Reviewed by Michael Saboff.
1958
1959         * wasm/js-api/call-indirect-results.js: Added.
1960         (const.wasmModuleWhichImportJS):
1961         (MonomorphicImport):
1962
1963 2016-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>
1964
1965         [JSC] Module namespace object behaves like immutable prototype exotic object
1966         https://bugs.webkit.org/show_bug.cgi?id=165598
1967
1968         Reviewed by Mark Lam.
1969
1970         * modules/namespace-prototype-assignment.js: Added.
1971         (else):
1972         (reportError):
1973         (shouldEqual):
1974         (shouldThrow):
1975         (stringify):
1976         (makeTestID):
1977         (doInternalSetPrototypeOf):
1978         (ordinarySetPrototypeOf):
1979         (setImmutablePrototype):
1980         (windowProxySetPrototypeOf):
1981         (initSetterExpectation):
1982         (throwIfNoExceptionPending):
1983         (objectSetPrototypeOf):
1984         (setUnderscoreProto):
1985         (reflectSetPrototypeOf):
1986         (setPrototypeOf):
1987         (newObjectProto.toString):
1988         (Symbol):
1989         (test):
1990         (runTests):
1991         * modules/namespace-set-prototype-of.js: Added.
1992         (shouldThrow):
1993         (TypeError.Cannot.set prototype):
1994
1995 2016-12-09  Michael Saboff  <msaboff@apple.com>
1996
1997         JSVALUE64: Pass arguments in platform argument registers when making JavaScript calls
1998         https://bugs.webkit.org/show_bug.cgi?id=160355
1999
2000         Reviewed by Filip Pizlo.
2001
2002         New microbenchmarks to measure call type performance.
2003
2004         * microbenchmarks/calling-computed-args.js: Added.
2005         * microbenchmarks/calling-many-callees.js: Added.
2006         * microbenchmarks/calling-one-callee-fixed.js: Added.
2007         * microbenchmarks/calling-one-callee.js: Added.
2008         * microbenchmarks/calling-poly-callees.js: Added.
2009         * microbenchmarks/calling-poly-extra-arity-callees.js: Added.
2010         * microbenchmarks/calling-tailcall.js: Added.
2011         * microbenchmarks/calling-virtual-arity-fixup-callees.js: Added.
2012         * microbenchmarks/calling-virtual-arity-fixup-stackargs.js: Added.
2013         * microbenchmarks/calling-virtual-callees.js: Added.
2014         * microbenchmarks/calling-virtual-extra-arity-callees.js: Added.
2015
2016 2016-12-09  Keith Miller  <keith_miller@apple.com>
2017
2018         Wasm should support call_indirect
2019         https://bugs.webkit.org/show_bug.cgi?id=165718
2020
2021         Reviewed by Filip Pizlo.
2022
2023         * wasm/Builder.js:
2024         * wasm/function-tests/call-indirect-params.js: Added.
2025         * wasm/function-tests/call-indirect.js: Added.
2026         * wasm/js-api/call-indirect.js: Added.
2027         (const.wasmModuleWhichImportJS):
2028         (MonomorphicImport):
2029         (Polyphic2Import):
2030         (VirtualImport):
2031         * wasm/wasm.json:
2032
2033 2016-12-09  JF Bastien  <jfbastien@apple.com>
2034
2035         WebAssembly: implement data section
2036         https://bugs.webkit.org/show_bug.cgi?id=165696
2037
2038         Reviewed by Keith Miller.
2039
2040         As specified in https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#data-section
2041         Note that some of the interesting corner cases are ill-defined by the spec: https://github.com/WebAssembly/design/issues/897
2042
2043         * wasm/Builder.js: create a data section from JavaScript
2044         * wasm/Builder_WebAssemblyBinary.js: assemble the data section into the proper binary encoding
2045         (const.emitters.Data):
2046         * wasm/js-api/test_Data.js: Added.
2047         (DataSection):
2048         (DataSectionOffTheEnd):
2049         (DataSectionPartlyOffTheEnd):
2050         (DataSectionEmptyOffTheEnd):
2051         (DataSectionSeenByStart):
2052         * wasm/self-test/test_BuilderJSON.js: make sure the JSON structure is fine (this sanity checks before going to binary)
2053
2054 2016-12-09  JF Bastien  <jfbastien@apple.com>
2055
2056         WebAssembly JS API: implement start function
2057         https://bugs.webkit.org/show_bug.cgi?id=165150
2058
2059         Reviewed by Saam Barati.
2060
2061         * wasm/Builder.js: allow building a .Start()
2062         * wasm/Builder_WebAssemblyBinary.js:
2063         * wasm/js-api/test_Start.js: Added.
2064         (const.emitters.Start): serialize a start section
2065         * wasm/self-test/test_BuilderJSON.js: validate the start section's content
2066
2067 2016-12-09  Saam Barati  <sbarati@apple.com>
2068
2069         WebAssembly JS API: implement importing and defining Memory
2070         https://bugs.webkit.org/show_bug.cgi?id=164134
2071
2072         Reviewed by Keith Miller.
2073
2074         * wasm/Builder.js:
2075         (const._importMemoryContinuation.section):
2076         (const._importMemoryContinuation.assert):
2077         (const._importMemoryContinuation):
2078         (const._exportFunctionContinuation.const): Deleted.
2079         (const._exportFunctionContinuation): Deleted.
2080         * wasm/Builder_WebAssemblyBinary.js:
2081         (const.emitters.Import):
2082         * wasm/js-api/test_basic_api.js:
2083         (const.c.in.constructorProperties.switch):
2084         * wasm/js-api/test_memory.js: Added.
2085         (assert):
2086         (binaryShouldNotParse):
2087         (test):
2088         (test.testMemImportError):
2089         * wasm/js-api/test_memory_constructor.js: Added.
2090         (assert):
2091         (throw.new.Error):
2092         (testInvalidSize):
2093         (assert.testInvalidInitial):
2094         (testInvalidInitial.testInvalidMaximum):
2095         (testInvalidInitial):
2096         (testInvalidMaximum):
2097         * wasm/self-test/test_BuilderJSON.js:
2098
2099 2016-12-08  JF Bastien  <jfbastien@apple.com>
2100
2101         WebAssembly: JSC::link* shouldn't need a CodeBlock
2102         https://bugs.webkit.org/show_bug.cgi?id=165591
2103
2104         Reviewed by Keith Miller.
2105
2106         test that wasm -> JS works, including the IC
2107
2108         * wasm/js-api/test_Instance.js:
2109         (const.wasmModuleWhichImportJS):
2110         (MonomorphicImport):
2111         (Polyphic2Import):
2112         (Polyphic3Import):
2113         (VirtualImport):
2114
2115 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
2116
2117         Green the cloop bot by raising this threshold.
2118
2119         * mozilla/js1_5/Array/regress-101964.js:
2120
2121 2016-12-08  JF Bastien  <jfbastien@apple.com>
2122
2123         WebAssembly JS API: wire up Instance imports
2124         https://bugs.webkit.org/show_bug.cgi?id=165118
2125
2126         Reviewed by Saam Barati.
2127
2128         * wasm/js-api/test_Instance.js: add the test, disabled for now
2129
2130 2016-12-07  Keith Miller  <keith_miller@apple.com>
2131
2132         Add more missing trivial wasm ops.
2133         https://bugs.webkit.org/show_bug.cgi?id=165564
2134
2135         Add tests for drop and tee_local.
2136
2137         Reviewed by Geoffrey Garen.
2138
2139         * wasm/function-tests/drop.js: Added.
2140         * wasm/function-tests/nop.js: Added.
2141         * wasm/function-tests/tee-local.js: Added.
2142
2143 2016-12-06  Keith Miller  <keith_miller@apple.com>
2144
2145         Add support for truncation operators
2146         https://bugs.webkit.org/show_bug.cgi?id=165519
2147
2148         Reviewed by Geoffrey Garen.
2149
2150         * wasm/function-tests/i32-trunc-s-f32.js: Added.
2151         * wasm/function-tests/i32-trunc-s-f64.js: Added.
2152         * wasm/function-tests/i32-trunc-u-f32.js: Added.
2153         * wasm/function-tests/i32-trunc-u-f64.js: Added.
2154         * wasm/function-tests/i64-trunc-s-f32.js: Added.
2155         * wasm/function-tests/i64-trunc-s-f64.js: Added.
2156         * wasm/function-tests/i64-trunc-u-f32.js: Added.
2157         * wasm/function-tests/i64-trunc-u-f64.js: Added.
2158
2159 2016-12-06  Mark Lam  <mark.lam@apple.com>
2160
2161         Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
2162         https://bugs.webkit.org/show_bug.cgi?id=165227
2163         <rdar://problem/29442665>
2164
2165         Reviewed by Saam Barati.
2166
2167         * stress/get-from-scope-dynamic-onto-proxy.js:
2168         - Updated error message.
2169
2170         * stress/proxy-dont-infinite-loop.js: Removed.
2171         * stress/proxy-json-path.js: Removed.
2172         * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed.
2173         - Removed these tests because the issue they are testing relies on being able to
2174           set Object.prototype.__proto__ to something else (which is now not possible).
2175
2176 2016-12-05  Caitlin Potter  <caitp@igalia.com>
2177
2178         [JSC] report unexpected token when "async" is followed by identifier 
2179         https://bugs.webkit.org/show_bug.cgi?id=165091
2180
2181         Reviewed by Mark Lam.
2182
2183         * stress/bug-165091.js:
2184
2185 2016-12-05  Keith Miller  <keith_miller@apple.com>
2186
2187         Add Wasm i64 to i32 conversion.
2188         https://bugs.webkit.org/show_bug.cgi?id=165378
2189
2190         Reviewed by Filip Pizlo.
2191
2192         It turns out the wrap operation is just B3's Trunc.
2193
2194         * wasm/wasm.json:
2195
2196 2016-12-04  Keith Miller  <keith_miller@apple.com>
2197
2198         Add support for Wasm ctz and popcnt
2199         https://bugs.webkit.org/show_bug.cgi?id=165369
2200
2201         Reviewed by Saam Barati.
2202
2203         * wasm/function-tests/ctz.js: Added.
2204         * wasm/function-tests/popcnt.js: Added.
2205
2206 2016-12-03  JF Bastien  <jfbastien@apple.com>
2207
2208         WebAssembly: update binary format to 0xD version
2209         https://bugs.webkit.org/show_bug.cgi?id=165345
2210
2211         Reviewed by Keith Miller.
2212
2213         As described in the following PR: https://github.com/WebAssembly/design/pull/836
2214         Originally committed in r209175, reverted in r209242, and fixed in r209284.
2215
2216         * wasm/Builder.js:
2217         (const._normalizeFunctionSignature):
2218         * wasm/Builder_WebAssemblyBinary.js:
2219         (const.emitters.Type):
2220         (const.emitters.Code):
2221         * wasm/LowLevelBinary.js:
2222         (export.default.LowLevelBinary.prototype.block_type):
2223         (export.default.LowLevelBinary.prototype.inline_signature_type): Deleted.
2224         * wasm/WASM.js:
2225         * wasm/js-api/test_basic_api.js:
2226         * wasm/self-test/test_BuilderWebAssembly.js:
2227         (EmptyModule):
2228         (CustomSection):
2229         * wasm/self-test/test_WASM.js:
2230         * wasm/wasm.json:
2231
2232 2016-12-02  Keith Miller  <keith_miller@apple.com>
2233
2234         Add Wasm copysign
2235         https://bugs.webkit.org/show_bug.cgi?id=165355
2236
2237         Reviewed by Filip Pizlo.
2238
2239         * wasm/function-tests/copysign.js: Added.
2240
2241 2016-12-03  Commit Queue  <commit-queue@webkit.org>
2242
2243         Unreviewed, rolling out r209298.
2244         https://bugs.webkit.org/show_bug.cgi?id=165359
2245
2246         broke the build (Requested by smfr on #webkit).
2247
2248         Reverted changeset:
2249
2250         "Add Wasm copysign"
2251         https://bugs.webkit.org/show_bug.cgi?id=165355
2252         http://trac.webkit.org/changeset/209298
2253
2254 2016-12-02  Keith Miller  <keith_miller@apple.com>
2255
2256         Add Wasm copysign
2257         https://bugs.webkit.org/show_bug.cgi?id=165355
2258
2259         Reviewed by Filip Pizlo.
2260
2261         * wasm/function-tests/copysign.js: Added.
2262
2263 2016-12-02  Keith Miller  <keith_miller@apple.com>
2264
2265         Unreviewed, fix git having a breakdown over trying to reland a rollout.
2266
2267 2016-12-02  Keith Miller  <keith_miller@apple.com>
2268
2269         Add Wasm floating point nearest and trunc
2270         https://bugs.webkit.org/show_bug.cgi?id=165339
2271
2272         Reviewed by Saam Barati.
2273
2274         * wasm/function-tests/nearest.js: Added.
2275         * wasm/function-tests/trunc.js: Added.
2276
2277 2016-12-02  Caitlin Potter  <caitp@igalia.com>
2278
2279 [JSC] add additional bit to JSTokenType bitfield
2280         https://bugs.webkit.org/show_bug.cgi?id=165091
2281
2282         Reviewed by Geoffrey Garen.
2283
2284         * stress/bug-165091.js: Added.
2285         (shouldThrowSyntaxError):
2286
2287 2016-12-02  Commit Queue  <commit-queue@webkit.org>
2288
2289         Unreviewed, rolling out r209275 and r209276.
2290         https://bugs.webkit.org/show_bug.cgi?id=165348
2291
2292         "broke the arm build" (Requested by keith_miller on #webkit).
2293
2294         Reverted changesets:
2295
2296         "Add Wasm floating point nearest and trunc"
2297         https://bugs.webkit.org/show_bug.cgi?id=165339
2298         http://trac.webkit.org/changeset/209275
2299
2300         "Unreviewed, forgot to change instruction after renaming."
2301         http://trac.webkit.org/changeset/209276
2302
2303 2016-12-02  Keith Miller  <keith_miller@apple.com>
2304
2305         Add Wasm floating point nearest and trunc
2306         https://bugs.webkit.org/show_bug.cgi?id=165339
2307
2308         Reviewed by Filip Pizlo.
2309
2310         * wasm/function-tests/nearest.js: Added.
2311         * wasm/function-tests/trunc.js: Added.
2312
2313 2016-12-02  JF Bastien  <jfbastien@apple.com>
2314
2315         WebAssembly: revert patch causing odd breakage
2316         https://bugs.webkit.org/show_bug.cgi?id=165308
2317
2318         Unreviewed.
2319
2320         Bug #164724 seems to cause build issues which I haven't tracked down yet. WasmOps.h can't be found:
2321         ./Source/JavaScriptCore/wasm/WasmFormat.h:34:10: fatal error: 'WasmOps.h' file not found
2322
2323         It's weird since the file is auto-generated and has been for a while. #164724 merely includes it in WasmFormat.h.
2324
2325         * wasm/Builder.js:
2326         (const._normalizeFunctionSignature):
2327         * wasm/Builder_WebAssemblyBinary.js:
2328         (const.emitters.Type):
2329         (const.emitters.Code):
2330         * wasm/LowLevelBinary.js:
2331         (export.default.LowLevelBinary.prototype.inline_signature_type):
2332         (export.default.LowLevelBinary.prototype.block_type): Deleted.
2333         * wasm/WASM.js:
2334         * wasm/js-api/test_basic_api.js:
2335         * wasm/self-test/test_BuilderWebAssembly.js:
2336         (EmptyModule):
2337         (CustomSection):
2338         * wasm/self-test/test_WASM.js:
2339         * wasm/wasm.json:
2340
2341 2016-12-01  Ryan Haddad  <ryanhaddad@apple.com>
2342
2343         Skip flaky test ChakraCore/test/fieldopts/objtypespec-newobj-invalidation.1.js
2344         https://bugs.webkit.org/show_bug.cgi?id=162567
2345
2346         Reviewed by Saam Barati.
2347
2348         * ChakraCore.yaml:
2349
2350 2016-12-01  Keith Miller  <keith_miller@apple.com>
2351
2352         Add wasm int to floating point opcodes
2353         https://bugs.webkit.org/show_bug.cgi?id=165252
2354
2355         Reviewed by Geoffrey Garen.
2356
2357         Add tests for Wasm integral to floating point conversion opcodes.
2358
2359         * wasm/function-tests/int-to-floating-point.js: Added.
2360         * wasm/wasm.json:
2361
2362 2016-12-01  Geoffrey Garen  <ggaren@apple.com>
2363
2364         Land a test case for <rdar://problem/27889416>
2365         https://bugs.webkit.org/show_bug.cgi?id=165272
2366
2367         Reviewed by Saam Barati.
2368
2369         * stress/marked-argument-buffer.js: Added.
2370         (allocate):
2371         (test.o.toString):
2372         (test):
2373
2374 2016-11-29  Per Arne Vollan  <pvollan@apple.com>
2375
2376         [Win] Skip failing JSC tests.
2377         https://bugs.webkit.org/show_bug.cgi?id=165140
2378
2379         Reviewed by Mark Lam.
2380
2381         * ChakraCore.yaml:
2382         * microbenchmarks/tan.js:
2383
2384 2016-11-30  JF Bastien  <jfbastien@apple.com>
2385
2386         WebAssembly builder: don't throw when checker not implemented
2387         https://bugs.webkit.org/show_bug.cgi?id=165219
2388
2389         Reviewed by Mark Lam.
2390
2391         We should perform whichever checks we've implemented, and assume the rest are OK until bug #163421 is fixed.
2392
2393         * wasm/Builder.js:
2394         * wasm/README.md:
2395         * wasm/function-tests/add-12.js:
2396         * wasm/function-tests/br-if-loop-less-than.js:
2397         * wasm/function-tests/brTableAsIf.js:
2398         * wasm/function-tests/brTableManyValues.js:
2399         * wasm/function-tests/brTableWithLoop.js:
2400         * wasm/function-tests/dumb-eq-if-then-else.js:
2401         * wasm/function-tests/dumb-less-than-fallthrough.js:
2402         * wasm/function-tests/dumb-less-than-ite.js:
2403         * wasm/function-tests/eqz.js:
2404         * wasm/function-tests/factorial.js:
2405         * wasm/function-tests/float-sub.js:
2406         * wasm/function-tests/i32-load.js:
2407         * wasm/function-tests/i32-load8-s.js:
2408         * wasm/function-tests/if-then-else-fallthrough.js:
2409         * wasm/function-tests/if-then-fallthrough.js:
2410         * wasm/function-tests/loop-mult.js:
2411         * wasm/function-tests/loop-sum.js:
2412         * wasm/function-tests/max.js:
2413         * wasm/function-tests/min.js:
2414         * wasm/function-tests/ret5.js:
2415         * wasm/function-tests/select.js:
2416         * wasm/self-test/test_BuilderJSON.js:
2417
2418 2016-11-29  JF Bastien  <jfbastien@apple.com>
2419
2420         WebAssembly JS API: improve Instance
2421         https://bugs.webkit.org/show_bug.cgi?id=164757
2422
2423         Reviewed by Keith Miller.
2424
2425         An Instance's `exports` property wasn't populated with exports.
2426
2427         A follow-up patch will do imports.
2428
2429         A few things of note:
2430
2431          - LowLevelBinary: support 3-byte integers.
2432          - LowLevelBinary: support proper UTF-8 2003 code points (instead of UTF-16).
2433
2434         * wasm/Builder.js:
2435         * wasm/Builder_WebAssemblyBinary.js: wire up exports, stub other things out some more
2436         (const.emitters.Export):
2437         * wasm/LowLevelBinary.js:
2438         (export.default.LowLevelBinary.prototype.uint24): add, used for UTF-8
2439         (export.default.LowLevelBinary.prototype.string): support UTF-8
2440         (export.default.LowLevelBinary.prototype.getUint24): add, used for UTF-8
2441         (export.default.LowLevelBinary.prototype.getVaruint1): was missing
2442         (export.default.LowLevelBinary.prototype.getString): support UTF-8
2443         (export.default.LowLevelBinary):
2444         * wasm/js-api/test_Instance.js: instance.exports.answer() // <-- this is where the magic of this entire patch is
2445         (ExportedAnswerI32):
2446         * wasm/js-api/test_basic_api.js: punt test to later
2447         (const.c.in.constructorProperties.switch):
2448         * wasm/self-test/test_BuilderWebAssembly.js: UTF-8
2449         (CustomSection):
2450         * wasm/self-test/test_LowLevelBinary_string.js: UTF-8 now works
2451         * wasm/self-test/test_LowLevelBinary_uint16.js: was missing one value
2452         * wasm/self-test/test_LowLevelBinary_uint24.js: Copied from JSTests/wasm/self-test/test_LowLevelBinary_uint8.js.
2453         * wasm/self-test/test_LowLevelBinary_uint8.js: was missing one value
2454         * wasm/self-test/test_LowLevelBinary_varuint1.js: Added.
2455         * wasm/utilities.js: this `dump` thing was useful
2456         (const._dump):
2457
2458 2016-11-29  Saam Barati  <sbarati@apple.com>
2459
2460         We should be able optimize the pattern where we spread a function's rest parameter to another call
2461         https://bugs.webkit.org/show_bug.cgi?id=163865
2462
2463         Reviewed by Filip Pizlo.
2464
2465         * microbenchmarks/default-derived-constructor.js: Added.
2466         (createClassHierarchy.let.currentClass):
2467         (createClassHierarchy):
2468         * stress/call-varargs-spread.js: Added.
2469         (assert):
2470         (bar):
2471         (foo):
2472         * stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js: Added.
2473         (assert):
2474         (baz):
2475         (bar):
2476         (foo):
2477         * stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js: Added.
2478         (assert):
2479         (foo):
2480         (escape):
2481         (bar):
2482         * stress/phantom-new-array-with-spread-osr-exit.js: Added.
2483         (assert):
2484         (baz):
2485         (bar):
2486         (effects):
2487         (foo):
2488         * stress/phantom-spread-forward-varargs.js: Added.
2489         (assert):
2490         (test1.bar):
2491         (test1.foo):
2492         (test1):
2493         (test2.bar):
2494         (test2.foo):
2495         (test3.baz):
2496         (test3.bar):
2497         (test3.foo):
2498         (test4.baz):
2499         (test4.bar):
2500         (test4.foo):
2501         (test5.baz):
2502         (test5.bar):
2503         (test5.foo):
2504         * stress/phantom-spread-osr-exit.js: Added.
2505         (assert):
2506         (baz):
2507         (bar):
2508         (effects):
2509         (foo):
2510         * stress/spread-call-convert-to-static-call.js: Added.
2511         (assert):
2512         (baz):
2513         (bar):
2514         (foo):
2515         * stress/spread-forward-call-varargs-stack-overflow.js: Added.
2516         (assert):
2517         (identity):
2518         (bar):
2519         (foo):
2520         * stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js: Added.
2521         (assert):
2522         (baz.Array.prototype.Symbol.iterator):
2523         (baz):
2524         (bar):
2525         (foo):
2526         (test):
2527         * stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js: Added.
2528         (assert):
2529         (baz.Array.prototype.Symbol.iterator):
2530         (baz):
2531         (bar):
2532         (foo):
2533         * stress/spread-forward-varargs-stack-overflow.js: Added.
2534         (assert):
2535         (bar):
2536         (foo):
2537
2538 2016-11-29  Caitlin Potter  <caitp@igalia.com>
2539
2540         [JSC] always wrap AwaitExpression operand in a new Promise
2541         https://bugs.webkit.org/show_bug.cgi?id=165181
2542
2543         Reviewed by Yusuke Suzuki.
2544
2545         * stress/async-await-basic.js:
2546         (async.awaitedPromisesAreWrapped):
2547
2548 2016-11-29  Keith Miller  <keith_miller@apple.com>
2549
2550         Add simple way to implement Wasm ops that require more than one B3 opcode
2551         https://bugs.webkit.org/show_bug.cgi?id=165129
2552
2553         Reviewed by Geoffrey Garen.
2554
2555         * wasm/function-tests/eqz.js: Added.
2556         * wasm/function-tests/max.js: Added.
2557         * wasm/function-tests/min.js: Added.
2558         * wasm/wasm.json:
2559
2560 2016-11-21  Yusuke Suzuki  <utatane.tea@gmail.com>
2561
2562         Crash in com.apple.JavaScriptCore: WTF::ThreadSpecific<WTF::WTFThreadData, + 142
2563         https://bugs.webkit.org/show_bug.cgi?id=164898
2564
2565         Reviewed by Darin Adler.
2566
2567         * stress/tagged-template-registry-key-collect.js: Added.
2568         (shouldBe):
2569         (tag):
2570         (i.eval):
2571         * stress/tagged-template-registry-key.js: Added.
2572         (shouldBe):
2573         (tag):
2574         (a):
2575         (b):
2576
2577 2016-11-20  Caitlin Potter  <caitp@igalia.com>
2578
2579         [JSC] speed up parsing of async functions
2580         https://bugs.webkit.org/show_bug.cgi?id=164808
2581
2582         Reviewed by Yusuke Suzuki.
2583
2584         Add tests for line terminator following "async" keyword in async
2585         function syntax.
2586
2587         * stress/async-await-syntax.js:
2588         (shouldBe):
2589
2590 2016-11-19  Mark Lam  <mark.lam@apple.com>
2591
2592         op_mod-* JSC tests needs a longer timeout too.
2593         https://bugs.webkit.org/show_bug.cgi?id=164994
2594
2595         Reviewed by Yusuke Suzuki.
2596
2597         * stress/op_mod-ConstVar.js:
2598         * stress/op_mod-VarConst.js:
2599         * stress/op_mod-VarVar.js:
2600
2601 2016-11-19  Mark Lam  <mark.lam@apple.com>
2602
2603         Add --timeoutMultiplier option to allow some tests more time to run.
2604         https://bugs.webkit.org/show_bug.cgi?id=164951
2605
2606         Reviewed by Yusuke Suzuki.
2607
2608         Extended the timeout for these tests by 50% more because they run quite slow on
2609         low-end machines.
2610
2611         * stress/op_div-ConstVar.js:
2612         * stress/op_div-VarConst.js:
2613         * stress/op_div-VarVar.js:
2614
2615 2016-11-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2616
2617         REGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05.arguments_sm.js.default
2618         https://bugs.webkit.org/show_bug.cgi?id=164929
2619
2620         Reviewed by Mark Lam.
2621
2622         ES2017 drops arguments.caller and JavaScriptCore is updated to meet the spec.
2623         This patch rebaselines the result of ChakraCore test for JSC.
2624
2625         * ChakraCore/test/strict/05.arguments_sm.baseline-jsc:
2626
2627 2016-11-18  Joseph Pecoraro  <pecoraro@apple.com>
2628
2629         Web Inspector: Generator functions should have a displayable name when shown in stack traces
2630         https://bugs.webkit.org/show_bug.cgi?id=164844
2631         <rdar://problem/29300697>
2632
2633         Reviewed by Yusuke Suzuki.
2634
2635         * stress/generator-function-name.js:
2636         Add another test now that we name the inner generator function
2637         that we do not break the lexical resolution of names.
2638
2639 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2640
2641         [JSC] Drop arguments.caller
2642         https://bugs.webkit.org/show_bug.cgi?id=164859
2643
2644         Reviewed by Saam Barati.
2645
2646         * stress/strict-mode-arguments-caller.js: Added.
2647         (strictArguments):
2648         (shouldBe):
2649
2650 2016-11-17  Keith Miller  <keith_miller@apple.com>
2651
2652         Add rotate to Wasm
2653         https://bugs.webkit.org/show_bug.cgi?id=164871
2654
2655         Reviewed by Filip Pizlo.
2656
2657         * wasm/wasm.json:
2658
2659 2016-11-17  Keith Miller  <keith_miller@apple.com>
2660
2661         Add sqrt to Wasm
2662         https://bugs.webkit.org/show_bug.cgi?id=164877
2663
2664         Reviewed by Mark Lam.
2665
2666         B3 already has a Sqrt opcode we just need to map Wasm to it.
2667
2668         * wasm/wasm.json:
2669
2670 2016-11-17  Saam Barati  <sbarati@apple.com>
2671
2672         Remove async/await compile time flag and enable tests
2673         https://bugs.webkit.org/show_bug.cgi?id=164828
2674         <rdar://problem/28639334>
2675
2676         Reviewed by Yusuke Suzuki.
2677
2678         * stress/async-arrow-functions-lexical-arguments-binding.js:
2679         * stress/async-arrow-functions-lexical-new.target-binding.js:
2680         * stress/async-arrow-functions-lexical-super-binding.js:
2681         * stress/async-arrow-functions-lexical-this-binding.js:
2682         * stress/async-await-basic.js:
2683         * stress/async-await-long-loop.js:
2684         * stress/async-await-module-reserved-word.js:
2685         * stress/async-await-mozilla.js:
2686         (mozSyntaxErrors):
2687         * stress/async-await-reserved-word.js:
2688         * stress/async-await-syntax.js:
2689         * stress/async-await-throw-loop.js:
2690         * stress/async-function-create-nobaseline.js:
2691         * stress/async-function-create-optimized.js:
2692         * stress/async-function-declaration-sinking-no-double-allocate.js:
2693         * stress/async-function-declaration-sinking-osrexit.js:
2694         * stress/async-function-declaration-sinking-put.js:
2695         * stress/async-function-expression-sinking-no-double-allocate.js:
2696         * stress/async-function-expression-sinking-osrexit.js:
2697         * stress/async-function-expression-sinking-put.js:
2698         * test262.yaml:
2699
2700 2016-11-15  Mark Lam  <mark.lam@apple.com>
2701
2702         Make JSC test functions more robust.
2703         https://bugs.webkit.org/show_bug.cgi?id=164807
2704
2705         Reviewed by Keith Miller.
2706
2707         * stress/jsc-test-functions-should-be-more-robust.js: Added.
2708
2709 2016-11-15  Keith Miller  <keith_miller@apple.com>
2710
2711         B3 should support UDiv/UMod
2712         https://bugs.webkit.org/show_bug.cgi?id=164811
2713
2714         Reviewed by Filip Pizlo.
2715
2716         Link new instructions to wasm.
2717
2718         * wasm/wasm.json:
2719
2720 2016-11-15  Saam Barati  <sbarati@apple.com>
2721
2722         Debug JSC test timeout: stress/has-own-property-name-cache-symbols-and-strings.js.ftl-no-cjit-small-pool
2723         https://bugs.webkit.org/show_bug.cgi?id=163012
2724
2725         Unreviewed. This patch makes a test run for less time because it's timing out on the bots.
2726
2727         * stress/has-own-property-name-cache-symbols-and-strings.js:
2728
2729 2016-11-15  Mark Lam  <mark.lam@apple.com>
2730
2731         The jsc shell's setImpureGetterDelegate() should ensure that the set value is an ImpureGetter.
2732         https://bugs.webkit.org/show_bug.cgi?id=164781
2733         <rdar://problem/28418590>
2734
2735         Reviewed by Geoffrey Garen and Michael Saboff.
2736
2737         * stress/jsc-setImpureGetterDelegate-on-bad-type.js: Added.
2738
2739 2016-11-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2740
2741         [DOMJIT] Allow using macro assembler scratches in FTL CheckDOM
2742         https://bugs.webkit.org/show_bug.cgi?id=164727
2743
2744         Reviewed by Filip Pizlo.
2745
2746         * stress/check-dom-with-signature.js: Added.
2747         (shouldBe):
2748         (calling):
2749         (i.array.forEach):
2750
2751 2016-11-14  Caitlin Potter  <caitp@igalia.com>
2752
2753         [JSC] do not reference AwaitExpression Promises in async function Promise chain
2754         https://bugs.webkit.org/show_bug.cgi?id=164753
2755
2756         Reviewed by Yusuke Suzuki.
2757
2758         * asyncFunctionTests.yaml:
2759         * stress/async-await-long-loop.js: Added.
2760         (shouldBe):
2761         (async.longLoop):
2762         * stress/async-await-throw-loop.js: Added.
2763         (shouldBe):
2764         (async.thrower):
2765         (async.throwLoop):
2766
2767 2016-11-14  Keith Miller  <keith_miller@apple.com>
2768
2769         Add Wasm select
2770         https://bugs.webkit.org/show_bug.cgi?id=164743
2771
2772         Reviewed by Saam Barati.
2773
2774         * wasm/function-tests/select.js: Added.
2775
2776 2016-11-14  Caitlin Potter  <caitp@igalia.com>
2777
2778         [JSC] Handle new_async_func / new_async_func_exp in DFG / FTL
2779         https://bugs.webkit.org/show_bug.cgi?id=164037
2780
2781         Reviewed by Yusuke Suzuki.
2782
2783         Add tests based on tests from https://trac.webkit.org/changeset/194216.
2784
2785         * asyncFunctionTests.yaml:
2786         * stress/async-function-create-nobaseline.js: Added.
2787         * stress/async-function-create-optimized.js: Added.
2788         * stress/async-function-declaration-sinking-no-double-allocate.js: Added.
2789         * stress/async-function-declaration-sinking-osrexit.js: Added.
2790         * stress/async-function-declaration-sinking-put.js: Added.
2791         * stress/async-function-expression-sinking-no-double-allocate.js: Added.
2792         * stress/async-function-expression-sinking-osrexit.js: Added.
2793         * stress/async-function-expression-sinking-put.js: Added.
2794
2795 2016-11-14  Mark Lam  <mark.lam@apple.com>
2796
2797         Some of JSStringView::SafeView methods are not idiomatically safe for JSString to StringView conversions.
2798         https://bugs.webkit.org/show_bug.cgi?id=164701
2799         <rdar://problem/27462104>
2800
2801         Reviewed by Darin Adler.
2802
2803         * stress/string-prototype-charCodeAt-on-too-long-rope.js: Added.
2804
2805 2016-11-14  Mark Lam  <mark.lam@apple.com>
2806
2807         RegExpObject::exec/match should handle errors gracefully.
2808         https://bugs.webkit.org/show_bug.cgi?id=155145
2809         <rdar://problem/27435934>
2810
2811         Reviewed by Keith Miller.
2812
2813         * stress/regexp-prototype-exec-on-too-long-rope.js: Added.
2814         * stress/regexp-prototype-match-on-too-long-rope.js: Added.
2815         * stress/regexp-prototype-test-on-too-long-rope.js: Added.
2816
2817 2016-11-14  Mark Lam  <mark.lam@apple.com>
2818
2819         Enhance run-jsc-stress-test script to allow optional test specific options to be added for all test run configurations.
2820         https://bugs.webkit.org/show_bug.cgi?id=164695
2821
2822         Reviewed by Keith Miller.
2823
2824         Replace use of runMisc* test run configurations with equivalents.
2825
2826         * stress/licm-no-pre-header-nested.js:
2827         * stress/licm-no-pre-header.js:
2828         * stress/licm-pre-header-cannot-exit-nested.js:
2829         * stress/licm-pre-header-cannot-exit.js:
2830         * stress/make-dictionary-repatch.js:
2831         * stress/retry-cache-later.js:
2832         * stress/shadow-chicken-reading-from-scope-after-ftl-osr-exit-bytecode-liveness.js:
2833         * stress/slow-path-generator-updating-current-node-dfg.js:
2834         * stress/unshift-array-storage.js:
2835
2836 2016-11-11  Joseph Pecoraro  <pecoraro@apple.com>
2837
2838         test262: DataView with explicit undefined byteLength should be the same as it not being present
2839         https://bugs.webkit.org/show_bug.cgi?id=164453
2840
2841         Reviewed by Darin Adler.
2842
2843         * stress/dataview-construct.js: Added.
2844         (assert):
2845         (shouldThrow):
2846         * test262.yaml:
2847
2848 2016-11-11  Joseph Pecoraro  <pecoraro@apple.com>
2849
2850         test262: DataView get methods should allow for missing offset, set methods should allow for missing value
2851         https://bugs.webkit.org/show_bug.cgi?id=164451
2852
2853         Reviewed by Darin Adler.
2854
2855         * test262.yaml:
2856
2857 2016-11-11  Saam Barati  <sbarati@apple.com>
2858
2859         We should have a more concise way of determining when we're varargs calling a function using rest parameters
2860         https://bugs.webkit.org/show_bug.cgi?id=164258
2861
2862         Reviewed by Yusuke Suzuki.
2863
2864         * microbenchmarks/call-using-spread.js: Added.
2865         (bar):
2866         (foo):
2867         * microbenchmarks/spread-large-array.js: Added.
2868         (foo):
2869         (arrays.push):
2870         * microbenchmarks/spread-small-array.js: Added.
2871         (foo):
2872         * stress/spread-array-iterator-watchpoint-2.js: Added.
2873         (foo):
2874         (arrayIterator.next):
2875         * stress/spread-array-iterator-watchpoint.js: Added.
2876         (foo):
2877         (Array.prototype.Symbol.iterator):
2878         * stress/spread-non-array.js: Added.
2879         (assert):
2880         (foo):
2881         (let.customIterator.Symbol.iterator):
2882         (bar):
2883
2884 2016-11-11  Keith Miller  <keith_miller@apple.com>
2885
2886         Relocate wasm tests and actually add them to the test runner
2887         https://bugs.webkit.org/show_bug.cgi?id=164668
2888
2889         Reviewed by Yusuke Suzuki.
2890
2891         This moves the Wasm tests from their current location down a level.
2892         Without relocating, the tests cannot properly be run by the wasm test runner.
2893
2894         * wasm.yaml:
2895         * wasm/Builder.js: Fix typos, yay lazy synatx checking!
2896         * wasm/LowLevelBinary.js: Fix typos, yay lazy synatx checking!
2897         (export.default.LowLevelBinary.prototype.get return):
2898         * wasm/function-tests/add-12.js: Renamed from JSTests/wasm/js-api/function-tests/add-12.js.
2899         * wasm/function-tests/br-if-loop-less-than.js: Renamed from JSTests/wasm/js-api/function-tests/br-if-loop-less-than.js.
2900         * wasm/function-tests/brTableAsIf.js: Renamed from JSTests/wasm/js-api/function-tests/brTableAsIf.js.
2901         * wasm/function-tests/brTableManyValues.js: Renamed from JSTests/wasm/js-api/function-tests/brTableManyValues.js.
2902         * wasm/function-tests/brTableWithLoop.js: Renamed from JSTests/wasm/js-api/function-tests/brTableWithLoop.js.
2903         * wasm/function-tests/dumb-eq-if-then-else.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-eq-if-then-else.js.
2904         * wasm/function-tests/dumb-less-than-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-less-than-fallthrough.js.
2905         * wasm/function-tests/dumb-less-than-ite.js: Renamed from JSTests/wasm/js-api/function-tests/dumb-less-than-ite.js.
2906         * wasm/function-tests/factorial.js: Renamed from JSTests/wasm/js-api/function-tests/factorial.js.
2907         * wasm/function-tests/float-sub.js: Renamed from JSTests/wasm/js-api/function-tests/float-sub.js.
2908         * wasm/function-tests/i32-load.js: Renamed from JSTests/wasm/js-api/function-tests/i32-load.js.
2909         * wasm/function-tests/i32-load8-s.js: Renamed from JSTests/wasm/js-api/function-tests/i32-load8-s.js.
2910         * wasm/function-tests/if-then-else-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/if-then-else-fallthrough.js.
2911         * wasm/function-tests/if-then-fallthrough.js: Renamed from JSTests/wasm/js-api/function-tests/if-then-fallthrough.js.
2912         * wasm/function-tests/loop-mult.js: Renamed from JSTests/wasm/js-api/function-tests/loop-mult.js.
2913         * wasm/function-tests/loop-sum.js: Renamed from JSTests/wasm/js-api/function-tests/loop-sum.js.
2914         * wasm/function-tests/ret5.js: Renamed from JSTests/wasm/js-api/function-tests/ret5.js.
2915         * wasm/self-test/test_BuilderJSON.js: Rebasline
2916
2917 2016-11-11  Keith Miller  <keith_miller@apple.com>
2918
2919         Move Wasm tests to JS
2920         https://bugs.webkit.org/show_bug.cgi?id=164611
2921
2922         Reviewed by Geoffrey Garen.
2923
2924         This patch translates most of the tests from testWasm.cpp to the JS testing api. Most of the
2925         ommited tests were earliest tests, which tested trivial things, like adding two
2926         constants. Some tests are ommited for other reasons, however. These are:
2927
2928         1) Tests using I64 since the testing api does not yet know how to handle 64-bit numbers.  2)
2929         Tests that would validate the memory of the module once wasm was done with it since that's
2930         not really possible in JS.
2931
2932         In order to make such a translation easier this patch also adds some features to the JS
2933         testing api:
2934
2935         1) Blocks can now be done lexically by adding a lambda as the last argument of the block
2936         opcode. For example one can do:
2937             ...
2938             .Block("i32", b => b.I32Const(1) )
2939
2940         and the nested lambda will automatically have an end attached.
2941
2942         2) The JS testing api can now handle inline signature types.
2943
2944         3) Relocate some code to make it easier to follow and prevent 44 space indentation.
2945
2946         4) Rename varuint/varint to varuint32/varint32, this lets them be directly called from the
2947         wasm.json without being remapped.
2948
2949         5) Add support for Memory and Function sections to the Builder.
2950
2951         6) Add support for local variables.
2952
2953         On the JSC side, we needed to expose a new function to validate the compiled wasm code
2954         behaves the way we expect. At least until the JS Wasm API is finished. The new validation
2955         function, testWasmModuleFunctions, takes an array buffer containing the wasm binary, the
2956         number of functions in the blob and tests for each of those functions.
2957
2958         * wasm/Builder.js:
2959         (const._maybeRegisterType):
2960         (const): Deleted.
2961         (switch.typeof): Deleted.
2962         * wasm/Builder_WebAssemblyBinary.js:
2963         (const.emitters.Type):
2964         (const.emitters.Import):
2965         (const.emitters.Function):
2966         (const.emitters.Memory):
2967         (const.emitters.Code):
2968         (export.const.Binary):
2969         * wasm/LowLevelBinary.js:
2970         (export.default.LowLevelBinary.prototype.get return):
2971         (export.default.LowLevelBinary.prototype.varuint32):
2972         (export.default.LowLevelBinary.prototype.varint32):
2973         (export.default.LowLevelBinary.prototype.varuint1):
2974         (export.default.LowLevelBinary.prototype.varint7):
2975         (export.default.LowLevelBinary.prototype.varuint7):
2976         (export.default.LowLevelBinary.prototype.inline_signature_type):
2977         (export.default.LowLevelBinary.prototype.string):
2978         (export.default.LowLevelBinary.prototype.getVaruint32):
2979         (export.default.LowLevelBinary.prototype.getVarint32):
2980         (export.default.LowLevelBinary.prototype.getVaruint7):
2981         (export.default.LowLevelBinary.prototype.getString):
2982         (export.default.LowLevelBinary):
2983         (export.default.LowLevelBinary.prototype.varuint): Deleted.
2984         (export.default.LowLevelBinary.prototype.varint): Deleted.
2985         (export.default.LowLevelBinary.prototype.getVaruint): Deleted.
2986         (export.default.LowLevelBinary.prototype.getVarint): Deleted.
2987         * wasm/js-api/test_old_tests.js: Added.
2988         (ret5):
2989         (brTableWithLoop):
2990         (brTableManyValues):
2991         (run.brTableManyValues.brTableAsIf):
2992         (ifThenFallthrough):
2993         (ifThenElseFallthrough):
2994         (dumbLessThanFallthrough):
2995         (run.dumbLessThanFallthrough.floatSub):
2996         (run.floatSub.add12):
2997         (run.add12.factorial):
2998         (i32load):
2999         (run.i32load.i32load8s):
3000         (run.i32load8s.dumbEqIfThenElse):
3001         (run.dumbEqIfThenElse.dumbEqIfThenElse):
3002         (run.dumbEqIfThenElse.dumbLessThanIfThenElse):
3003         (run.dumbLessThanIfThenElse.loopSum):
3004         (run.loopSum.loopMult):
3005         (brIfLoopLessThan):
3006         (run.brIfLoopLessThan.run):
3007         * wasm/self-test/test_LowLevelBinary_varint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varint.js.
3008         * wasm/self-test/test_LowLevelBinary_varuint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varuint.js.
3009
3010         * wasm/Builder.js:
3011         (const._maybeRegisterType):
3012         (const): Deleted.
3013         (switch.typeof): Deleted.
3014         * wasm/Builder_WebAssemblyBinary.js:
3015         (const.emitters.Type):
3016         (const.emitters.Import):
3017         (const.emitters.Function):
3018         (const.emitters.Memory):
3019         (const.emitters.Code):
3020         (export.const.Binary):
3021         * wasm/LowLevelBinary.js:
3022         (export.default.LowLevelBinary.prototype.get return):
3023         (export.default.LowLevelBinary.prototype.varuint32):
3024         (export.default.LowLevelBinary.prototype.varint32):
3025         (export.default.LowLevelBinary.prototype.varuint1):
3026         (export.default.LowLevelBinary.prototype.varint7):
3027         (export.default.LowLevelBinary.prototype.varuint7):
3028         (export.default.LowLevelBinary.prototype.inline_signature_type):
3029         (export.default.LowLevelBinary.prototype.string):
3030         (export.default.LowLevelBinary.prototype.getVaruint32):
3031         (export.default.LowLevelBinary.prototype.getVarint32):
3032         (export.default.LowLevelBinary.prototype.getVaruint7):
3033         (export.default.LowLevelBinary.prototype.getString):
3034         (export.default.LowLevelBinary):
3035         (export.default.LowLevelBinary.prototype.varuint): Deleted.
3036         (export.default.LowLevelBinary.prototype.varint): Deleted.
3037         (export.default.LowLevelBinary.prototype.getVaruint): Deleted.
3038         (export.default.LowLevelBinary.prototype.getVarint): Deleted.
3039         * wasm/js-api/function-tests/add-12.js: Added.
3040         * wasm/js-api/function-tests/br-if-loop-less-than.js: Added.
3041         * wasm/js-api/function-tests/brTableAsIf.js: Added.
3042         * wasm/js-api/function-tests/brTableManyValues.js: Added.
3043         * wasm/js-api/function-tests/brTableWithLoop.js: Added.
3044         * wasm/js-api/function-tests/dumb-eq-if-then-else.js: Added.
3045         * wasm/js-api/function-tests/dumb-less-than-fallthrough.js: Added.
3046         * wasm/js-api/function-tests/dumb-less-than-ite.js: Added.
3047         * wasm/js-api/function-tests/factorial.js: Added.
3048         * wasm/js-api/function-tests/float-sub.js: Added.
3049         * wasm/js-api/function-tests/i32-load.js: Added.
3050         * wasm/js-api/function-tests/i32-load8-s.js: Added.
3051         * wasm/js-api/function-tests/if-then-else-fallthrough.js: Added.
3052         * wasm/js-api/function-tests/if-then-fallthrough.js: Added.
3053         * wasm/js-api/function-tests/loop-mult.js: Added.
3054         * wasm/js-api/function-tests/loop-sum.js: Added.
3055         * wasm/js-api/function-tests/ret5.js: Added.
3056         * wasm/self-test/test_LowLevelBinary_varint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varint.js.
3057         * wasm/self-test/test_LowLevelBinary_varuint32.js: Renamed from JSTests/wasm/self-test/test_LowLevelBinary_varuint.js.
3058
3059 2016-11-11  Saam Barati  <sbarati@apple.com>
3060
3061         We recursively grab a lock in the DFGBytecodeParser causing us to deadlock
3062         https://bugs.webkit.org/show_bug.cgi?id=164650
3063
3064         Reviewed by Geoffrey Garen.
3065
3066         * stress/dont-dead-lock-put-by-val-as-put-by-id.js: Added.
3067         (ident):
3068         (let.o.set foo):
3069         (foo):
3070
3071 2016-11-11  Chris Dumez  <cdumez@apple.com>
3072
3073         Unreviewed, rolling out r208584.
3074
3075         Seems to have regressed Speedometer by 1% on Mac
3076
3077         Reverted changeset:
3078
3079         "We should have a more concise way of determining when we're
3080         varargs calling a function using rest parameters"
3081         https://bugs.webkit.org/show_bug.cgi?id=164258
3082         http://trac.webkit.org/changeset/208584
3083
3084 2016-11-11  Chris Dumez  <cdumez@apple.com>
3085
3086         Unreviewed, rolling out r208117 and r208160.
3087
3088         Regressed Speedometer by >1.5%
3089
3090         Reverted changesets:
3091
3092         "We should have a way of profiling when a get_by_id is pure
3093         and to emit a PureGetById in the DFG/FTL"
3094         https://bugs.webkit.org/show_bug.cgi?id=163305
3095         http://trac.webkit.org/changeset/208117
3096
3097         "Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing
3098         out"
3099         https://bugs.webkit.org/show_bug.cgi?id=164227
3100         http://trac.webkit.org/changeset/208160
3101
3102 2016-11-11  Saam Barati  <sbarati@apple.com>
3103
3104         We should have a more concise way of determining when we're varargs calling a function using rest parameters
3105         https://bugs.webkit.org/show_bug.cgi?id=164258
3106
3107         Reviewed by Yusuke Suzuki.
3108
3109         * microbenchmarks/call-using-spread.js: Added.
3110         (bar):
3111         (foo):
3112         * microbenchmarks/spread-large-array.js: Added.
3113         (foo):
3114         (arrays.push):
3115         * microbenchmarks/spread-small-array.js: Added.
3116         (foo):
3117         * stress/spread-array-iterator-watchpoint-2.js: Added.
3118         (foo):
3119         (arrayIterator.next):
3120         * stress/spread-array-iterator-watchpoint.js: Added.
3121         (foo):
3122         (Array.prototype.Symbol.iterator):
3123         * stress/spread-non-array.js: Added.
3124         (assert):
3125         (foo):
3126         (let.customIterator.Symbol.iterator):
3127         (bar):
3128
3129 2016-11-10  Mark Lam  <mark.lam@apple.com>
3130
3131         Fix broken have-a-bad-time-with-arguments.js test.
3132         https://bugs.webkit.org/show_bug.cgi?id=164626
3133
3134         Reviewed by Filip Pizlo.
3135
3136         But also saved a copy of the broken one as broken-have-a-bad-time-with-arguments-for-gc-testing.js
3137         because coincidentally, it stresses the GC in ways that help reveal bugs.
3138
3139         * stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js: Added.
3140         (testFunction):
3141         (warmupFunction):
3142         (let.argsDeclIndex.in.argumentsDecls.let.indexToReturnIndex.in.indicesToReturn.let.insertElementActionIndex.in.insertElementActions.let.tierWarmupCountIndex.in.tierWarmupCounts.let.testArgsIndex.in.testArgsList.catch):
3143         * stress/have-a-bad-time-with-arguments.js:
3144
3145 2016-11-10  JF Bastien  <jfbastien@apple.com>
3146
3147         ASSERTION FAILED: length > offset encountered with wasm.yaml/wasm/js-api/test_Module.js.default-wasm
3148         https://bugs.webkit.org/show_bug.cgi?id=164597
3149
3150         Reviewed by Keith Miller.
3151
3152         Trim the array buffer before returning it: it's optimistically
3153         over-allocated to avoid growing all the time, but when parsed it
3154         can't have extra content.
3155
3156         * wasm/Builder_WebAssemblyBinary.js:
3157         (export.const.Binary):
3158         * wasm/LowLevelBinary.js:
3159         (export.default.LowLevelBinary.prototype.get return):
3160
3161 2016-11-10  Joseph Pecoraro  <pecoraro@apple.com>
3162
3163         test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
3164         https://bugs.webkit.org/show_bug.cgi?id=164450
3165
3166         Reviewed by Darin Adler.
3167
3168         * stress/dataview-typedarray-toindex.js: Added.
3169         Tests for all cases where ToIndex should be used.
3170
3171         * test262.yaml:
3172         New passing tests.
3173
3174 2016-11-10  Mark Lam  <mark.lam@apple.com>
3175
3176         Graph::methodOfGettingAValueProfileFor() should be returning the profile for the operand node.
3177         https://bugs.webkit.org/show_bug.cgi?id=164600
3178         <rdar://problem/28828676>
3179
3180         Reviewed by Filip Pizlo.
3181
3182         * stress/osr-exit-on-op-negate-should-no-fail-assertions.js: Added.
3183
3184 2016-11-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3185
3186         [JSC] Avoid cloned arguments allocation in ArrayPrototype methods
3187         https://bugs.webkit.org/show_bug.cgi?id=164502
3188
3189         Reviewed by Saam Barati.
3190
3191         * stress/argument-intrinsic-basic.js: Added.
3192         (shouldBe):
3193         (builtin.createBuiltin):
3194         * stress/argument-intrinsic-inlining-with-result-escape.js: Added.
3195         (shouldBe):
3196         (builtin.createBuiltin):
3197         (escape):
3198         * stress/argument-intrinsic-nested-inlining.js: Added.
3199         (shouldBe):
3200         (builtin.createBuiltin):
3201         (builtinCaller1):
3202         (builtinCaller2):
3203         (escape):
3204         * stress/argument-intrinsic-not-convert-to-get-argument.js: Added.
3205         (shouldBe):
3206         (builtin.createBuiltin):
3207         * stress/argument-intrinsic-with-stack-write.js: Added.
3208         (shouldBe):
3209         (builtin.createBuiltin):
3210
3211 2016-11-09  Saam Barati  <sbarati@apple.com>
3212
3213         Math.min()/Math.max() with no arguments is lowered incorrectly in the BytecodeParser
3214         https://bugs.webkit.org/show_bug.cgi?id=164464
3215         <rdar://problem/29131452>
3216
3217         Reviewed by Darin Adler.
3218
3219         * stress/math-max-min-no-arguments.js: Added.
3220         (assert):
3221         (min):
3222         (max):
3223         (test):
3224
3225 2016-11-09  Saam Barati  <sbarati@apple.com>
3226
3227         TypeProfiler and running GC collection on another thread don't play nicely with each other
3228         https://bugs.webkit.org/show_bug.cgi?id=164441
3229         <rdar://problem/29132174>
3230
3231         Reviewed by Geoffrey Garen.
3232
3233         * typeProfiler/type-profiler-gc.js: Added.
3234         (bar):
3235         (foo):
3236
3237 2016-11-04  Mark Lam  <mark.lam@apple.com>
3238
3239         Error description code should be able to handle Symbol values.
3240         https://bugs.webkit.org/show_bug.cgi?id=164436
3241         <rdar://problem/29115583>
3242
3243         Reviewed by Filip Pizlo and Saam Barati.
3244
3245         * stress/error-description-on-symbols-should-not-crash.js: Added.
3246
3247 2016-11-03  Geoffrey Garen  <ggaren@apple.com>
3248
3249         EvalCodeCache should not give up in strict mode and other cases
3250         https://bugs.webkit.org/show_bug.cgi?id=164357
3251
3252         Reviewed by Michael Saboff.
3253
3254         * microbenchmarks/eval-cached.js: Added. 45x faster now.
3255         * stress/eval-cached.js: Added. Try running the same eval text in a bunch
3256         of different scopes and verify that we access the right scope.
3257
3258 2016-11-04  JF Bastien  <jfbastien@apple.com>
3259
3260         WebAssembly JS API: implement more sections
3261         https://bugs.webkit.org/show_bug.cgi?id=164023
3262
3263         Reviewed by Keith Miller.
3264
3265         On the JSC side:
3266
3267          - Put in parser stubs for all WebAssembly sections.
3268          - Parse Import, Export sections.
3269          - 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.
3270          - Encapsulate all parsed module information into its own structure, making it easier to pass around (from parser to Plan to Module to Instance).
3271          - Create WasmFormat.cpp to hold parsed module information's dtor to avoid including WasmMemory.h needlessly.
3272          - parseCode: avoid overflow through function size.
3273          - Remove all remainders of polyfill-prototype-1, and update license.
3274          - Add missing WasmOps.h and WasmValidateInlines.h auto-generation for cmake build.
3275
3276         On the Builder.js testing side:
3277
3278          - Implement Type, Import (function only), Export (function only) sections.
3279          - Check section order and uniqueness.
3280          - Optionally auto-generate the Type section from subsequent Export / Import / Code entries.
3281          - Allow re-exporting an import.
3282
3283         * wasm/Builder.js: build type, import, and export sections
3284         (const._normalizeFunctionSignature):
3285         * wasm/Builder_WebAssemblyBinary.js: Added. Forked from Builder.js
3286         (const.emitters.Type):
3287         (const.emitters.Import):
3288         (const.emitters.Function):
3289         (const.emitters.Table):
3290         (const.emitters.Memory):
3291         (const.emitters.Global):
3292         (const.emitters.Export):
3293         (const.emitters.Start):
3294         (const.emitters.Element):
3295         (const.emitters.Code):
3296         (const.emitters.Data):
3297         (export.const.Binary):
3298         * wasm/LowLevelBinary.js: Add a few useful outputs
3299         (export.default.LowLevelBinary.prototype.varuint1):
3300         (export.default.LowLevelBinary.prototype.varint7):
3301         * wasm/WASM.js: value type and external kind helpers
3302         * wasm/assert.js: array element-wise equality comparison
3303         (const._eq):
3304         * wasm/js-api/test_Module.js:
3305         (ModuleWithImports):
3306         * 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
3307         (const.assertOpThrows):
3308         (SectionsWithSameCustomName):
3309         (TwoTypeSections):
3310         (EmptyImportSection):
3311         (ImportBeforeTypeSections):
3312         * wasm/self-test/test_BuilderWebAssembly.js: remove a test which wasn't helpful and is now obsolete
3313         (CustomSection):
3314
3315 2016-11-03  Mark Lam  <mark.lam@apple.com>
3316
3317         ClonedArguments need to also support haveABadTime mode.
3318         https://bugs.webkit.org/show_bug.cgi?id=164200
3319         <rdar://problem/27211336>
3320
3321         Reviewed by Geoffrey Garen.
3322
3323         * stress/have-a-bad-time-with-arguments.js: Added.
3324
3325 2016-11-03  Filip Pizlo  <fpizlo@apple.com>
3326
3327         DFG plays fast and loose with the shadow values of a Phi
3328         https://bugs.webkit.org/show_bug.cgi?id=164309
3329
3330         Reviewed by Saam Barati.
3331         
3332         This test demonstrates why the DFG needs to recognize the shadow value of a Phi.
3333
3334         * stress/dfg-ssa-swap.js: Added.
3335         (foo):
3336
3337 2016-11-03  Commit Queue  <commit-queue@webkit.org>
3338
3339         Unreviewed, rolling out r208364.
3340         https://bugs.webkit.org/show_bug.cgi?id=164402
3341
3342         broke the build (Requested by smfr on #webkit).
3343
3344         Reverted changeset:
3345
3346         "DFG plays fast and loose with the shadow values of a Phi"
3347         https://bugs.webkit.org/show_bug.cgi?id=164309
3348         http://trac.webkit.org/changeset/208364
3349
3350 2016-11-03  Filip Pizlo  <fpizlo@apple.com>
3351
3352         DFG plays fast and loose with the shadow values of a Phi
3353         https://bugs.webkit.org/show_bug.cgi?id=164309
3354
3355         Reviewed by Saam Barati.
3356         
3357         This test demonstrates why the DFG needs to recognize the shadow value of a Phi.
3358
3359         * stress/dfg-ssa-swap.js: Added.
3360         (foo):
3361
3362 2016-11-03  Saam Barati  <sbarati@apple.com>
3363
3364         Asking for a value profile prediction should be defensive against not finding a value profile
3365         https://bugs.webkit.org/show_bug.cgi?id=164306
3366
3367         Reviewed by Mark Lam.
3368
3369         * stress/inlined-tail-call-in-inlined-setter-should-not-crash-when-getting-value-profile.js: Added.
3370         (let.o.set foo):
3371         (bar):
3372
3373 2016-11-02  Saam Barati  <sbarati@apple.com>
3374
3375         Allocation elimination of rest parameter doesn't take into account indexed properties on Array.prototype/Object.prototype
3376         https://bugs.webkit.org/show_bug.cgi?id=164301
3377
3378         Reviewed by Geoffrey Garen.
3379
3380         * stress/rest-parameter-allocation-elimination-watchpoints-2.js: Added.
3381         (assert):
3382         (foo):
3383         * stress/rest-parameter-allocation-elimination-watchpoints-3.js: Added.
3384         (assert):
3385         (foo):
3386         * stress/rest-parameter-allocation-elimination-watchpoints-4.js: Added.
3387         (assert):
3388         (foo):
3389         * stress/rest-parameter-allocation-elimination-watchpoints-5.js: Added.
3390         (assert):
3391         (foo):
3392         * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Added.
3393         (assert):
3394         (foo):
3395         * stress/rest-parameter-allocation-elimination-watchpoints.js: Added.
3396         (assert):
3397         (foo):
3398
3399 2016-11-01  Saam Barati  <sbarati@apple.com>
3400
3401         We should be able to eliminate rest parameter allocations
3402         https://bugs.webkit.org/show_bug.cgi?id=163925
3403
3404         Reviewed by Filip Pizlo.
3405
3406         * microbenchmarks/rest-parameter-allocation-elimination.js: Added.
3407         (assert):
3408         (test1.bar):
3409         (test1):
3410         (test2.jaz):
3411         (test2.jaz2.kaz):
3412         (test2.jaz2):
3413         (test2):
3414         (test3.foo):
3415         (test3.baz):
3416         (test3.jaz):
3417         (test3):
3418         (test4.baz):
3419         (test4.jaz):
3420         (test4):
3421         (test5.baz):
3422         (test5.jaz):
3423         (test5):
3424         (test6.baz):
3425         (test6.jaz):
3426         (test6):
3427         (test7.baz):
3428         (test7.jaz):
3429         (test7.check):
3430         (test7):
3431         (test8.baz):
3432         (test8.jaz):
3433         (test8.check):
3434         (test8):
3435         (test9.baz):
3436         (test9.jaz):
3437         (test9.check):
3438         (test9):
3439         (test10.baz):
3440         (test10.jaz):
3441         (test10):
3442         (test11.bar):
3443         (test11.foo):
3444         (test11.makeArguments):
3445         (test11.):
3446         (test12):
3447         (test12.bar):
3448         (test12.foo):
3449         (test12.makeArguments):
3450         (test12.):
3451         (test13.bar):
3452         (test13.top):
3453         (test13.foo):
3454         (test13.makeArguments):
3455         (test13.):
3456         (test13):
3457         (test14.bar):
3458         (test14.top):
3459         (test14.foo):
3460         (test14.makeArguments):
3461         (test14.):
3462         (test14):
3463         (test15.bar):
3464         (test15.top):
3465         (test15.foo):
3466         (test15.makeArguments):
3467         (test15.):
3468         (test15):
3469
3470 2016-11-01  Commit Queue  <commit-queue@webkit.org>
3471
3472         Unreviewed, rolling out r208208 and r208210.
3473         https://bugs.webkit.org/show_bug.cgi?id=164276
3474
3475         This change caused 28 JSC test failures. (Requested by
3476         ryanhaddad on #webkit).
3477
3478         Reverted changesets:
3479
3480         "We should be able to eliminate rest parameter allocations"
3481         https://bugs.webkit.org/show_bug.cgi?id=163925
3482         http://trac.webkit.org/changeset/208208
3483
3484         "Fix the EFL build."
3485         http://trac.webkit.org/changeset/208210
3486
3487 2016-10-31  Filip Pizlo  <fpizlo@apple.com>
3488
3489         JSC should support SharedArrayBuffer
3490         https://bugs.webkit.org/show_bug.cgi?id=163986
3491
3492         Reviewed by Keith Miller.
3493         
3494         This adds our own test for the various corner cases of SharedArrayBuffer. This test is meant to
3495         check all of the things that don't require concurrency.
3496
3497         * stress/SharedArrayBuffer.js: Added.
3498         (checkAtomics):
3499         (shouldFail):
3500         (Symbol):
3501         (runAtomic):
3502
3503 2016-10-31  Saam Barati  <sbarati@apple.com>
3504
3505         We should be able to eliminate rest parameter allocations
3506         https://bugs.webkit.org/show_bug.cgi?id=163925
3507
3508         Reviewed by Filip Pizlo.
3509
3510         * microbenchmarks/rest-parameter-allocation-elimination.js: Added.
3511         (assert):
3512         (test1.bar):
3513         (test1):
3514         (test2.jaz):
3515         (test2.jaz2.kaz):
3516         (test2.jaz2):
3517         (test2):
3518         (test3.foo):
3519         (test3.baz):
3520         (test3.jaz):
3521         (test3):
3522         (test4.baz):
3523         (test4.jaz):
3524         (test4):
3525         (test5.baz):
3526         (test5.jaz):
3527         (test5):
3528         (test6.baz):
3529         (test6.jaz):
3530         (test6):
3531         (test7.baz):
3532         (test7.jaz):
3533         (test7.check):
3534         (test7):
3535         (test8.baz):
3536         (test8.jaz):
3537         (test8.check):
3538         (test8):
3539         (test9.baz):
3540         (test9.jaz):
3541         (test9.check):
3542         (test9):
3543         (test10.baz):
3544         (test10.jaz):
3545         (test10):
3546         (test11.bar):
3547         (test11.foo):
3548         (test11.makeArguments):
3549         (test11.):
3550         (test12):
3551         (test12.bar):
3552         (test12.foo):
3553         (test12.makeArguments):
3554         (test12.):
3555         (test13.bar):
3556         (test13.top):
3557         (test13.foo):
3558         (test13.makeArguments):
3559         (test13.):
3560         (test13):
3561         (test14.bar):
3562         (test14.top):
3563         (test14.foo):
3564         (test14.makeArguments):
3565         (test14.):
3566         (test14):
3567         (test15.bar):
3568         (test15.top):
3569         (test15.foo):
3570         (test15.makeArguments):
3571         (test15.):
3572         (test15):
3573
3574 2016-10-31  Saam Barati  <sbarati@apple.com>
3575
3576         Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing out
3577         https://bugs.webkit.org/show_bug.cgi?id=164227
3578
3579         Unreviewed timeout fix.
3580
3581         * microbenchmarks/pure-get-by-id-cse-2.js:
3582
3583 2016-10-31  Keith Miller  <keith_miller@apple.com>
3584
3585         autogenerated files from wasm.json should be in derived sources.
3586         https://bugs.webkit.org/show_bug.cgi?id=164152
3587
3588         Reviewed by Filip Pizlo.
3589
3590         Delete generation script since it is no longer used.
3591
3592         * wasm/generate-wasmops-header.js: Removed.
3593
3594 2016-10-29  Yusuke Suzuki  <utatane.tea@gmail.com>
3595
3596         [JSC] JSON.stringify should handle Proxy which is non JSArray but isArray is true
3597         https://bugs.webkit.org/show_bug.cgi?id=164123
3598
3599         Reviewed by Mark Lam.
3600
3601         * stress/json-stringify-with-non-jsarray-array.js: Added.
3602         (shouldBe):
3603         (shouldBe.JSON.stringify.new.Proxy):
3604
3605 2016-10-29  Saam Barati  <sbarati@apple.com>
3606
3607         We should have a way of profiling when a get_by_id is pure and to emit a PureGetById in the DFG/FTL
3608         https://bugs.webkit.org/show_bug.cgi?id=163305
3609
3610         Reviewed by Keith Miller.
3611
3612         * microbenchmarks/pure-get-by-id-cse-2.js: Added.
3613         (foo):
3614         * microbenchmarks/pure-get-by-id-cse.js: Added.
3615         (foo):
3616         * stress/pure-get-by-id-cse-correctness.js: Added.
3617         (assert):
3618         (foo):
3619         * stress/pure-get-by-id-on-non-object.js: Added.
3620         (assert):
3621         (foo):
3622
3623 2016-10-28  Csaba Osztrogonác  <ossy@webkit.org>
3624
3625         Skip JSTests/microbenchmarks/dense-set.js on memory limited devices
3626         https://bugs.webkit.org/show_bug.cgi?id=164128
3627
3628         Reviewed by Mark Lam.
3629
3630         * microbenchmarks/dense-set.js:
3631
3632 2016-10-20  Caitlin Potter  <caitp@igalia.com>
3633
3634         [JSC] implement runtime for async functions
3635         https://bugs.webkit.org/show_bug.cgi?id=163760
3636
3637         Reviewed by Yusuke Suzuki.
3638
3639         * stress/async-await-basic.js: Added.
3640         (shouldBe):
3641         (shouldBeAsync):
3642         (shouldThrow):
3643         (shouldThrowAsync):
3644         (shouldThrowSyntaxError):
3645         (let.AsyncFunction.async):
3646         (async.asyncFunctionForProto):
3647         (Object.getPrototypeOf.async):
3648         (Object.getPrototypeOf.async.method):
3649         (async):
3650         (async.method):
3651         (async.asyncNonConstructorDecl):
3652         (shouldThrow.new.async):
3653         (shouldThrow.new.async.nonConstructor):
3654         (async.asyncDecl):
3655         (async.f):
3656         (MyError):
3657         (async.asyncDeclThrower):
3658         (shouldThrowAsync.async):
3659         (resolveLater):
3660         (rejectLater):
3661         (async.resumeAfterNormal):
3662         (O.async.resumeAfterNormal):
3663         (resumeAfterNormalArrow.async):
3664         (async.resumeAfterThrow):
3665         (O.async.resumeAfterThrow):
3666         (resumeAfterThrowArrow.async):
3667         (catch):
3668         * stress/async-await-module-reserved-word.js: Added.
3669         (shouldThrow):
3670         (SyntaxError.Canstring_appeared_hereawait.checkModuleSyntaxError.String.raw.await):
3671         (checkModuleSyntaxError.String.raw.await):
3672         (checkModuleSyntaxError.String.raw.async.await):
3673         (SyntaxError.Cannot.declare.named):
3674         * stress/async-await-mozilla.js: Added.
3675         (shouldBe):
3676         (shouldBeAsync):
3677         (shouldThrow):
3678         (shouldThrowAsync):
3679         (assert):
3680         (shouldThrowSyntaxError):
3681         (mozSemantics.async.empty):
3682         (mozSemantics.async.simpleReturn):
3683         (mozSemantics.async.simpleAwait):
3684         (mozSemantics.async.simpleAwaitAsync):
3685         (mozSemantics.async.returnOtherAsync):
3686         (mozSemantics.async.simpleThrower):
3687         (mozSemantics.async.delegatedThrower):
3688         (mozSemantics.async.tryCatch):
3689         (mozSemantics.async.tryCatchThrow):
3690         (mozSemantics.async.wellFinally):
3691         (mozSemantics.async.finallyMayFail):
3692         (mozSemantics.async.embedded.async.inner):
3693         (mozSemantics.async.embedded):
3694         (mozSemantics.async.fib):
3695         (mozSemantics.async.isOdd.async.isEven):
3696         (mozSemantics.async.isOdd):
3697         (mozSemantics.hardcoreFib.async.fib2):
3698         (mozSemantics.namedAsyncExpr.async.simple):
3699         (mozSemantics.async.executionOrder.async.first):
3700         (mozSemantics.async.executionOrder.async.second):
3701         (mozSemantics.async.executionOrder.async.third):
3702         (mozSemantics.async.executionOrder):
3703         (mozSemantics.async.miscellaneous):
3704         (mozSemantics.thrower):
3705         (mozSemantics.async.defaultArgs):
3706         (mozSemantics.shouldThrow):
3707         (mozSemantics):
3708         (mozMethods.X):
3709         (mozMethods.X.prototype.async.getValue):
3710         (mozMethods.X.prototype.setValue):
3711         (mozMethods.X.prototype.async.increment):
3712         (mozMethods.X.prototype.async.getBaseClassName):
3713         (mozMethods.X.async.getStaticValue):
3714         (mozMethods.Y.prototype.async.getBaseClassName):
3715         (mozMethods.Y):
3716         (mozFunctionNameInferrence.async.test):
3717         (mozSyntaxErrors):
3718         * stress/async-await-reserved-word.js: Added.
3719         (assert):
3720         (shouldThrowSyntaxError):
3721         (AsyncFunction.async):
3722         * stress/async_arrow_functions_lexical_arguments_binding.js: Added.
3723         (shouldBe):
3724         (shouldBeAsync):
3725         (shouldThrowAsync):
3726         (noArgumentsArrow2.async):
3727         * stress/async_arrow_functions_lexical_new.target_binding.js: Added.
3728         (shouldBe):
3729         (shouldBeAsync):
3730         (shouldThrowAsync):
3731         (C1):
3732         (C2):
3733         (shouldThrowAsync.async):
3734         * stress/async_arrow_functions_lexical_super_binding.js: Added.
3735         (shouldBe):
3736         (shouldBeAsync):
3737         (BaseClass.prototype.baseClassValue):
3738         (BaseClass.prototype.get property):
3739         (BaseClass):
3740         (ChildClass.prototype.asyncSuperProp):
3741         (ChildClass.prototype.asyncSuperProp2):
3742         (ChildClass):
3743         (ChildClass2):
3744         * stress/async_arrow_functions_lexical_this_binding.js: Added.
3745         (shouldBe):
3746         (shouldBeAsync):
3747         (d.y):
3748
3749 2016-10-28  Csaba Osztrogonác  <ossy@webkit.org>
3750
3751         Skip 2 JS stress tests on memory limited devices
3752         https://bugs.webkit.org/show_bug.cgi?id=164125
3753
3754         Unreviewed quick fix to unbreak JSCOnly ARM bots as soon as possible.
3755
3756         * stress/joined-strings-should-not-exceed-max-string-length.js:
3757         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
3758
3759 2016-10-27  Caitlin Potter  <caitp@igalia.com>
3760
3761         [JSC] forbid lexical redeclaration of generator formal parameters
3762         https://bugs.webkit.org/show_bug.cgi?id=163930
3763
3764         Reviewed by Yusuke Suzuki.
3765
3766         * stress/async-await-syntax.js:
3767         * stress/generator-syntax.js:
3768         (testSyntaxError.gen):
3769         (testSyntaxError.arguments):
3770         (testSyntaxError.eval):
3771         * test262.yaml:
3772
3773 2016-10-26  JF Bastien  <jfbastien@apple.com>
3774
3775         WebAssembly API: implement Instance
3776
3777         As described in: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-objects
3778
3779          - Take ownership of Wasm::Plan's compilation result when successfully creating a JSWebAssemblyModule object.
3780          - Construct a basic Instance with a Module.
3781          - Handle second argument (importObject) of WebAssembly.Instance.
3782          - Add reference text from the spec to WebAssembly.Module's code.
3783          - Expose and test an empty 'exports' ModuleNamespaceObject on WebAssembly.Instance.
3784
3785         The implementation isn't complete yet: it relies on further work for which I've filed bugs.
3786
3787         WebAssembly API: implement Instance
3788         https://bugs.webkit.org/show_bug.cgi?id=163998
3789
3790         Reviewed by Keith Miller.
3791
3792         * wasm/js-api/test_Instance.js: Added.
3793         (EmptyModule): use the Builder, create the simplest Module possible, and create an Instance from it
3794         * wasm/js-api/test_basic_api.js:
3795         (const.c.in.constructorProperties.switch): basic tests of the API
3796
3797 2016-10-26  Mark Lam  <mark.lam@apple.com>
3798
3799         JSGenericTypedArrayView::set() should check for exceptions.
3800         https://bugs.webkit.org/show_bug.cgi?id=164007
3801         <rdar://problem/28853775>
3802
3803         Reviewed by Filip Pizlo.
3804
3805         * stress/typed-array-view-set-should-not-crash-on-exception.js: Added.
3806
3807 2016-10-25  Mark Lam  <mark.lam@apple.com>
3808
3809         String.prototype.replace() should throw an OutOfMemoryError when using too much memory.
3810         https://bugs.webkit.org/show_bug.cgi?id=163996
3811         <rdar://problem/28263117>
3812
3813         Reviewed by Geoffrey Garen.
3814
3815         * stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js: Added.
3816
3817 2016-10-25  Mark Lam  <mark.lam@apple.com>
3818
3819         JSStringJoiner::joinedLength() should limit joined string lengths to INT_MAX.
3820         https://bugs.webkit.org/show_bug.cgi?id=163937
3821         <rdar://problem/28642990>
3822
3823         Reviewed by Geoffrey Garen.
3824
3825         * stress/joined-strings-should-not-exceed-max-string-length.js: Added.
3826
3827 2016-10-25  JF Bastien  <jfbastien@apple.com>
3828
3829         WebAssembly JS API: simple Module test
3830         https://bugs.webkit.org/show_bug.cgi?id=163963
3831
3832         Reviewed by Filip Pizlo.
3833
3834         * wasm/LowLevelBinary.js:
3835         (export.default.LowLevelBinary.prototype.get return): get the ArrayBuffer
3836         (export.default.LowLevelBinary.prototype.hexdump): Deleted.
3837         (export.default.LowLevelBinary.prototype._maybeGrow): Deleted.
3838         * wasm/js-api/test_Module.js: Added.
3839         (EmptyModule): The most basic module possible
3840
3841 2016-10-25  JF Bastien  <jfbastien@apple.com>
3842
3843         WebAssembly JS API: implement Module
3844
3845         This implementation allows us to:
3846          - Syncrhonously create a WebAssembly.Module with a typed array.
3847          - Creates a compilation plan.
3848          - Parse the Module and creates corresponding code.
3849          - Throw WebAssembly.CompileError with mildly helpful [*] error messages on
3850            failure.
3851
3852         Consult the API documentation for expected behavior: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodule-constructor
3853
3854         For now the implementation discards the generated code.
3855
3856         The next steps will be:
3857          - Expose a Module's exports.
3858          - Implement WebAssembly.Instance, which allows instantiating and running a
3859            compiled Module.
3860          - Beef up the testing infrastructure under JSTests/wasm so that more complex
3861            modules can be created and tested (instead of writing the bits by hand).
3862
3863         This patch also:
3864          - Adds assert.instanceof in assert.js.
3865          - Refactors Wasm::Parser and friends to accept const uint8_t* as well as a
3866            Vector, to avoid copying when invoked synchronously.
3867          - Remove useless Structure from some of the wasm constructors: they're already
3868            on the JSGlobalObject, visited properly and all.
3869          - Fix off-by-one error in parsing: Parser::parseUInt32 failed if the integer
3870            was exactly at end of file.
3871
3872          [*] On error messages while parsing: I filed https://bugs.webkit.org/show_bug.cgi?id=163919
3873
3874         WebAssembly JS API: implement Module
3875         https://bugs.webkit.org/show_bug.cgi?id=163903
3876
3877         Reviewed by Keith Miller.
3878
3879         * wasm/assert.js: use underscore in name, and remove when exporting to avoid clasing with builtin names
3880         (const._notUndef):
3881         (const._isUndef):
3882         (const._eq):
3883         (const._ge):
3884         (const._throws):
3885         * wasm/js-api/test_basic_api.js: test the WebAssembly.Module API
3886         (const.c.in.constructorProperties.switch):
3887
3888 2016-10-25  Keith Miller  <keith_miller@apple.com>
3889
3890         Add trivial Wasm conversion opcodes
3891         https://bugs.webkit.org/show_bug.cgi?id=163950
3892
3893         Reviewed by Filip Pizlo.
3894
3895         This patch differentiates between Wasm opcodes that are trivially mapped to a B3 opcode and
3896         those that are not.  Some of the Wasm opcodes that are currently a non-simple opcode will
3897         become simple as we add B3 opcodes for Wasm operations.  The remaining opcodes will need to
3898         be added via patchpoints in a later patch.
3899
3900         * wasm/generate-wasmops-header.js:
3901         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.Wasm.inline.bool.isSimple):
3902         * wasm/wasm.json:
3903
3904 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3905
3906         Arrow functions with concise bodies cannot return regular expressions
3907         https://bugs.webkit.org/show_bug.cgi?id=163162
3908
3909         Reviewed by Filip Pizlo.
3910
3911         * ChakraCore/test/Operators/instanceof.baseline-jsc:
3912         * ChakraCore/test/Regex/nul_character.baseline-jsc:
3913         * ChakraCore/test/es5/Lex_u3.baseline-jsc:
3914         * stress/parse-regexp-as-token.js: Added.
3915         (shouldBe):
3916
3917 2016-10-24  Keith Miller  <keith_miller@apple.com>
3918
3919         Wasm should support floating point operations.
3920         https://bugs.webkit.org/show_bug.cgi?id=163770
3921
3922         Reviewed by Michael Saboff.
3923
3924         Add appropriate b3op names for floating point wasm bytecodes, where they exist.
3925         Also, fix some WASM => Wasm in WasmOps.h generator script that I missed
3926         the first time I made the change.
3927
3928         * wasm/generate-wasmops-header.js:
3929         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.template.typename.Int.inline.bool.isValidOpType): Deleted.
3930         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.BinaryOpType): Deleted.
3931         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.UnaryOpType): Deleted.
3932         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.LoadOpType): Deleted.
3933         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.StoreOpType): Deleted.
3934         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.undef.CREATE_ENUM_VALUE.inline.bool.isControlOp): Deleted.
3935         * wasm/wasm.json:
3936
3937 2016-10-21  Saam Barati  <sbarati@apple.com>
3938
3939         SpeculativeJIT::compileTryGetById needs to pass in NeedsToSpill along both the cell speculation and untyped speculation path
3940         https://bugs.webkit.org/show_bug.cgi?id=163622
3941
3942         Reviewed by Yusuke Suzuki.
3943
3944         * stress/try-get-by-id-should-spill-registers-dfg.js: Added.
3945         (let.f.createBuiltin):
3946
3947 2016-10-21  Caitlin Potter  <caitp@igalia.com>
3948
3949         [JSC] don't crash when arguments to `new Function()` produce unexpected AST
3950         https://bugs.webkit.org/show_bug.cgi?id=163748
3951
3952         Reviewed by Mark Lam.
3953
3954         * stress/regress-163748.js: Added.
3955         (assert):
3956         (shouldThrowSyntaxError):
3957         (GeneratorFunction):
3958
3959 2016-10-20  Keith Miller  <keith_miller@apple.com>
3960
3961         Add support for WASM calls
3962         https://bugs.webkit.org/show_bug.cgi?id=161727
3963
3964         Reviewed by Filip Pizlo and Michael Saboff.
3965
3966         Add members of the Call category to the WASMOps special group.
3967
3968         * wasm/generate-wasmops-header.js:
3969
3970 2016-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3971
3972         [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
3973         https://bugs.webkit.org/show_bug.cgi?id=163761
3974
3975         Reviewed by Keith Miller.
3976
3977         * modules/string-prototype-module-scope.js: Added.
3978         (shouldBe):
3979         (catch):
3980         (refer):
3981         * stress/string-prototype-scopes-global-lexical-environment-strict.js: Added.
3982         (shouldBe):
3983         (catch):
3984         * stress/string-prototype-scopes-global-lexical-environment.js: Added.
3985         (shouldBe):
3986         (catch):
3987         * stress/string-prototype-scopes-strict.js: Added.
3988         (shouldBe):
3989         (catch):
3990         (try.refer):
3991         (refer):
3992         * stress/string-prototype-scopes.js: Added.
3993         (shouldBe):
3994         (catch):
3995         (try.refer):
3996         (refer):
3997         (object.toString):
3998         (with):
3999
4000 2016-10-20  JF Bastien  <jfbastien@apple.com>
4001
4002         WebAssembly API: implement exception constructors properly
4003
4004          - Rename WebAssemblyObject to JSWebAssembly for consistency.
4005          - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
4006            use it to register JSWebAssembly's function properties through auto-generated
4007            .lut.h, instead of manually.
4008          - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
4009          - Register WebAssembly's constructors from the global object, and hold a
4010            reference to their structure and prototype so that invoking the constructor
4011            can use the structure directly from the global object.
4012          - Add a prototype base field to global object creation. Previous ones all had
4013            Object's prototype as their base, but WebAssembly's error constructors have
4014            Error as their base.
4015          - Test for the error object's correctness.
4016          - Add missing #if ENABLE(WEBASSEMBLY)
4017
4018         WebAssembly API: implement exception constructors properly
4019         https://bugs.webkit.org/show_bug.cgi?id=163699
4020
4021         Reviewed by Keith Miller.
4022
4023         * wasm/js-api/test_basic_api.js:
4024         (const.c.in.constructorProperties): more tests
4025
4026 2016-10-20  Caitlin Potter  <caitp@igalia.com>
4027
4028         [JSC] disallow references to `await` in AsyncFunction formal parameters
4029         https://bugs.webkit.org/show_bug.cgi?id=163694
4030
4031         Reviewed by Saam Barati.
4032
4033         * stress/async-await-syntax.js:
4034
4035 2016-10-20  Keith Miller  <keith_miller@apple.com>
4036
4037         Invalid assertion in arguments elimination
4038         https://bugs.webkit.org/show_bug.cgi?id=163740
4039         <rdar://problem/27911462>
4040
4041         Reviewed by Michael Saboff.
4042
4043         * stress/direct-arguments-osr-entry.js: Added.
4044         (foo.):
4045         (foo):
4046
4047 2016-10-20  Caitlin Potter  <caitp@igalia.com>
4048
4049         [JSC] throw TypeError when constructing dynamically created JSGeneratorFunction
4050         https://bugs.webkit.org/show_bug.cgi?id=163714
4051
4052         Reviewed by Mark Lam.
4053
4054         Add missing test coverage that dynamically created
4055         JSGeneratorFunctions can not be constructed.
4056
4057         * stress/generator-function-constructor.js:
4058         (shouldThrow):
4059
4060 2016-10-19  JF Bastien  <jfbastien@apple.com>
4061
4062         JavaScript WebAssembly API: baby steps
4063
4064          - Expand WebAssembly constructors into their own files. This requires a lot of
4065            boilerplate, as well as adding the .lut.h files. All of the
4066            JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
4067            currently the same between the 4 specified WebAssembly constructors. It'll be
4068            easy to implement individual functions on constructed objects as per the
4069            spec, and have each of these files diverge. The error constructors are also
4070            similar, except that their instance derives from ErrorInstance.
4071          - Use constructor macro when initializing the global object.
4072          - Dramatically improve testing of the WebAssembly API by checking for
4073            properties specified in the spec [*].
4074          - Clean up assert.js' exception testing.
4075          - Fix a copy-paste bug in wasm.json: floating-point const return values were
4076            swapped.
4077
4078         [*] https://github.com/WebAssembly/design/blob/master/JS.md
4079
4080         Implement more of the JavaScript WebAssembly API
4081         https://bugs.webkit.org/show_bug.cgi?id=163571
4082
4083         Reviewed by Keith Miller.
4084
4085         * wasm/assert.js:
4086         (export.const.isUndef): add this useful helper
4087         (export.const.throws): fold other throw checks into this one, and check message as well
4088         * wasm/js-api/test_basic_api.js:
4089         (const.checkOwnPropertyDescriptor): check own property descriptor follows the spec
4090         * wasm/self-test/test_BuilderJSON.js:
4091         (const.assertOpThrows): use new assert API
4092         (CheckedOpcodeArgumentsTooMany): ditto
4093         (CheckedOpcodeArgumentsNotEnough): ditto
4094         (CallInvalid): ditto
4095         (I32ConstInvalid): ditto
4096         (F32ConstInvalid): ditto (and this caugth the JSON copy-paste bug)
4097         (F64ConstInvalid): ditto
4098         * wasm/self-test/test_LowLevelBinary_varint.js: use new assert API
4099         * wasm/self-test/test_LowLevelBinary_varuint.js: use new assert API
4100         * wasm/utilities.js: add "global" object, used in basic API test (to access global.WebAssembly).
4101         * wasm/wasm.json: fix copy-paste
4102
4103 2016-10-19  Caitlin Potter  <caitp@igalia.com>
4104
4105         [JSC] forbid "use strict" directive in generator functions with non-simple parameters
4106         https://bugs.webkit.org/show_bug.cgi?id=163683
4107
4108         Reviewed by Geoffrey Garen.
4109
4110         Update various generator*-non-simple-param.js tests to be passing.
4111
4112         * test262.yaml:
4113
4114 2016-10-18  Mark Lam  <mark.lam@apple.com>
4115
4116         Invoking Object.prototype.__proto__ accessors directly should throw a TypeError.
4117         https://bugs.webkit.org/show_bug.cgi?id=154377
4118         <rdar://problem/27330808>
4119
4120         Reviewed by Filip Pizlo and Saam Barati.
4121
4122         * stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js: Added.
4123
4124 2016-10-18  Keith Miller  <keith_miller@apple.com>
4125
4126         GetByVal to GetById conversion in the DFG is incorrect for getters with control flow
4127         https://bugs.webkit.org/show_bug.cgi?id=163629
4128
4129         Reviewed by Yusuke Suzuki.
4130
4131         * stress/get-by-val-to-id-with-getter.js: Added.
4132         (foo):
4133         (o.get hello):
4134
4135 2016-10-15  Filip Pizlo  <fpizlo@apple.com>
4136
4137         DFG and FTL should be able to use DirectCall ICs when they proved the callee or its executable
4138         https://bugs.webkit.org/show_bug.cgi?id=163371
4139
4140         Reviewed by Geoffrey Garen and Saam Barati.
4141         
4142         Add microbenchmarks for all of the cases that this patch optimizes.
4143
4144         * microbenchmarks/direct-call-arity-mismatch.js: Added.
4145         (foo):
4146         (bar):
4147         * microbenchmarks/direct-call.js: Added.
4148         (foo):
4149         (bar):
4150         * microbenchmarks/direct-construct-arity-mismatch.js: Added.
4151         (Foo):
4152         (bar):
4153         * microbenchmarks/direct-construct.js: Added.
4154         (Foo):
4155         (bar):
4156         * microbenchmarks/direct-tail-call-arity-mismatch.js: Added.
4157         (foo):
4158         (bar):
4159         * microbenchmarks/direct-tail-call-inlined-caller-arity-mismatch.js: Added.
4160         (foo):
4161         (bar):
4162         (baz):
4163         * microbenchmarks/direct-tail-call-inlined-caller.js: Added.
4164         (foo):
4165         (bar):
4166         (baz):
4167         * microbenchmarks/direct-tail-call.js: Added.
4168         (foo):
4169         (bar):
4170
4171 2016-10-18  Caitlin Potter  <caitp@igalia.com>
4172
4173         [JSC] ES6 Method functions should not have prototype
4174         https://bugs.webkit.org/show_bug.cgi?id=162530
4175
4176         Reviewed by Saam Barati.
4177
4178         Fix test262 expectations about MethodDefinitions
4179
4180         * ChakraCore/test/strict/05.arguments_sm.baseline-jsc:
4181         * stress/reflect-set.js:
4182         * test262.yaml:
4183
4184 2016-10-17  Keith Miller  <keith_miller@apple.com>
4185
4186         Add support for WASM Memory.
4187         https://bugs.webkit.org/show_bug.cgi?id=161710
4188
4189         Reviewed by Geoffrey Garen.
4190
4191         Add store and load opcodes to wasm.json. Additionally, add new
4192         enums for those opcodes in the generator.
4193
4194         * stress/wasm/generate-wasmops-header.js:
4195         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.LoadOpType):
4196         (const.template.pragma.once.ENABLE.WEBASSEMBLY.include.cstdint.namespace.JSC.namespace.WASM.enum.StoreOpType):
4197
4198 2016-10-17  Saam Barati  <sbarati@apple.com>
4199
4200         Add more tests for the double->String conversion in ValueAdd constant folding
4201         https://bugs.webkit.org/show_bug.cgi?id=163517
4202
4203         Reviewed by Yusuke Suzuki.
4204
4205         * microbenchmarks/string-add-constant-folding.js:
4206         (test):
4207
4208 2016-10-17  JF Bastien  <jfbastien@apple.com>
4209
4210         WebAssembly JS API: implement basic stub
4211
4212         Implement the global WebAssembly JavaScript object, and its constructor +
4213         function properties as described in:
4214           https://github.com/WebAssembly/design/blob/master/JS.md
4215
4216         These don't do anything at the moment, the parent bug will take care of adding
4217         more functionality and associated tests.
4218
4219         WebAssembly JS API: implement basic stub
4220         https://bugs.webkit.org/show_bug.cgi?id=163404
4221
4222         Reviewed by Keith Miller.
4223
4224         * wasm.yaml:
4225         * wasm/js-api/test_basic_api.js: Added.
4226         (const.f.of.functionProperties.WebAssembly.f.undefined.throw.new.Error.Couldn.const.c.of.constructorProperties.WebAssembly.c.undefined.throw.new.Error.Couldn):
4227         (const.c.of.constructorProperties.catch):
4228
4229 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
4230
4231         [DOMJIT] Use DOMJIT::Patchpoint in IC
4232         https://bugs.webkit.org/show_bug.cgi?id=163223
4233
4234         Reviewed by Saam Barati.
4235
4236         * stress/domjit-exception-ic.js: Added.
4237         (shouldBe):
4238         (access):
4239         * stress/domjit-exception.js: Added.
4240         (shouldBe):
4241         (access):
4242         * stress/domjit-getter-complex-with-incorrect-object.js: Added.
4243         (shouldThrow):
4244         (access):
4245         (i.shouldThrow):
4246         * stress/domjit-getter-complex.js: Added.
4247         (shouldBe):
4248         (access):
4249         * stress/domjit-getter-try-catch-getter-as-get-by-id-register-restoration.js: Added.
4250         (assert):
4251         (bar):
4252         (foo):
4253
4254 2016-10-15  Saam Barati  <sbarati@apple.com>
4255
4256         Assertion failed under operationToLowerCase with a rope with zero length
4257         https://bugs.webkit.org/show_bug.cgi?id=163314
4258
4259         Reviewed by Mark Lam.
4260
4261         * stress/to-lower-case-intrinsic-on-empty-rope.js: Added.
4262         (assert):
4263         (returnRope.helper):
4264         (returnRope):
4265         (lower):
4266
4267 2016-10-14  Benjamin Poulain  <bpoulain@apple.com>
4268
4269         [JSC] op_negate should with any type
4270         https://bugs.webkit.org/show_bug.cgi?id=162587
4271
4272         Reviewed by Saam Barati.
4273
4274         * stress/arith-abs-to-arith-negate-range-optimizaton.js: Added.
4275         Cover OSR Exits when converting Math.abs() into ArithNegate.
4276
4277         * stress/arith-negate-on-various-types.js: Added.
4278         Cover ArithNegate with all types.
4279
4280 2016-10-14  JF Bastien  <jfbastien@apple.com>
4281
4282         Basic WebAssembly testing
4283
4284         Create a small DSL in JavaScript which can build WebAssembly binary modules based on the JSON description of the format as described in:
4285         https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md
4286
4287         This DSL can then be used to write small text description of valid and invalid WebAssembly binaries, making testing the JSC implementation much easier.
4288
4289         Details and example in README.md.
4290
4291         Basic WebAssembly testing
4292         https://bugs.webkit.org/show_bug.cgi?id=163267
4293
4294         Reviewed by Keith Miller.
4295
4296         * stress/wasm/wasm.json: Removed.
4297         * wasm.yaml: Added.
4298         * wasm/Builder.js: Added.
4299         (const._isValidValue):
4300         (const._BuildWebAssemblyBinary):
4301         (export.default.Builder):
4302         (export.default.Builder.prototype.setChecked):
4303         (export.default.Builder.prototype.setPreamble):
4304         (export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
4305         (export.default.Builder.prototype._registerSectionBuilders.this.Unknown):
4306         (export.default.Builder.prototype._registerSectionBuilders):
4307         (export.default.Builder.prototype._addSection):
4308         (export.default.Builder.prototype.optimize):
4309         (export.default.Builder.prototype.json):
4310         (export.default.Builder.prototype.AsmJS):
4311         (export.default.Builder.prototype.WebAssembly):
4312         * wasm/LowLevelBinary.js: Added.
4313         (const._getterRangeCheck):
4314         (const._hexdump):
4315         (export.default.LowLevelBinary):
4316         (export.default.LowLevelBinary.prototype.newPatchable):
4317         (export.default.LowLevelBinary.prototype.hexdump):
4318         (export.default.LowLevelBinary.prototype._maybeGrow):
4319         (export.default.LowLevelBinary.prototype._push8):
4320         (export.default.LowLevelBinary.prototype.uint8):
4321         (export.default.LowLevelBinary.prototype.uint16):
4322         (export.default.LowLevelBinary.prototype.uint32):
4323         (export.default.LowLevelBinary.prototype.varuint):
4324         (export.default.LowLevelBinary.prototype.varint):
4325         (export.default.LowLevelBinary.prototype.varuint7):
4326         (export.default.LowLevelBinary.prototype.string):
4327         (export.default.LowLevelBinary.prototype.getSize):
4328         (export.default.LowLevelBinary.prototype.getUint8):
4329         (export.default.LowLevelBinary.prototype.getUint16):
4330         (export.default.LowLevelBinary.prototype.getUint32):
4331         (export.default.LowLevelBinary.prototype.getVaruint):
4332         (export.default.LowLevelBinary.prototype.getVarint):
4333         (export.default.LowLevelBinary.prototype.getVaruint7):
4334         (export.default.LowLevelBinary.prototype.getString):
4335         (PatchableLowLevelBinary):
4336         (PatchableLowLevelBinary.prototype._push8):
4337         (PatchableLowLevelBinary.prototype.apply):
4338         * wasm/README.md: Added.
4339         * wasm/WASM.js: Added.
4340         * wasm/assert.js: Added.
4341         (export.const.notUndef):
4342         (export.const.eq):
4343         (export.const.ge):
4344         (export.const.throwsError):
4345         (export.const.throwsRangeError):
4346         * wasm/generate-wasmops-header.js: Renamed from JSTests/stress/wasm/generate-wasmops-header.js.
4347         * wasm/self-test/test_BuilderJSON.js: Added.
4348         (const.assertOpThrows):
4349         (EmptyModule):
4350         (CustomMagicNumber):
4351         (CustomVersion):
4352         (CustomSection):
4353         (CustomSectionAllBytes):
4354         (CustomSectionInvalidByte):
4355         (TwoCustomSections):
4356         (EmptyCodeSection):
4357         (CodeSectionWithEmptyFunction):
4358         (CodeSectionWithEmptyFunctionWithParameters):
4359         (InvalidFunctionParameters):
4360         (SimpleFunction):
4361         (TwoSimpleFunctions):
4362         (TwoBuildersAtTheSameTime):
4363         (CheckedOpcodeArgumentsTooMany):
4364         (CheckedOpcodeArgumentsNotEnough):
4365         (CallNoArguments):
4366         (CallInvalid):
4367         (I32ConstInvalid):
4368         (F32ConstInvalid):
4369         (F64ConstInvalid):
4370         (CallManyFromStack):
4371         (OpcodeAdd):
4372         (OpcodeUnreachable):
4373         (OpcodeUnreachableCombinations):
4374         (OpcodeSelect):
4375         * wasm/self-test/test_BuilderWebAssembly.js: Added.
4376         (EmptyModule):
4377         (CustomSection):
4378         (Basic):
4379         * wasm/self-test/test_LowLevelBinary_encode.js: Added.
4380         * wasm/self-test/test_LowLevelBinary_string.js: Added.
4381         * wasm/self-test/test_LowLevelBinary_uint16.js: Added.
4382         * wasm/self-test/test_LowLevelBinary_uint32.js: Added.
4383         * wasm/self-test/test_LowLevelBinary_uint8.js: Added.
4384         * wasm/self-test/test_LowLevelBinary_varint.js: Added.
4385         * wasm/self-test/test_LowLevelBinary_varuint.js: Added.
4386         * wasm/self-test/test_LowLevelBinary_varuint7.js: Added.
4387         * wasm/self-test/test_WASM.js: Added.
4388         * wasm/test.sh: Added.
4389         * wasm/utilities.js: Added.
4390         (const._read.filename.switch):
4391         (const._load.filename.switch):
4392         (const._json.filename.switch):
4393         * wasm/wasm.json: Added.
4394
4395 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
4396
4397         test262: @isConstructor incorrectly thinks Math.cos is a constructor
4398         https://bugs.webkit.org/show_bug.cgi?id=163437
4399
4400         Reviewed by Saam Barati.
4401
4402         * stress/is-constructor.js: Added.
4403         (assert):
4404         (prototype.assert):
4405         New test to cover the @isConstructor builtin.
4