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