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