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