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