From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../jit-test/tests/jaeger/argumentsOptimize-1.js | 14 ++ .../jit-test/tests/jaeger/argumentsOptimize-2.js | 27 +++ js/src/jit-test/tests/jaeger/bug549393-1.js | 43 +++++ js/src/jit-test/tests/jaeger/bug549393-2.js | 10 ++ js/src/jit-test/tests/jaeger/bug549396.js | 1 + js/src/jit-test/tests/jaeger/bug549398.js | 10 ++ js/src/jit-test/tests/jaeger/bug549521.js | 13 ++ js/src/jit-test/tests/jaeger/bug549602.js | 31 ++++ js/src/jit-test/tests/jaeger/bug549603.js | 3 + js/src/jit-test/tests/jaeger/bug550490.js | 14 ++ js/src/jit-test/tests/jaeger/bug550665.js | 8 + js/src/jit-test/tests/jaeger/bug551603.js | 8 + js/src/jit-test/tests/jaeger/bug552644.js | 6 + js/src/jit-test/tests/jaeger/bug553781-2.js | 13 ++ js/src/jit-test/tests/jaeger/bug553781.js | 11 ++ js/src/jit-test/tests/jaeger/bug553784.js | 18 ++ js/src/jit-test/tests/jaeger/bug554580-1.js | 7 + js/src/jit-test/tests/jaeger/bug554580-2.js | 9 + js/src/jit-test/tests/jaeger/bug554580-3.js | 11 ++ js/src/jit-test/tests/jaeger/bug554580-4.js | 18 ++ js/src/jit-test/tests/jaeger/bug554580-5.js | 20 +++ js/src/jit-test/tests/jaeger/bug554651.js | 15 ++ js/src/jit-test/tests/jaeger/bug554675-1.js | 8 + js/src/jit-test/tests/jaeger/bug554675-2.js | 11 ++ js/src/jit-test/tests/jaeger/bug554675-3.js | 11 ++ js/src/jit-test/tests/jaeger/bug555152.js | 9 + js/src/jit-test/tests/jaeger/bug555155.js | 12 ++ js/src/jit-test/tests/jaeger/bug555206.js | 4 + js/src/jit-test/tests/jaeger/bug555543.js | 8 + js/src/jit-test/tests/jaeger/bug556525.js | 5 + js/src/jit-test/tests/jaeger/bug557063.js | 7 + js/src/jit-test/tests/jaeger/bug557068.js | 5 + js/src/jit-test/tests/jaeger/bug557070.js | 6 + js/src/jit-test/tests/jaeger/bug557075.js | 8 + js/src/jit-test/tests/jaeger/bug560221.js | 13 ++ .../tests/jaeger/bug563000/eif-call-newvar.js | 12 ++ .../tests/jaeger/bug563000/eif-call-typechange.js | 11 ++ js/src/jit-test/tests/jaeger/bug563000/eif-call.js | 11 ++ .../tests/jaeger/bug563000/eif-getter-newvar.js | 9 + .../jaeger/bug563000/eif-getter-typechange.js | 9 + .../jit-test/tests/jaeger/bug563000/eif-getter.js | 9 + .../tests/jaeger/bug563000/eif-global-newvar.js | 7 + js/src/jit-test/tests/jaeger/bug565198.js | 6 + js/src/jit-test/tests/jaeger/bug566022.js | 8 + js/src/jit-test/tests/jaeger/bug573433.js | 7 + js/src/jit-test/tests/jaeger/bug576398.js | 10 ++ js/src/jit-test/tests/jaeger/bug577580.js | 7 + js/src/jit-test/tests/jaeger/bug577646.js | 5 + js/src/jit-test/tests/jaeger/bug577705.js | 65 +++++++ js/src/jit-test/tests/jaeger/bug577996.js | 6 + js/src/jit-test/tests/jaeger/bug580712.js | 1 + js/src/jit-test/tests/jaeger/bug580884-3.js | 10 ++ js/src/jit-test/tests/jaeger/bug580884.js | 8 + js/src/jit-test/tests/jaeger/bug580931-2.js | 4 + js/src/jit-test/tests/jaeger/bug581871.js | 10 ++ js/src/jit-test/tests/jaeger/bug581936.js | 12 ++ js/src/jit-test/tests/jaeger/bug582185.js | 3 + js/src/jit-test/tests/jaeger/bug582286.js | 3 + js/src/jit-test/tests/jaeger/bug582392.js | 8 + js/src/jit-test/tests/jaeger/bug582880.js | 8 + js/src/jit-test/tests/jaeger/bug582882.js | 11 ++ js/src/jit-test/tests/jaeger/bug582884.js | 7 + js/src/jit-test/tests/jaeger/bug582894.js | 6 + js/src/jit-test/tests/jaeger/bug582897.js | 7 + js/src/jit-test/tests/jaeger/bug582898.js | 7 + js/src/jit-test/tests/jaeger/bug582900.js | 3 + js/src/jit-test/tests/jaeger/bug583158.js | 9 + js/src/jit-test/tests/jaeger/bug583160.js | 10 ++ js/src/jit-test/tests/jaeger/bug583672.js | 30 ++++ js/src/jit-test/tests/jaeger/bug583688.js | 10 ++ js/src/jit-test/tests/jaeger/bug583689.js | 7 + js/src/jit-test/tests/jaeger/bug584644-2.js | 7 + js/src/jit-test/tests/jaeger/bug584646.js | 7 + js/src/jit-test/tests/jaeger/bug584647.js | 2 + js/src/jit-test/tests/jaeger/bug585310.js | 19 +++ js/src/jit-test/tests/jaeger/bug585341.js | 6 + js/src/jit-test/tests/jaeger/bug585391.js | 11 ++ js/src/jit-test/tests/jaeger/bug585408-2.js | 6 + js/src/jit-test/tests/jaeger/bug585408-3.js | 7 + js/src/jit-test/tests/jaeger/bug585408.js | 7 + js/src/jit-test/tests/jaeger/bug585540.js | 13 ++ js/src/jit-test/tests/jaeger/bug587431.js | 29 ++++ js/src/jit-test/tests/jaeger/bug588338.js | 16 ++ js/src/jit-test/tests/jaeger/bug588362-1.js | 8 + js/src/jit-test/tests/jaeger/bug588362-2.js | 10 ++ js/src/jit-test/tests/jaeger/bug588362-3.js | 10 ++ js/src/jit-test/tests/jaeger/bug588363-1.js | 6 + js/src/jit-test/tests/jaeger/bug588363-2.js | 7 + js/src/jit-test/tests/jaeger/bug589108.js | 10 ++ js/src/jit-test/tests/jaeger/bug589115.js | 6 + js/src/jit-test/tests/jaeger/bug589461.js | 7 + js/src/jit-test/tests/jaeger/bug590083.js | 11 ++ js/src/jit-test/tests/jaeger/bug591606.js | 5 + js/src/jit-test/tests/jaeger/bug592973-1.js | 12 ++ js/src/jit-test/tests/jaeger/bug592973-2.js | 7 + js/src/jit-test/tests/jaeger/bug592973-3.js | 8 + js/src/jit-test/tests/jaeger/bug593554.js | 8 + js/src/jit-test/tests/jaeger/bug595917.js | 4 + js/src/jit-test/tests/jaeger/bug595921.js | 9 + js/src/jit-test/tests/jaeger/bug597378.js | 12 ++ js/src/jit-test/tests/jaeger/bug597871.js | 8 + js/src/jit-test/tests/jaeger/bug598696.js | 6 + js/src/jit-test/tests/jaeger/bug599488.js | 9 + js/src/jit-test/tests/jaeger/bug600139.js | 10 ++ js/src/jit-test/tests/jaeger/bug600419.js | 5 + js/src/jit-test/tests/jaeger/bug600424.js | 14 ++ js/src/jit-test/tests/jaeger/bug601982.js | 33 ++++ js/src/jit-test/tests/jaeger/bug604381.js | 14 ++ js/src/jit-test/tests/jaeger/bug604427.js | 6 + js/src/jit-test/tests/jaeger/bug606662-2.js | 5 + js/src/jit-test/tests/jaeger/bug606829.js | 8 + js/src/jit-test/tests/jaeger/bug610652.js | 5 + js/src/jit-test/tests/jaeger/bug615440.js | 5 + js/src/jit-test/tests/jaeger/bug616508.js | 14 ++ js/src/jit-test/tests/jaeger/bug617433.js | 12 ++ js/src/jit-test/tests/jaeger/bug617440.js | 11 ++ js/src/jit-test/tests/jaeger/bug617458.js | 6 + js/src/jit-test/tests/jaeger/bug617460.js | 10 ++ js/src/jit-test/tests/jaeger/bug617549.js | 9 + js/src/jit-test/tests/jaeger/bug617558.js | 7 + js/src/jit-test/tests/jaeger/bug617624.js | 7 + js/src/jit-test/tests/jaeger/bug618007.js | 31 ++++ js/src/jit-test/tests/jaeger/bug618849.js | 11 ++ js/src/jit-test/tests/jaeger/bug618850.js | 6 + js/src/jit-test/tests/jaeger/bug618863.js | 23 +++ js/src/jit-test/tests/jaeger/bug619339.js | 3 + js/src/jit-test/tests/jaeger/bug619433-1.js | 22 +++ js/src/jit-test/tests/jaeger/bug619433-2.js | 10 ++ js/src/jit-test/tests/jaeger/bug620643.js | 1 + js/src/jit-test/tests/jaeger/bug621522.js | 14 ++ js/src/jit-test/tests/jaeger/bug621655.js | 10 ++ js/src/jit-test/tests/jaeger/bug623474.js | 10 ++ js/src/jit-test/tests/jaeger/bug624100.js | 2 + js/src/jit-test/tests/jaeger/bug624483.js | 5 + js/src/jit-test/tests/jaeger/bug625157.js | 16 ++ js/src/jit-test/tests/jaeger/bug625377.js | 13 ++ js/src/jit-test/tests/jaeger/bug625438.js | 10 ++ js/src/jit-test/tests/jaeger/bug625718-1.js | 12 ++ js/src/jit-test/tests/jaeger/bug625718-2.js | 14 ++ js/src/jit-test/tests/jaeger/bug625718-3.js | 52 ++++++ js/src/jit-test/tests/jaeger/bug625757.js | 4 + js/src/jit-test/tests/jaeger/bug627486.js | 23 +++ js/src/jit-test/tests/jaeger/bug630366.js | 7 + js/src/jit-test/tests/jaeger/bug639459.js | 6 + js/src/jit-test/tests/jaeger/bug639478-1.js | 5 + js/src/jit-test/tests/jaeger/bug639478-2.js | 12 ++ js/src/jit-test/tests/jaeger/bug639587.js | 8 + js/src/jit-test/tests/jaeger/bug639792.js | 8 + js/src/jit-test/tests/jaeger/bug639808.js | 16 ++ js/src/jit-test/tests/jaeger/bug640098.js | 15 ++ js/src/jit-test/tests/jaeger/bug640102.js | 3 + js/src/jit-test/tests/jaeger/bug640614.js | 5 + js/src/jit-test/tests/jaeger/bug642198.js | 9 + js/src/jit-test/tests/jaeger/bug643653-1.js | 10 ++ js/src/jit-test/tests/jaeger/bug643653-2.js | 58 +++++++ js/src/jit-test/tests/jaeger/bug643805.js | 50 ++++++ js/src/jit-test/tests/jaeger/bug643829.js | 12 ++ js/src/jit-test/tests/jaeger/bug643913.js | 8 + js/src/jit-test/tests/jaeger/bug645629.js | 8 + js/src/jit-test/tests/jaeger/bug645657.js | 8 + js/src/jit-test/tests/jaeger/bug645985.js | 5 + js/src/jit-test/tests/jaeger/bug646001.js | 12 ++ js/src/jit-test/tests/jaeger/bug646060.js | 8 + js/src/jit-test/tests/jaeger/bug646411.js | 12 ++ js/src/jit-test/tests/jaeger/bug646495.js | 6 + js/src/jit-test/tests/jaeger/bug646938.js | 21 +++ js/src/jit-test/tests/jaeger/bug647440.js | 7 + js/src/jit-test/tests/jaeger/bug647657.js | 1 + js/src/jit-test/tests/jaeger/bug647785.js | 4 + js/src/jit-test/tests/jaeger/bug648004.js | 4 + js/src/jit-test/tests/jaeger/bug648230-1.js | 13 ++ js/src/jit-test/tests/jaeger/bug648230-2.js | 14 ++ js/src/jit-test/tests/jaeger/bug648498.js | 5 + js/src/jit-test/tests/jaeger/bug648586.js | 11 ++ js/src/jit-test/tests/jaeger/bug648708.js | 6 + js/src/jit-test/tests/jaeger/bug649272.js | 4 + js/src/jit-test/tests/jaeger/bug649593.js | 10 ++ js/src/jit-test/tests/jaeger/bug649689.js | 6 + js/src/jit-test/tests/jaeger/bug649775.js | 17 ++ js/src/jit-test/tests/jaeger/bug649824.js | 6 + js/src/jit-test/tests/jaeger/bug649973.js | 2 + js/src/jit-test/tests/jaeger/bug650076.js | 13 ++ js/src/jit-test/tests/jaeger/bug650662.js | 6 + js/src/jit-test/tests/jaeger/bug650663.js | 15 ++ js/src/jit-test/tests/jaeger/bug651147.js | 7 + js/src/jit-test/tests/jaeger/bug652305.js | 25 +++ js/src/jit-test/tests/jaeger/bug652314.js | 7 + js/src/jit-test/tests/jaeger/bug652590.js | 5 + js/src/jit-test/tests/jaeger/bug653243.js | 12 ++ js/src/jit-test/tests/jaeger/bug653249.js | 13 ++ js/src/jit-test/tests/jaeger/bug653397.js | 16 ++ js/src/jit-test/tests/jaeger/bug655505.js | 15 ++ js/src/jit-test/tests/jaeger/bug655508.js | 15 ++ js/src/jit-test/tests/jaeger/bug655810.js | 6 + js/src/jit-test/tests/jaeger/bug655990.js | 12 ++ js/src/jit-test/tests/jaeger/bug656096.js | 37 ++++ js/src/jit-test/tests/jaeger/bug656252.js | 14 ++ js/src/jit-test/tests/jaeger/bug656259.js | 11 ++ js/src/jit-test/tests/jaeger/bug656591.js | 9 + js/src/jit-test/tests/jaeger/bug656748.js | 8 + js/src/jit-test/tests/jaeger/bug656914.js | 23 +++ js/src/jit-test/tests/jaeger/bug657120.js | 6 + js/src/jit-test/tests/jaeger/bug657247.js | 5 + js/src/jit-test/tests/jaeger/bug657890.js | 6 + js/src/jit-test/tests/jaeger/bug658240.js | 11 ++ js/src/jit-test/tests/jaeger/bug658294.js | 15 ++ js/src/jit-test/tests/jaeger/bug658579.js | 5 + js/src/jit-test/tests/jaeger/bug658968.js | 13 ++ js/src/jit-test/tests/jaeger/bug659438.js | 8 + js/src/jit-test/tests/jaeger/bug659439.js | 16 ++ js/src/jit-test/tests/jaeger/bug659448.js | 9 + js/src/jit-test/tests/jaeger/bug659456.js | 12 ++ js/src/jit-test/tests/jaeger/bug660002.js | 4 + js/src/jit-test/tests/jaeger/bug662072.js | 7 + js/src/jit-test/tests/jaeger/bug662082.js | 11 ++ js/src/jit-test/tests/jaeger/bug663485.js | 17 ++ js/src/jit-test/tests/jaeger/bug663910.js | 22 +++ js/src/jit-test/tests/jaeger/bug669706.js | 14 ++ js/src/jit-test/tests/jaeger/bug670885.js | 16 ++ js/src/jit-test/tests/jaeger/bug672122.js | 3 + js/src/jit-test/tests/jaeger/bug678141.js | 10 ++ js/src/jit-test/tests/jaeger/bug678234.js | 10 ++ js/src/jit-test/tests/jaeger/bug678782.js | 9 + js/src/jit-test/tests/jaeger/bug679666.js | 22 +++ js/src/jit-test/tests/jaeger/bug680842.js | 27 +++ js/src/jit-test/tests/jaeger/bug681006.js | 10 ++ js/src/jit-test/tests/jaeger/bug682345.js | 16 ++ js/src/jit-test/tests/jaeger/bug684084-2.js | 8 + js/src/jit-test/tests/jaeger/bug684084.js | 7 + js/src/jit-test/tests/jaeger/bug684576.js | 10 ++ js/src/jit-test/tests/jaeger/bug684824.js | 7 + js/src/jit-test/tests/jaeger/bug684943.js | 7 + js/src/jit-test/tests/jaeger/bug687768.js | 17 ++ js/src/jit-test/tests/jaeger/bug693311.js | 8 + js/src/jit-test/tests/jaeger/bug704138.js | 21 +++ js/src/jit-test/tests/jaeger/bug705873.js | 7 + js/src/jit-test/tests/jaeger/bug706110.js | 18 ++ js/src/jit-test/tests/jaeger/bug707641.js | 7 + js/src/jit-test/tests/jaeger/bug709067.js | 11 ++ js/src/jit-test/tests/jaeger/bug710780.js | 12 ++ js/src/jit-test/tests/jaeger/bug714645.js | 12 ++ js/src/jit-test/tests/jaeger/bug719918.js | 17 ++ js/src/jit-test/tests/jaeger/bug732423.js | 22 +++ js/src/jit-test/tests/jaeger/bug735161.js | 4 + js/src/jit-test/tests/jaeger/bug738525.js | 37 ++++ js/src/jit-test/tests/jaeger/bug742393.js | 11 ++ js/src/jit-test/tests/jaeger/bug751320.js | 22 +++ js/src/jit-test/tests/jaeger/bug767961.js | 6 + js/src/jit-test/tests/jaeger/bug768313.js | 6 + js/src/jit-test/tests/jaeger/bug769985.js | 19 +++ js/src/jit-test/tests/jaeger/bug771871.js | 7 + js/src/jit-test/tests/jaeger/bug781859-1.js | 25 +++ js/src/jit-test/tests/jaeger/bug781859-2.js | 8 + js/src/jit-test/tests/jaeger/bug781859-3.js | 9 + js/src/jit-test/tests/jaeger/bug819035.js | 38 +++++ js/src/jit-test/tests/jaeger/bug825966.js | 18 ++ js/src/jit-test/tests/jaeger/chunk/bug712267.js | 14 ++ js/src/jit-test/tests/jaeger/clonefun.js | 17 ++ js/src/jit-test/tests/jaeger/closure-01.js | 18 ++ js/src/jit-test/tests/jaeger/closure-02.js | 14 ++ js/src/jit-test/tests/jaeger/closure-03.js | 15 ++ js/src/jit-test/tests/jaeger/closure-04.js | 30 ++++ js/src/jit-test/tests/jaeger/closure-05.js | 17 ++ js/src/jit-test/tests/jaeger/compare-wrong-1.js | 4 + js/src/jit-test/tests/jaeger/crash-on-compare.js | 1 + .../tests/jaeger/deepBailAfterRunTracer.js | 25 +++ js/src/jit-test/tests/jaeger/floatTypedArrays.js | 64 +++++++ js/src/jit-test/tests/jaeger/fromCharCode.js | 8 + js/src/jit-test/tests/jaeger/fused-eq-ifeq.js | 6 + js/src/jit-test/tests/jaeger/getelem-sanity-1.js | 9 + js/src/jit-test/tests/jaeger/getelem-sanity-2.js | 22 +++ js/src/jit-test/tests/jaeger/getelem-sanity-3.js | 22 +++ js/src/jit-test/tests/jaeger/getelem-sanity-4.js | 51 ++++++ js/src/jit-test/tests/jaeger/getelem-sanity-5.js | 4 + js/src/jit-test/tests/jaeger/getelem-sanity-6.js | 4 + js/src/jit-test/tests/jaeger/getelem-sanity-7.js | 10 ++ js/src/jit-test/tests/jaeger/getelem-sanity-8.js | 13 ++ .../jit-test/tests/jaeger/getelem-sanity-int-1.js | 7 + .../jit-test/tests/jaeger/getelem-sanity-int-2.js | 12 ++ .../jit-test/tests/jaeger/getelem-sanity-int-3.js | 19 +++ js/src/jit-test/tests/jaeger/getter-hook-1.js | 18 ++ js/src/jit-test/tests/jaeger/getter-hook-2.js | 19 +++ js/src/jit-test/tests/jaeger/globalOptimize-1.js | 5 + js/src/jit-test/tests/jaeger/globalOptimize-2.js | 10 ++ js/src/jit-test/tests/jaeger/globalOptimize-4.js | 8 + js/src/jit-test/tests/jaeger/in.js | 21 +++ js/src/jit-test/tests/jaeger/inline/bug645645.js | 4 + js/src/jit-test/tests/jaeger/inline/bug645666.js | 16 ++ js/src/jit-test/tests/jaeger/inline/bug646004.js | 9 + js/src/jit-test/tests/jaeger/inline/bug646480.js | 7 + js/src/jit-test/tests/jaeger/inline/bug647973.js | 11 ++ js/src/jit-test/tests/jaeger/inline/bug651209.js | 11 ++ js/src/jit-test/tests/jaeger/inline/bug655954.js | 5 + js/src/jit-test/tests/jaeger/inline/bug656221.js | 5 + js/src/jit-test/tests/jaeger/inline/bug676491.js | 14 ++ js/src/jit-test/tests/jaeger/inline/bug680759.js | 14 ++ js/src/jit-test/tests/jaeger/inline/doubleArg.js | 10 ++ js/src/jit-test/tests/jaeger/inline/mathAbs.js | 31 ++++ js/src/jit-test/tests/jaeger/inline/mathFloor.js | 34 ++++ js/src/jit-test/tests/jaeger/inline/mathPow.js | 35 ++++ js/src/jit-test/tests/jaeger/inline/mathRound.js | 41 +++++ js/src/jit-test/tests/jaeger/inline/mathSqrt.js | 29 ++++ js/src/jit-test/tests/jaeger/inline/scripted-01.js | 17 ++ js/src/jit-test/tests/jaeger/inline/scripted-02.js | 22 +++ js/src/jit-test/tests/jaeger/inline/scripted-03.js | 14 ++ js/src/jit-test/tests/jaeger/inline/scripted-04.js | 12 ++ js/src/jit-test/tests/jaeger/inline/scripted-05.js | 13 ++ js/src/jit-test/tests/jaeger/inline/scripted-06.js | 17 ++ js/src/jit-test/tests/jaeger/inline/scripted-07.js | 15 ++ js/src/jit-test/tests/jaeger/inline/scripted-08.js | 21 +++ js/src/jit-test/tests/jaeger/inline/scripted-09.js | 19 +++ js/src/jit-test/tests/jaeger/inline/scripted-10.js | 13 ++ js/src/jit-test/tests/jaeger/inline/scripted-11.js | 12 ++ .../jit-test/tests/jaeger/inline/stringCharAt.js | 49 ++++++ .../tests/jaeger/inline/stringCharCodeAt.js | 47 +++++ .../jit-test/tests/jaeger/inline/undefinedLocal.js | 19 +++ .../tests/jaeger/instanceOfWithKnownTypes.js | 13 ++ js/src/jit-test/tests/jaeger/invokeSessionGuard.js | 8 + js/src/jit-test/tests/jaeger/loops/bug651155.js | 6 + js/src/jit-test/tests/jaeger/loops/bug654393.js | 12 ++ js/src/jit-test/tests/jaeger/loops/bug655854.js | 8 + js/src/jit-test/tests/jaeger/loops/bug658290.js | 8 + js/src/jit-test/tests/jaeger/loops/bug659452.js | 5 + js/src/jit-test/tests/jaeger/loops/bug668643.js | 12 ++ js/src/jit-test/tests/jaeger/loops/bug671814.js | 12 ++ js/src/jit-test/tests/jaeger/loops/bug680809.js | 8 + js/src/jit-test/tests/jaeger/loops/bug684621.js | 15 ++ js/src/jit-test/tests/jaeger/loops/hoist-01.js | 35 ++++ js/src/jit-test/tests/jaeger/loops/hoist-02.js | 12 ++ js/src/jit-test/tests/jaeger/loops/hoist-03.js | 12 ++ js/src/jit-test/tests/jaeger/loops/hoist-04.js | 18 ++ js/src/jit-test/tests/jaeger/loops/hoist-05.js | 19 +++ js/src/jit-test/tests/jaeger/loops/hoist-06.js | 14 ++ js/src/jit-test/tests/jaeger/loops/hoist-07.js | 17 ++ js/src/jit-test/tests/jaeger/loops/hoist-08.js | 7 + js/src/jit-test/tests/jaeger/loops/hoist-09.js | 11 ++ js/src/jit-test/tests/jaeger/loops/hoist-10.js | 39 +++++ js/src/jit-test/tests/jaeger/loops/integer-1.js | 7 + js/src/jit-test/tests/jaeger/loops/integer-2.js | 10 ++ js/src/jit-test/tests/jaeger/loops/integer-3.js | 7 + .../tests/jaeger/loops/multiply-by-int32min.js | 59 +++++++ js/src/jit-test/tests/jaeger/loops/property-1.js | 19 +++ js/src/jit-test/tests/jaeger/modConstDoubles.js | 8 + js/src/jit-test/tests/jaeger/modConstInt.js | 8 + js/src/jit-test/tests/jaeger/modConstZeroRhs.js | 8 + js/src/jit-test/tests/jaeger/modWithConstLhs.js | 2 + js/src/jit-test/tests/jaeger/mulNegZero.js | 31 ++++ js/src/jit-test/tests/jaeger/negation.js | 2 + .../jit-test/tests/jaeger/normalIntTypedArrays.js | 49 ++++++ js/src/jit-test/tests/jaeger/optimize-globals-1.js | 9 + js/src/jit-test/tests/jaeger/optimize-globals-2.js | 20 +++ js/src/jit-test/tests/jaeger/optimize-globals-3.js | 9 + js/src/jit-test/tests/jaeger/propertyOptimize-1.js | 29 ++++ js/src/jit-test/tests/jaeger/propertyOptimize-2.js | 16 ++ js/src/jit-test/tests/jaeger/propertyOptimize-3.js | 67 ++++++++ js/src/jit-test/tests/jaeger/propertyOptimize-4.js | 17 ++ js/src/jit-test/tests/jaeger/recompile/arith.js | 49 ++++++ .../jit-test/tests/jaeger/recompile/bug617592.js | 3 + .../jit-test/tests/jaeger/recompile/bug621292.js | 24 +++ .../jit-test/tests/jaeger/recompile/bug621328.js | 9 + .../jit-test/tests/jaeger/recompile/bug638977.js | 6 + .../jit-test/tests/jaeger/recompile/bug639508.js | 2 + .../jit-test/tests/jaeger/recompile/bug639882.js | 5 + .../jit-test/tests/jaeger/recompile/bug640608.js | 10 ++ .../jit-test/tests/jaeger/recompile/bug641225.js | 150 ++++++++++++++++ .../jit-test/tests/jaeger/recompile/bug641269.js | 8 + .../jit-test/tests/jaeger/recompile/bug641535.js | 2 + .../jit-test/tests/jaeger/recompile/bug642405.js | 13 ++ .../jit-test/tests/jaeger/recompile/bug643182.js | 7 + .../jit-test/tests/jaeger/recompile/bug643376.js | 8 + .../jit-test/tests/jaeger/recompile/bug643669.js | 3 + .../jit-test/tests/jaeger/recompile/bug645044.js | 4 + .../jit-test/tests/jaeger/recompile/bug646267.js | 8 + .../jit-test/tests/jaeger/recompile/bug647183.js | 23 +++ .../jit-test/tests/jaeger/recompile/bug647199.js | 11 ++ .../jit-test/tests/jaeger/recompile/bug647532.js | 4 + .../jit-test/tests/jaeger/recompile/bug647547.js | 9 + .../jit-test/tests/jaeger/recompile/bug647991-1.js | 18 ++ .../jit-test/tests/jaeger/recompile/bug647991-2.js | 2 + .../jit-test/tests/jaeger/recompile/bug648502.js | 12 ++ .../jit-test/tests/jaeger/recompile/bug648567.js | 16 ++ .../jit-test/tests/jaeger/recompile/bug648843.js | 8 + .../jit-test/tests/jaeger/recompile/bug648966.js | 7 + .../jit-test/tests/jaeger/recompile/bug649261.js | 2 + .../jit-test/tests/jaeger/recompile/bug649769.js | 16 ++ .../jit-test/tests/jaeger/recompile/bug651119.js | 51 ++++++ .../jit-test/tests/jaeger/recompile/bug653980.js | 13 ++ .../jit-test/tests/jaeger/recompile/bug654536.js | 6 + .../jit-test/tests/jaeger/recompile/bug655949.js | 6 + .../jit-test/tests/jaeger/recompile/bug655998.js | 7 + .../jit-test/tests/jaeger/recompile/bug656753.js | 20 +++ .../jit-test/tests/jaeger/recompile/bug657288.js | 9 + .../jit-test/tests/jaeger/recompile/bug658209.js | 10 ++ .../jit-test/tests/jaeger/recompile/bug658211.js | 13 ++ .../jit-test/tests/jaeger/recompile/bug658212.js | 30 ++++ .../jit-test/tests/jaeger/recompile/bug658561.js | 5 + .../jit-test/tests/jaeger/recompile/bug658777.js | 11 ++ .../jit-test/tests/jaeger/recompile/bug659639.js | 16 ++ .../jit-test/tests/jaeger/recompile/bug659766.js | 29 ++++ .../jit-test/tests/jaeger/recompile/bug660737.js | 10 ++ .../jit-test/tests/jaeger/recompile/bug661859.js | 24 +++ .../jit-test/tests/jaeger/recompile/bug663690.js | 14 ++ .../jit-test/tests/jaeger/recompile/bug671943-1.js | 12 ++ .../jit-test/tests/jaeger/recompile/bug671943-2.js | 10 ++ .../jit-test/tests/jaeger/recompile/bug672123.js | 46 +++++ .../jit-test/tests/jaeger/recompile/bug673812.js | 18 ++ .../jit-test/tests/jaeger/recompile/bug674391.js | 11 ++ .../jit-test/tests/jaeger/recompile/bug676764.js | 14 ++ js/src/jit-test/tests/jaeger/recompile/callic.js | 27 +++ js/src/jit-test/tests/jaeger/recompile/exotic.js | 74 ++++++++ js/src/jit-test/tests/jaeger/recompile/flush.js | 18 ++ js/src/jit-test/tests/jaeger/recompile/getelem.js | 26 +++ js/src/jit-test/tests/jaeger/recompile/incdec.js | 92 ++++++++++ .../jit-test/tests/jaeger/recompile/inlinestubs.js | 43 +++++ .../jit-test/tests/jaeger/recompile/memory-01.js | 12 ++ .../jit-test/tests/jaeger/recompile/memory-02.js | 19 +++ .../jit-test/tests/jaeger/recompile/memory-03.js | 6 + .../jit-test/tests/jaeger/recompile/memory-04.js | 8 + js/src/jit-test/tests/jaeger/recompile/native.js | 26 +++ .../jit-test/tests/jaeger/recompile/nativemulti.js | 21 +++ .../jit-test/tests/jaeger/recompile/nativestack.js | 25 +++ .../jit-test/tests/jaeger/recompile/patchdouble.js | 7 + js/src/jit-test/tests/jaeger/recompile/property.js | 26 +++ js/src/jit-test/tests/jaeger/recompile/propic.js | 24 +++ .../tests/jaeger/recompile/staticoverflow.js | 26 +++ js/src/jit-test/tests/jaeger/recompile/undef.js | 61 +++++++ js/src/jit-test/tests/jaeger/regalloc-double.js | 12 ++ js/src/jit-test/tests/jaeger/regalloc-live.js | 41 +++++ js/src/jit-test/tests/jaeger/regress-bug625701.js | 10 ++ js/src/jit-test/tests/jaeger/rsh-sanity-1.js | 17 ++ js/src/jit-test/tests/jaeger/scriptedICs-1.js | 39 +++++ js/src/jit-test/tests/jaeger/setPropTypeGuard.js | 23 +++ .../jit-test/tests/jaeger/smallIntTypedArrays.js | 112 ++++++++++++ .../tests/jaeger/strictModeSetUndefinedVar.js | 8 + js/src/jit-test/tests/jaeger/subCommutativity.js | 4 + js/src/jit-test/tests/jaeger/tableSwitchConst.js | 18 ++ js/src/jit-test/tests/jaeger/tableSwitchDouble.js | 13 ++ js/src/jit-test/tests/jaeger/tableSwitchEmpty.js | 14 ++ js/src/jit-test/tests/jaeger/tableSwitchFloat.js | 18 ++ js/src/jit-test/tests/jaeger/tableSwitchNeg.js | 27 +++ .../jit-test/tests/jaeger/testAddStringObject.js | 17 ++ js/src/jit-test/tests/jaeger/testBug550743.js | 21 +++ .../jit-test/tests/jaeger/testCallElemAfterGC.js | 20 +++ js/src/jit-test/tests/jaeger/testDenseCallElem.js | 89 ++++++++++ js/src/jit-test/tests/jaeger/testForOps.js | 67 ++++++++ js/src/jit-test/tests/jaeger/testIfEqX.js | 37 ++++ js/src/jit-test/tests/jaeger/testPropCallElem.js | 93 ++++++++++ js/src/jit-test/tests/jaeger/testPropCallElem2.js | 20 +++ js/src/jit-test/tests/jaeger/testSetElem-Easy.js | 41 +++++ .../jit-test/tests/jaeger/testSetElem-Indexed.js | 36 ++++ .../jit-test/tests/jaeger/testSetElem-NewProto.js | 24 +++ .../tests/jaeger/testSetTypedFloatArray.js | 61 +++++++ .../jit-test/tests/jaeger/testSetTypedIntArray.js | 190 +++++++++++++++++++++ .../jit-test/tests/jaeger/testShiftSameBacking.js | 12 ++ js/src/jit-test/tests/jaeger/testTableSwitchX.js | 25 +++ js/src/jit-test/tests/jaeger/undoAdd.js | 25 +++ js/src/jit-test/tests/jaeger/unsignedShiftZero.js | 8 + js/src/jit-test/tests/jaeger/xor-sanity.js | 1 + 458 files changed, 7164 insertions(+) create mode 100644 js/src/jit-test/tests/jaeger/argumentsOptimize-1.js create mode 100644 js/src/jit-test/tests/jaeger/argumentsOptimize-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug549393-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug549393-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug549396.js create mode 100644 js/src/jit-test/tests/jaeger/bug549398.js create mode 100644 js/src/jit-test/tests/jaeger/bug549521.js create mode 100644 js/src/jit-test/tests/jaeger/bug549602.js create mode 100644 js/src/jit-test/tests/jaeger/bug549603.js create mode 100644 js/src/jit-test/tests/jaeger/bug550490.js create mode 100644 js/src/jit-test/tests/jaeger/bug550665.js create mode 100644 js/src/jit-test/tests/jaeger/bug551603.js create mode 100644 js/src/jit-test/tests/jaeger/bug552644.js create mode 100644 js/src/jit-test/tests/jaeger/bug553781-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug553781.js create mode 100644 js/src/jit-test/tests/jaeger/bug553784.js create mode 100644 js/src/jit-test/tests/jaeger/bug554580-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug554580-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug554580-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug554580-4.js create mode 100644 js/src/jit-test/tests/jaeger/bug554580-5.js create mode 100644 js/src/jit-test/tests/jaeger/bug554651.js create mode 100644 js/src/jit-test/tests/jaeger/bug554675-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug554675-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug554675-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug555152.js create mode 100644 js/src/jit-test/tests/jaeger/bug555155.js create mode 100644 js/src/jit-test/tests/jaeger/bug555206.js create mode 100644 js/src/jit-test/tests/jaeger/bug555543.js create mode 100644 js/src/jit-test/tests/jaeger/bug556525.js create mode 100644 js/src/jit-test/tests/jaeger/bug557063.js create mode 100644 js/src/jit-test/tests/jaeger/bug557068.js create mode 100644 js/src/jit-test/tests/jaeger/bug557070.js create mode 100644 js/src/jit-test/tests/jaeger/bug557075.js create mode 100644 js/src/jit-test/tests/jaeger/bug560221.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-call-newvar.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-call-typechange.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-call.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-getter-newvar.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-getter-typechange.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-getter.js create mode 100644 js/src/jit-test/tests/jaeger/bug563000/eif-global-newvar.js create mode 100644 js/src/jit-test/tests/jaeger/bug565198.js create mode 100644 js/src/jit-test/tests/jaeger/bug566022.js create mode 100644 js/src/jit-test/tests/jaeger/bug573433.js create mode 100644 js/src/jit-test/tests/jaeger/bug576398.js create mode 100644 js/src/jit-test/tests/jaeger/bug577580.js create mode 100644 js/src/jit-test/tests/jaeger/bug577646.js create mode 100644 js/src/jit-test/tests/jaeger/bug577705.js create mode 100644 js/src/jit-test/tests/jaeger/bug577996.js create mode 100644 js/src/jit-test/tests/jaeger/bug580712.js create mode 100644 js/src/jit-test/tests/jaeger/bug580884-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug580884.js create mode 100644 js/src/jit-test/tests/jaeger/bug580931-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug581871.js create mode 100644 js/src/jit-test/tests/jaeger/bug581936.js create mode 100644 js/src/jit-test/tests/jaeger/bug582185.js create mode 100644 js/src/jit-test/tests/jaeger/bug582286.js create mode 100644 js/src/jit-test/tests/jaeger/bug582392.js create mode 100644 js/src/jit-test/tests/jaeger/bug582880.js create mode 100644 js/src/jit-test/tests/jaeger/bug582882.js create mode 100644 js/src/jit-test/tests/jaeger/bug582884.js create mode 100644 js/src/jit-test/tests/jaeger/bug582894.js create mode 100644 js/src/jit-test/tests/jaeger/bug582897.js create mode 100644 js/src/jit-test/tests/jaeger/bug582898.js create mode 100644 js/src/jit-test/tests/jaeger/bug582900.js create mode 100644 js/src/jit-test/tests/jaeger/bug583158.js create mode 100644 js/src/jit-test/tests/jaeger/bug583160.js create mode 100644 js/src/jit-test/tests/jaeger/bug583672.js create mode 100644 js/src/jit-test/tests/jaeger/bug583688.js create mode 100644 js/src/jit-test/tests/jaeger/bug583689.js create mode 100644 js/src/jit-test/tests/jaeger/bug584644-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug584646.js create mode 100644 js/src/jit-test/tests/jaeger/bug584647.js create mode 100644 js/src/jit-test/tests/jaeger/bug585310.js create mode 100644 js/src/jit-test/tests/jaeger/bug585341.js create mode 100644 js/src/jit-test/tests/jaeger/bug585391.js create mode 100644 js/src/jit-test/tests/jaeger/bug585408-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug585408-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug585408.js create mode 100644 js/src/jit-test/tests/jaeger/bug585540.js create mode 100644 js/src/jit-test/tests/jaeger/bug587431.js create mode 100644 js/src/jit-test/tests/jaeger/bug588338.js create mode 100644 js/src/jit-test/tests/jaeger/bug588362-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug588362-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug588362-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug588363-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug588363-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug589108.js create mode 100644 js/src/jit-test/tests/jaeger/bug589115.js create mode 100644 js/src/jit-test/tests/jaeger/bug589461.js create mode 100644 js/src/jit-test/tests/jaeger/bug590083.js create mode 100644 js/src/jit-test/tests/jaeger/bug591606.js create mode 100644 js/src/jit-test/tests/jaeger/bug592973-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug592973-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug592973-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug593554.js create mode 100644 js/src/jit-test/tests/jaeger/bug595917.js create mode 100644 js/src/jit-test/tests/jaeger/bug595921.js create mode 100644 js/src/jit-test/tests/jaeger/bug597378.js create mode 100644 js/src/jit-test/tests/jaeger/bug597871.js create mode 100644 js/src/jit-test/tests/jaeger/bug598696.js create mode 100644 js/src/jit-test/tests/jaeger/bug599488.js create mode 100644 js/src/jit-test/tests/jaeger/bug600139.js create mode 100644 js/src/jit-test/tests/jaeger/bug600419.js create mode 100644 js/src/jit-test/tests/jaeger/bug600424.js create mode 100644 js/src/jit-test/tests/jaeger/bug601982.js create mode 100644 js/src/jit-test/tests/jaeger/bug604381.js create mode 100644 js/src/jit-test/tests/jaeger/bug604427.js create mode 100644 js/src/jit-test/tests/jaeger/bug606662-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug606829.js create mode 100644 js/src/jit-test/tests/jaeger/bug610652.js create mode 100644 js/src/jit-test/tests/jaeger/bug615440.js create mode 100644 js/src/jit-test/tests/jaeger/bug616508.js create mode 100644 js/src/jit-test/tests/jaeger/bug617433.js create mode 100644 js/src/jit-test/tests/jaeger/bug617440.js create mode 100644 js/src/jit-test/tests/jaeger/bug617458.js create mode 100644 js/src/jit-test/tests/jaeger/bug617460.js create mode 100644 js/src/jit-test/tests/jaeger/bug617549.js create mode 100644 js/src/jit-test/tests/jaeger/bug617558.js create mode 100644 js/src/jit-test/tests/jaeger/bug617624.js create mode 100644 js/src/jit-test/tests/jaeger/bug618007.js create mode 100644 js/src/jit-test/tests/jaeger/bug618849.js create mode 100644 js/src/jit-test/tests/jaeger/bug618850.js create mode 100644 js/src/jit-test/tests/jaeger/bug618863.js create mode 100644 js/src/jit-test/tests/jaeger/bug619339.js create mode 100644 js/src/jit-test/tests/jaeger/bug619433-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug619433-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug620643.js create mode 100644 js/src/jit-test/tests/jaeger/bug621522.js create mode 100644 js/src/jit-test/tests/jaeger/bug621655.js create mode 100644 js/src/jit-test/tests/jaeger/bug623474.js create mode 100644 js/src/jit-test/tests/jaeger/bug624100.js create mode 100644 js/src/jit-test/tests/jaeger/bug624483.js create mode 100644 js/src/jit-test/tests/jaeger/bug625157.js create mode 100644 js/src/jit-test/tests/jaeger/bug625377.js create mode 100644 js/src/jit-test/tests/jaeger/bug625438.js create mode 100644 js/src/jit-test/tests/jaeger/bug625718-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug625718-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug625718-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug625757.js create mode 100644 js/src/jit-test/tests/jaeger/bug627486.js create mode 100644 js/src/jit-test/tests/jaeger/bug630366.js create mode 100644 js/src/jit-test/tests/jaeger/bug639459.js create mode 100644 js/src/jit-test/tests/jaeger/bug639478-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug639478-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug639587.js create mode 100644 js/src/jit-test/tests/jaeger/bug639792.js create mode 100644 js/src/jit-test/tests/jaeger/bug639808.js create mode 100644 js/src/jit-test/tests/jaeger/bug640098.js create mode 100644 js/src/jit-test/tests/jaeger/bug640102.js create mode 100644 js/src/jit-test/tests/jaeger/bug640614.js create mode 100644 js/src/jit-test/tests/jaeger/bug642198.js create mode 100644 js/src/jit-test/tests/jaeger/bug643653-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug643653-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug643805.js create mode 100644 js/src/jit-test/tests/jaeger/bug643829.js create mode 100644 js/src/jit-test/tests/jaeger/bug643913.js create mode 100644 js/src/jit-test/tests/jaeger/bug645629.js create mode 100644 js/src/jit-test/tests/jaeger/bug645657.js create mode 100644 js/src/jit-test/tests/jaeger/bug645985.js create mode 100644 js/src/jit-test/tests/jaeger/bug646001.js create mode 100644 js/src/jit-test/tests/jaeger/bug646060.js create mode 100644 js/src/jit-test/tests/jaeger/bug646411.js create mode 100644 js/src/jit-test/tests/jaeger/bug646495.js create mode 100644 js/src/jit-test/tests/jaeger/bug646938.js create mode 100644 js/src/jit-test/tests/jaeger/bug647440.js create mode 100644 js/src/jit-test/tests/jaeger/bug647657.js create mode 100644 js/src/jit-test/tests/jaeger/bug647785.js create mode 100644 js/src/jit-test/tests/jaeger/bug648004.js create mode 100644 js/src/jit-test/tests/jaeger/bug648230-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug648230-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug648498.js create mode 100644 js/src/jit-test/tests/jaeger/bug648586.js create mode 100644 js/src/jit-test/tests/jaeger/bug648708.js create mode 100644 js/src/jit-test/tests/jaeger/bug649272.js create mode 100644 js/src/jit-test/tests/jaeger/bug649593.js create mode 100644 js/src/jit-test/tests/jaeger/bug649689.js create mode 100644 js/src/jit-test/tests/jaeger/bug649775.js create mode 100644 js/src/jit-test/tests/jaeger/bug649824.js create mode 100644 js/src/jit-test/tests/jaeger/bug649973.js create mode 100644 js/src/jit-test/tests/jaeger/bug650076.js create mode 100644 js/src/jit-test/tests/jaeger/bug650662.js create mode 100644 js/src/jit-test/tests/jaeger/bug650663.js create mode 100644 js/src/jit-test/tests/jaeger/bug651147.js create mode 100644 js/src/jit-test/tests/jaeger/bug652305.js create mode 100644 js/src/jit-test/tests/jaeger/bug652314.js create mode 100644 js/src/jit-test/tests/jaeger/bug652590.js create mode 100644 js/src/jit-test/tests/jaeger/bug653243.js create mode 100644 js/src/jit-test/tests/jaeger/bug653249.js create mode 100644 js/src/jit-test/tests/jaeger/bug653397.js create mode 100644 js/src/jit-test/tests/jaeger/bug655505.js create mode 100644 js/src/jit-test/tests/jaeger/bug655508.js create mode 100644 js/src/jit-test/tests/jaeger/bug655810.js create mode 100644 js/src/jit-test/tests/jaeger/bug655990.js create mode 100644 js/src/jit-test/tests/jaeger/bug656096.js create mode 100644 js/src/jit-test/tests/jaeger/bug656252.js create mode 100644 js/src/jit-test/tests/jaeger/bug656259.js create mode 100644 js/src/jit-test/tests/jaeger/bug656591.js create mode 100644 js/src/jit-test/tests/jaeger/bug656748.js create mode 100644 js/src/jit-test/tests/jaeger/bug656914.js create mode 100644 js/src/jit-test/tests/jaeger/bug657120.js create mode 100644 js/src/jit-test/tests/jaeger/bug657247.js create mode 100644 js/src/jit-test/tests/jaeger/bug657890.js create mode 100644 js/src/jit-test/tests/jaeger/bug658240.js create mode 100644 js/src/jit-test/tests/jaeger/bug658294.js create mode 100644 js/src/jit-test/tests/jaeger/bug658579.js create mode 100644 js/src/jit-test/tests/jaeger/bug658968.js create mode 100644 js/src/jit-test/tests/jaeger/bug659438.js create mode 100644 js/src/jit-test/tests/jaeger/bug659439.js create mode 100644 js/src/jit-test/tests/jaeger/bug659448.js create mode 100644 js/src/jit-test/tests/jaeger/bug659456.js create mode 100644 js/src/jit-test/tests/jaeger/bug660002.js create mode 100644 js/src/jit-test/tests/jaeger/bug662072.js create mode 100644 js/src/jit-test/tests/jaeger/bug662082.js create mode 100644 js/src/jit-test/tests/jaeger/bug663485.js create mode 100644 js/src/jit-test/tests/jaeger/bug663910.js create mode 100644 js/src/jit-test/tests/jaeger/bug669706.js create mode 100644 js/src/jit-test/tests/jaeger/bug670885.js create mode 100644 js/src/jit-test/tests/jaeger/bug672122.js create mode 100644 js/src/jit-test/tests/jaeger/bug678141.js create mode 100644 js/src/jit-test/tests/jaeger/bug678234.js create mode 100644 js/src/jit-test/tests/jaeger/bug678782.js create mode 100644 js/src/jit-test/tests/jaeger/bug679666.js create mode 100644 js/src/jit-test/tests/jaeger/bug680842.js create mode 100644 js/src/jit-test/tests/jaeger/bug681006.js create mode 100644 js/src/jit-test/tests/jaeger/bug682345.js create mode 100644 js/src/jit-test/tests/jaeger/bug684084-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug684084.js create mode 100644 js/src/jit-test/tests/jaeger/bug684576.js create mode 100644 js/src/jit-test/tests/jaeger/bug684824.js create mode 100644 js/src/jit-test/tests/jaeger/bug684943.js create mode 100644 js/src/jit-test/tests/jaeger/bug687768.js create mode 100644 js/src/jit-test/tests/jaeger/bug693311.js create mode 100644 js/src/jit-test/tests/jaeger/bug704138.js create mode 100644 js/src/jit-test/tests/jaeger/bug705873.js create mode 100644 js/src/jit-test/tests/jaeger/bug706110.js create mode 100644 js/src/jit-test/tests/jaeger/bug707641.js create mode 100644 js/src/jit-test/tests/jaeger/bug709067.js create mode 100644 js/src/jit-test/tests/jaeger/bug710780.js create mode 100644 js/src/jit-test/tests/jaeger/bug714645.js create mode 100644 js/src/jit-test/tests/jaeger/bug719918.js create mode 100644 js/src/jit-test/tests/jaeger/bug732423.js create mode 100644 js/src/jit-test/tests/jaeger/bug735161.js create mode 100644 js/src/jit-test/tests/jaeger/bug738525.js create mode 100644 js/src/jit-test/tests/jaeger/bug742393.js create mode 100644 js/src/jit-test/tests/jaeger/bug751320.js create mode 100644 js/src/jit-test/tests/jaeger/bug767961.js create mode 100644 js/src/jit-test/tests/jaeger/bug768313.js create mode 100644 js/src/jit-test/tests/jaeger/bug769985.js create mode 100644 js/src/jit-test/tests/jaeger/bug771871.js create mode 100644 js/src/jit-test/tests/jaeger/bug781859-1.js create mode 100644 js/src/jit-test/tests/jaeger/bug781859-2.js create mode 100644 js/src/jit-test/tests/jaeger/bug781859-3.js create mode 100644 js/src/jit-test/tests/jaeger/bug819035.js create mode 100644 js/src/jit-test/tests/jaeger/bug825966.js create mode 100644 js/src/jit-test/tests/jaeger/chunk/bug712267.js create mode 100644 js/src/jit-test/tests/jaeger/clonefun.js create mode 100644 js/src/jit-test/tests/jaeger/closure-01.js create mode 100644 js/src/jit-test/tests/jaeger/closure-02.js create mode 100644 js/src/jit-test/tests/jaeger/closure-03.js create mode 100644 js/src/jit-test/tests/jaeger/closure-04.js create mode 100644 js/src/jit-test/tests/jaeger/closure-05.js create mode 100644 js/src/jit-test/tests/jaeger/compare-wrong-1.js create mode 100644 js/src/jit-test/tests/jaeger/crash-on-compare.js create mode 100644 js/src/jit-test/tests/jaeger/deepBailAfterRunTracer.js create mode 100644 js/src/jit-test/tests/jaeger/floatTypedArrays.js create mode 100644 js/src/jit-test/tests/jaeger/fromCharCode.js create mode 100644 js/src/jit-test/tests/jaeger/fused-eq-ifeq.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-1.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-2.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-3.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-4.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-5.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-6.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-7.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-8.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js create mode 100644 js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js create mode 100644 js/src/jit-test/tests/jaeger/getter-hook-1.js create mode 100644 js/src/jit-test/tests/jaeger/getter-hook-2.js create mode 100644 js/src/jit-test/tests/jaeger/globalOptimize-1.js create mode 100644 js/src/jit-test/tests/jaeger/globalOptimize-2.js create mode 100644 js/src/jit-test/tests/jaeger/globalOptimize-4.js create mode 100644 js/src/jit-test/tests/jaeger/in.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug645645.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug645666.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug646004.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug646480.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug647973.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug651209.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug655954.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug656221.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug676491.js create mode 100644 js/src/jit-test/tests/jaeger/inline/bug680759.js create mode 100644 js/src/jit-test/tests/jaeger/inline/doubleArg.js create mode 100644 js/src/jit-test/tests/jaeger/inline/mathAbs.js create mode 100644 js/src/jit-test/tests/jaeger/inline/mathFloor.js create mode 100644 js/src/jit-test/tests/jaeger/inline/mathPow.js create mode 100644 js/src/jit-test/tests/jaeger/inline/mathRound.js create mode 100644 js/src/jit-test/tests/jaeger/inline/mathSqrt.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-01.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-02.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-03.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-04.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-05.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-06.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-07.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-08.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-09.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-10.js create mode 100644 js/src/jit-test/tests/jaeger/inline/scripted-11.js create mode 100644 js/src/jit-test/tests/jaeger/inline/stringCharAt.js create mode 100644 js/src/jit-test/tests/jaeger/inline/stringCharCodeAt.js create mode 100644 js/src/jit-test/tests/jaeger/inline/undefinedLocal.js create mode 100644 js/src/jit-test/tests/jaeger/instanceOfWithKnownTypes.js create mode 100644 js/src/jit-test/tests/jaeger/invokeSessionGuard.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug651155.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug654393.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug655854.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug658290.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug659452.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug668643.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug671814.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug680809.js create mode 100644 js/src/jit-test/tests/jaeger/loops/bug684621.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-01.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-02.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-03.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-04.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-05.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-06.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-07.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-08.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-09.js create mode 100644 js/src/jit-test/tests/jaeger/loops/hoist-10.js create mode 100644 js/src/jit-test/tests/jaeger/loops/integer-1.js create mode 100644 js/src/jit-test/tests/jaeger/loops/integer-2.js create mode 100644 js/src/jit-test/tests/jaeger/loops/integer-3.js create mode 100644 js/src/jit-test/tests/jaeger/loops/multiply-by-int32min.js create mode 100644 js/src/jit-test/tests/jaeger/loops/property-1.js create mode 100644 js/src/jit-test/tests/jaeger/modConstDoubles.js create mode 100644 js/src/jit-test/tests/jaeger/modConstInt.js create mode 100644 js/src/jit-test/tests/jaeger/modConstZeroRhs.js create mode 100644 js/src/jit-test/tests/jaeger/modWithConstLhs.js create mode 100644 js/src/jit-test/tests/jaeger/mulNegZero.js create mode 100644 js/src/jit-test/tests/jaeger/negation.js create mode 100644 js/src/jit-test/tests/jaeger/normalIntTypedArrays.js create mode 100644 js/src/jit-test/tests/jaeger/optimize-globals-1.js create mode 100644 js/src/jit-test/tests/jaeger/optimize-globals-2.js create mode 100644 js/src/jit-test/tests/jaeger/optimize-globals-3.js create mode 100644 js/src/jit-test/tests/jaeger/propertyOptimize-1.js create mode 100644 js/src/jit-test/tests/jaeger/propertyOptimize-2.js create mode 100644 js/src/jit-test/tests/jaeger/propertyOptimize-3.js create mode 100644 js/src/jit-test/tests/jaeger/propertyOptimize-4.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/arith.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug617592.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug621292.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug621328.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug638977.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug639508.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug639882.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug640608.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug641225.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug641269.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug641535.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug642405.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug643182.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug643376.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug643669.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug645044.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug646267.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647183.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647199.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647532.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647547.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647991-1.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug647991-2.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug648502.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug648567.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug648843.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug648966.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug649261.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug649769.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug651119.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug653980.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug654536.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug655949.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug655998.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug656753.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug657288.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug658209.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug658211.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug658212.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug658561.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug658777.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug659639.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug659766.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug660737.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug661859.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug663690.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug671943-1.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug671943-2.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug672123.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug673812.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug674391.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/bug676764.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/callic.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/exotic.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/flush.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/getelem.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/incdec.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/inlinestubs.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/memory-01.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/memory-02.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/memory-03.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/memory-04.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/native.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/nativemulti.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/nativestack.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/patchdouble.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/property.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/propic.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/staticoverflow.js create mode 100644 js/src/jit-test/tests/jaeger/recompile/undef.js create mode 100644 js/src/jit-test/tests/jaeger/regalloc-double.js create mode 100644 js/src/jit-test/tests/jaeger/regalloc-live.js create mode 100644 js/src/jit-test/tests/jaeger/regress-bug625701.js create mode 100644 js/src/jit-test/tests/jaeger/rsh-sanity-1.js create mode 100644 js/src/jit-test/tests/jaeger/scriptedICs-1.js create mode 100644 js/src/jit-test/tests/jaeger/setPropTypeGuard.js create mode 100644 js/src/jit-test/tests/jaeger/smallIntTypedArrays.js create mode 100644 js/src/jit-test/tests/jaeger/strictModeSetUndefinedVar.js create mode 100644 js/src/jit-test/tests/jaeger/subCommutativity.js create mode 100644 js/src/jit-test/tests/jaeger/tableSwitchConst.js create mode 100644 js/src/jit-test/tests/jaeger/tableSwitchDouble.js create mode 100644 js/src/jit-test/tests/jaeger/tableSwitchEmpty.js create mode 100644 js/src/jit-test/tests/jaeger/tableSwitchFloat.js create mode 100644 js/src/jit-test/tests/jaeger/tableSwitchNeg.js create mode 100644 js/src/jit-test/tests/jaeger/testAddStringObject.js create mode 100644 js/src/jit-test/tests/jaeger/testBug550743.js create mode 100644 js/src/jit-test/tests/jaeger/testCallElemAfterGC.js create mode 100644 js/src/jit-test/tests/jaeger/testDenseCallElem.js create mode 100644 js/src/jit-test/tests/jaeger/testForOps.js create mode 100644 js/src/jit-test/tests/jaeger/testIfEqX.js create mode 100644 js/src/jit-test/tests/jaeger/testPropCallElem.js create mode 100644 js/src/jit-test/tests/jaeger/testPropCallElem2.js create mode 100644 js/src/jit-test/tests/jaeger/testSetElem-Easy.js create mode 100644 js/src/jit-test/tests/jaeger/testSetElem-Indexed.js create mode 100644 js/src/jit-test/tests/jaeger/testSetElem-NewProto.js create mode 100644 js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js create mode 100644 js/src/jit-test/tests/jaeger/testSetTypedIntArray.js create mode 100644 js/src/jit-test/tests/jaeger/testShiftSameBacking.js create mode 100644 js/src/jit-test/tests/jaeger/testTableSwitchX.js create mode 100644 js/src/jit-test/tests/jaeger/undoAdd.js create mode 100644 js/src/jit-test/tests/jaeger/unsignedShiftZero.js create mode 100644 js/src/jit-test/tests/jaeger/xor-sanity.js (limited to 'js/src/jit-test/tests/jaeger') diff --git a/js/src/jit-test/tests/jaeger/argumentsOptimize-1.js b/js/src/jit-test/tests/jaeger/argumentsOptimize-1.js new file mode 100644 index 000000000..6ee2c6af1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/argumentsOptimize-1.js @@ -0,0 +1,14 @@ + +function bar() { + foo.arguments.length = 10; +} + +function foo(x) { + var a = arguments; + var n = 0; + bar(); + assertEq(x, 5); + assertEq(a.length, 1); +} + +foo(5); diff --git a/js/src/jit-test/tests/jaeger/argumentsOptimize-2.js b/js/src/jit-test/tests/jaeger/argumentsOptimize-2.js new file mode 100644 index 000000000..e7b1b9bd2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/argumentsOptimize-2.js @@ -0,0 +1,27 @@ + +function foo() { + var x = 0; + for (var i = arguments.length - 1; i >= 0; i--) + x += arguments[i]; + return x; +} + +function bar() { + var x = 0; + for (var i = 0; i < arguments.length; i++) + x += arguments[i]; + return x; +} + +function baz(a,b,c,d,e) { + var x = 0; + for (var i = 0; i < arguments.length; i++) + x += arguments[i]; + return x; +} + +for (var i = 0; i < 10; i++) { + assertEq(foo(1,2,3,4,5), 15); + assertEq(bar(1,2.5,true,{valueOf:function() { return 10}},"five"), "14.5five"); + assertEq(baz(1,2,3,4,5), 15); +} diff --git a/js/src/jit-test/tests/jaeger/bug549393-1.js b/js/src/jit-test/tests/jaeger/bug549393-1.js new file mode 100644 index 000000000..817d1255b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549393-1.js @@ -0,0 +1,43 @@ +// |jit-test| error: TypeError +function start() { + MAX_TOTAL_TIME = startTime = new Date + do { + if (rnd(0)) return (a[rnd()])() + lastTime = new Date + } while ( lastTime - startTime < MAX_TOTAL_TIME ) +} +function MersenneTwister19937() { + this.init_genrand = function() { + for (mti = 1; mti < 4; mti++) { + Array[mti] = 1 + } + }; + this.genrand_int32_t = function() { + if (mti > 4) { + mti = 0 + } + return Array[mti++]; + } +} (function() { + fuzzMT = new MersenneTwister19937; + fuzzMT.init_genrand() + rnd = function() { + return Math.floor(fuzzMT.genrand_int32()) + } +} ()) +function weighted(wa) { + a = [] + for (i = 0; i < wa.length; ++i) { + for (var j = 0; j < 8; ++j) { + a.push(wa[i].fun) + } + } +} +statementMakers = weighted([{ + fun: function makeMixedTypeArray() { [[, , , , , , , , , , , , , , , , , , , +, , , , , ""][(a[rnd()])()]]} +}]) +start() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug549393-2.js b/js/src/jit-test/tests/jaeger/bug549393-2.js new file mode 100644 index 000000000..6c902ca17 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549393-2.js @@ -0,0 +1,10 @@ +(function () { + for (var q = 0; q < 6; ++q) { + x: (function () { + var m = (function () {})() + })([0, , 0, 0, 0, , 0, 0, 0, , 0, 0, 0, , 0, 0, 0, 0, 0, 0, Number(1)]) + } +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug549396.js b/js/src/jit-test/tests/jaeger/bug549396.js new file mode 100644 index 000000000..9fbefe4f8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549396.js @@ -0,0 +1 @@ +x = this.__defineSetter__("x", function(z) function() { z }) diff --git a/js/src/jit-test/tests/jaeger/bug549398.js b/js/src/jit-test/tests/jaeger/bug549398.js new file mode 100644 index 000000000..7e18e43d7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549398.js @@ -0,0 +1,10 @@ +(function () { + eval("\ + for(var z = 0 ; z < 2 ; ++z) {\ + this\ + }\ + ", ([1,2,3])) +})() + +/* Don't crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug549521.js b/js/src/jit-test/tests/jaeger/bug549521.js new file mode 100644 index 000000000..f7eeee8fa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549521.js @@ -0,0 +1,13 @@ +function f(y) { + if (y) + return; + { + let x; + for (;;) {} + } +} + + +/* Don't assert. */ +f(1); + diff --git a/js/src/jit-test/tests/jaeger/bug549602.js b/js/src/jit-test/tests/jaeger/bug549602.js new file mode 100644 index 000000000..7a71f8104 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549602.js @@ -0,0 +1,31 @@ +version(180) +function f1(code) { + var c + var t = code.replace(/s/, "") + var f = new Function(code) + var o + e = v = f2(f, c) +} +function f2(f, e) { + try { + a = f() + } catch(r) { + var r = g() + } +} +g1 = [{ + text: "(function sum_slicing(array){return array==0?0:a+sum_slicing(array.slice(1))})", + test: function (f) { + f([, 2]) == "" + } +}]; +(function () { + for (var i = 0; i < g1.length; ++i) { + var a = g1[i] + var text = a.text + var f = eval(text.replace(/@/, "")) + if (a.test(f)) {} + } +}()) +f1("for(let a=0;a<6;a++){print([\"\"].some(function(){false>\"\"}))}") + diff --git a/js/src/jit-test/tests/jaeger/bug549603.js b/js/src/jit-test/tests/jaeger/bug549603.js new file mode 100644 index 000000000..5d5dea67d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug549603.js @@ -0,0 +1,3 @@ +// |jit-test| error: ReferenceError +x ? o : [] && x + diff --git a/js/src/jit-test/tests/jaeger/bug550490.js b/js/src/jit-test/tests/jaeger/bug550490.js new file mode 100644 index 000000000..f4348067c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug550490.js @@ -0,0 +1,14 @@ + +function a() { + function f() {} + this.d = function() { + f + } +} (function() { + var a2, x + a2 = new a; + d = (function(){x * 1})(); +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug550665.js b/js/src/jit-test/tests/jaeger/bug550665.js new file mode 100644 index 000000000..816888b5e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug550665.js @@ -0,0 +1,8 @@ +(function () { + var a; + eval("for(w in ((function(x,y){b:0})())) ;"); +})(); + +this.__defineSetter__("l", function() { gc() }); +this.watch("l", function(x) { yield {} }); +l = true; diff --git a/js/src/jit-test/tests/jaeger/bug551603.js b/js/src/jit-test/tests/jaeger/bug551603.js new file mode 100644 index 000000000..019408e27 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug551603.js @@ -0,0 +1,8 @@ +(function() { + ((function f(a) { + if (a > 0) { + f(a - 1) + } + })(6)) +})() + diff --git a/js/src/jit-test/tests/jaeger/bug552644.js b/js/src/jit-test/tests/jaeger/bug552644.js new file mode 100644 index 000000000..20babe1d7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug552644.js @@ -0,0 +1,6 @@ +(function() { + for (e in ((function() { + yield + })())) return +})() +/* Don't assert. */ diff --git a/js/src/jit-test/tests/jaeger/bug553781-2.js b/js/src/jit-test/tests/jaeger/bug553781-2.js new file mode 100644 index 000000000..b10c5c891 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug553781-2.js @@ -0,0 +1,13 @@ +(function() { + do { + try { + return + } + catch(x if (c)) { + return + } (x) + } while (x) +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug553781.js b/js/src/jit-test/tests/jaeger/bug553781.js new file mode 100644 index 000000000..4c9b67432 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug553781.js @@ -0,0 +1,11 @@ +(function () { + try { + return + } catch (x if i) { + return + } + for (z in []); +})() + +/* Don't assert */ + diff --git a/js/src/jit-test/tests/jaeger/bug553784.js b/js/src/jit-test/tests/jaeger/bug553784.js new file mode 100644 index 000000000..85a298f4b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug553784.js @@ -0,0 +1,18 @@ +// |jit-test| allow-oom +(function(){ + (x)=[1,2,3] +})() +try{ + (function(){ + ((function a(aaaaaa,bbbbbb){ + if(aaaaaa.length==bbbbbb){ + return eval%bbbbbb.valueOf() + } + cccccc=a(aaaaaa,bbbbbb+1) + return cccccc._=x + })([,,,,,,,,,,,,,,,,,,0],0)) + })() +}catch(e){} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554580-1.js b/js/src/jit-test/tests/jaeger/bug554580-1.js new file mode 100644 index 000000000..0e8daade7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554580-1.js @@ -0,0 +1,7 @@ +// |jit-test| error: TypeError +for (var a = 0; a < 7; ++a) { + if (a == 1) { + Iterator() + } +} + diff --git a/js/src/jit-test/tests/jaeger/bug554580-2.js b/js/src/jit-test/tests/jaeger/bug554580-2.js new file mode 100644 index 000000000..d297f3a46 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554580-2.js @@ -0,0 +1,9 @@ +// |jit-test| error: RangeError +(function() { + for each(let a in [function() {}, Infinity]) { + new Array(a) + } +})() + +/* Don't assert/crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554580-3.js b/js/src/jit-test/tests/jaeger/bug554580-3.js new file mode 100644 index 000000000..7728e5adf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554580-3.js @@ -0,0 +1,11 @@ +// |jit-test| error: TypeError +Function("\n\ + for (a = 0; a < 3; a++) {\n\ + if (a == 0) {} else {\n\ + this.__defineSetter__(\"\",1)\n\ + }\n\ + }\n\ +")() + +/* Don't crash/assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554580-4.js b/js/src/jit-test/tests/jaeger/bug554580-4.js new file mode 100644 index 000000000..f9a25ad3d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554580-4.js @@ -0,0 +1,18 @@ +(function() { + try { + (eval("\ + function() {\ + for each(let y in [0]) {\ + for (var a = 0; a < 9; ++a) {\ + if (a) {\ + this.__defineGetter__(\"\",this)\ + }\ + }\ + }\ + }\ + "))() + } catch(e) {} +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554580-5.js b/js/src/jit-test/tests/jaeger/bug554580-5.js new file mode 100644 index 000000000..1d3ee522b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554580-5.js @@ -0,0 +1,20 @@ +(function() { + (function g(m, n) { + if (m = n) { + return eval("x=this") + } + g(m, 1)[[]] + })() +})() +Function("\ + for (let b in [0]) {\ + for (var k = 0; k < 6; ++k) {\ + if (k == 1) {\ + print(x)\ + }\ + }\ + }\ +")() + +/* Don't crash/assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554651.js b/js/src/jit-test/tests/jaeger/bug554651.js new file mode 100644 index 000000000..23be34d79 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554651.js @@ -0,0 +1,15 @@ +// |jit-test| error: InternalError +(function() { + try { + (Function("this.__defineGetter__(\"x\",(Function(\"for(z=0;z<6;z++)(x)\")))"))() + } catch(e) {} +})() +((function f(d, aaaaaa) { + if (bbbbbb = aaaaaa) { + x + } + f(bbbbbb, aaaaaa + 1) +})([], 0)) + +/* Don't assert (32-bit mac only, relies on very specific stack usage). */ + diff --git a/js/src/jit-test/tests/jaeger/bug554675-1.js b/js/src/jit-test/tests/jaeger/bug554675-1.js new file mode 100644 index 000000000..2dcbae811 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554675-1.js @@ -0,0 +1,8 @@ +(function() { + for (e in [0, 0]) { + if (/x/ < this) {} + } +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug554675-2.js b/js/src/jit-test/tests/jaeger/bug554675-2.js new file mode 100644 index 000000000..d3b6988c9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug554675-2.js @@ -0,0 +1,11 @@ +function a(code) { + var f = new Function("for each(let x in[false,'',/x/,'',{}]){if(x> i) { + sum = g2(sum, g1(n2)) + } + } + return sum + } + this.h1 = function() { + for (mti = 1; mti < N; mti++) { + mt[mti] = g2(g3(3, g1(mt[mti - 1] ^ 0)), mti) + } + }; + this.i2 = function() { + if (mti > N) { + mti = 0; + } + y = mt[mti++]; + return y + }; + this.i1 = function() { + return (this.i2() + 5) * 2e-10 + }; +} (function() { + fuzzMT = new f1; + fuzzMT.h1(9); + rnd = function(n) { + return Math.floor(fuzzMT.i1() * n) + }; +} ()); +function f5(a) { + return a[rnd(a.length)] +} +function f2(d, b) { + f3(d, b); + return "" + f2(2, b) + ""; +} +function f3(d, b) { + if (rnd(4) == 1) { + f5(f4)(d, b) + } +} +var f4 = [function() { ["", f6(), ""] +}]; +function f6(db) { + return f5(foo)(); +} +var foo = [function() { + t(["", "", "", "", "", "", "", "", "", "", "", "" + h.I, ""]); +}]; +f2() + +/* Don't assert or crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug577996.js b/js/src/jit-test/tests/jaeger/bug577996.js new file mode 100644 index 000000000..1c7fa6a2a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug577996.js @@ -0,0 +1,6 @@ +Function("\n\ + for each(y in[0,0,0]) {\n\ + for(x in[0,0,0,0,0,0,0,0,0,new Boolean(true),0,0,0,new Boolean(true)]) {}\n\ + }\n\ +")() + diff --git a/js/src/jit-test/tests/jaeger/bug580712.js b/js/src/jit-test/tests/jaeger/bug580712.js new file mode 100644 index 000000000..aabb5f5f0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug580712.js @@ -0,0 +1 @@ +--''.trimLeft diff --git a/js/src/jit-test/tests/jaeger/bug580884-3.js b/js/src/jit-test/tests/jaeger/bug580884-3.js new file mode 100644 index 000000000..fb22882b1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug580884-3.js @@ -0,0 +1,10 @@ +function testDestructuring() { + eval(); + var t = 0; + for (var i = 0; i < 9; ++i) { + var [r, g, b] = [1, 1, 1]; + t += r + g + b; + } + return t +} +assertEq(testDestructuring(), (9) * 3); diff --git a/js/src/jit-test/tests/jaeger/bug580884.js b/js/src/jit-test/tests/jaeger/bug580884.js new file mode 100644 index 000000000..b7a26f705 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug580884.js @@ -0,0 +1,8 @@ +// |jit-test| error: ReferenceError +for (let a in [0]) +a = e +for (let a in [0]) +(function () { + a +}) + diff --git a/js/src/jit-test/tests/jaeger/bug580931-2.js b/js/src/jit-test/tests/jaeger/bug580931-2.js new file mode 100644 index 000000000..9f18f57e0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug580931-2.js @@ -0,0 +1,4 @@ +// |jit-test| error: TypeError +x = 0 +'a'.replace(/a/, x.toLocaleString) + diff --git a/js/src/jit-test/tests/jaeger/bug581871.js b/js/src/jit-test/tests/jaeger/bug581871.js new file mode 100644 index 000000000..6b22dd596 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug581871.js @@ -0,0 +1,10 @@ +function test(p) { + var alwaysFalse = p && !p; + var k = []; + var g; + if (!alwaysFalse) { + k[0] = g = alwaysFalse ? "failure" : "success"; + return g; + } +} +assertEq(test("anything"), "success"); diff --git a/js/src/jit-test/tests/jaeger/bug581936.js b/js/src/jit-test/tests/jaeger/bug581936.js new file mode 100644 index 000000000..5b4e4f1e8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug581936.js @@ -0,0 +1,12 @@ +function returnZero() { return 0; } +function test() { + var a = "a"; + var b = "b"; + if (returnZero()) { + return a + b; + } else { + return b + a; + } +} +assertEq(test(), "ba"); + diff --git a/js/src/jit-test/tests/jaeger/bug582185.js b/js/src/jit-test/tests/jaeger/bug582185.js new file mode 100644 index 000000000..38d1c4219 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582185.js @@ -0,0 +1,3 @@ +let c = (this != 4.2); + +/* Don't assert. */ diff --git a/js/src/jit-test/tests/jaeger/bug582286.js b/js/src/jit-test/tests/jaeger/bug582286.js new file mode 100644 index 000000000..094366a3c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582286.js @@ -0,0 +1,3 @@ +evalcx("function s(){}",evalcx('lazy')) + + diff --git a/js/src/jit-test/tests/jaeger/bug582392.js b/js/src/jit-test/tests/jaeger/bug582392.js new file mode 100644 index 000000000..ad60d3f5b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582392.js @@ -0,0 +1,8 @@ +function cmp(x, y) { + if (x < y) + return -1; + if (x > y) + return 1; + return 0; +} +assertEq(cmp('true', 'false'), 1); diff --git a/js/src/jit-test/tests/jaeger/bug582880.js b/js/src/jit-test/tests/jaeger/bug582880.js new file mode 100644 index 000000000..9d77df1f5 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582880.js @@ -0,0 +1,8 @@ +x = (function() {}) +(function () { + function a() {} + a([7].some(gc)) +}()) + +/* Don't crash or assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug582882.js b/js/src/jit-test/tests/jaeger/bug582882.js new file mode 100644 index 000000000..2fafca5f4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582882.js @@ -0,0 +1,11 @@ +// |jit-test| error: ReferenceError +function f1(code) { + f = Function(code) + f2() +} +function f2() { + f() +} +f1("d=this.__defineGetter__(\"x\",gc)") +f1("b(x&=w);function b(){}") + diff --git a/js/src/jit-test/tests/jaeger/bug582884.js b/js/src/jit-test/tests/jaeger/bug582884.js new file mode 100644 index 000000000..3d5d9954e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582884.js @@ -0,0 +1,7 @@ +(function () { + x ^ x++ + var x +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug582894.js b/js/src/jit-test/tests/jaeger/bug582894.js new file mode 100644 index 000000000..1343da051 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582894.js @@ -0,0 +1,6 @@ +for each(let e in [0x40000000]) { + (0)[e] +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug582897.js b/js/src/jit-test/tests/jaeger/bug582897.js new file mode 100644 index 000000000..0c8dbc9b0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582897.js @@ -0,0 +1,7 @@ +{ + let x; + x + x-- +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug582898.js b/js/src/jit-test/tests/jaeger/bug582898.js new file mode 100644 index 000000000..7296b3d6e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582898.js @@ -0,0 +1,7 @@ +{ + let x = ""; + x++ + assertEq(x, 1); +} + +/* Test no assert. */ diff --git a/js/src/jit-test/tests/jaeger/bug582900.js b/js/src/jit-test/tests/jaeger/bug582900.js new file mode 100644 index 000000000..1da55397a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug582900.js @@ -0,0 +1,3 @@ +// |jit-test| error: ReferenceError + +[].x >>= a | 0 diff --git a/js/src/jit-test/tests/jaeger/bug583158.js b/js/src/jit-test/tests/jaeger/bug583158.js new file mode 100644 index 000000000..6d8c12448 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug583158.js @@ -0,0 +1,9 @@ +// |jit-test| error: ReferenceError +function g() { + var rv = (function() { + this << 1 + })() + if (a) (function() {}) +} +g() + diff --git a/js/src/jit-test/tests/jaeger/bug583160.js b/js/src/jit-test/tests/jaeger/bug583160.js new file mode 100644 index 000000000..928f588cd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug583160.js @@ -0,0 +1,10 @@ +(function() { + for (a in []) { + (function() {}) + ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +h.I]) + } +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug583672.js b/js/src/jit-test/tests/jaeger/bug583672.js new file mode 100644 index 000000000..6280fa470 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug583672.js @@ -0,0 +1,30 @@ +(function () { + function f() + { + this.y = w + this.y = (void 0) + Object + } + for (a in [0, 0, 0, 0]) + { + new f + } + var w = {} +})() + +/* Make sure that MICs don't have the same bug. */ +x = Object(); +(function () { + function f() + { + x = w + x = (void 0) + Object + } + for (a in [0, 0, 0, 0]) + { + new f + } + var w = {} +})() +/* Don't assert. */ diff --git a/js/src/jit-test/tests/jaeger/bug583688.js b/js/src/jit-test/tests/jaeger/bug583688.js new file mode 100644 index 000000000..c13f61602 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug583688.js @@ -0,0 +1,10 @@ +// |jit-test| error: ReferenceError +this.__defineSetter__("x", function () {}) +try { + this.__defineGetter__("d", (Function("x"))) +} catch (e) {} +d +print(delete x) +throw d + + diff --git a/js/src/jit-test/tests/jaeger/bug583689.js b/js/src/jit-test/tests/jaeger/bug583689.js new file mode 100644 index 000000000..edb3248ea --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug583689.js @@ -0,0 +1,7 @@ +function f() { + if (-[]) delete y +} +for (c in [0, 0, 0, 0]) { + new f +} + diff --git a/js/src/jit-test/tests/jaeger/bug584644-2.js b/js/src/jit-test/tests/jaeger/bug584644-2.js new file mode 100644 index 000000000..0faddd5f5 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug584644-2.js @@ -0,0 +1,7 @@ +this.__defineSetter__("x", function(v) { return /a/.exec(v); }) +Function("\ + for each(w in[0,0,0]) {\ + for each(y in[0,0,0,0,0,0,0,0,x,0,0,0,0,0,0,0,0,0,x,0,0,0,0,0,0,0,x]) {}\ + }\ +")() + diff --git a/js/src/jit-test/tests/jaeger/bug584646.js b/js/src/jit-test/tests/jaeger/bug584646.js new file mode 100644 index 000000000..566739245 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug584646.js @@ -0,0 +1,7 @@ +switch (0) { + case 2: + k; + case (-1): + case 2: +} +/* Don't assert. */ diff --git a/js/src/jit-test/tests/jaeger/bug584647.js b/js/src/jit-test/tests/jaeger/bug584647.js new file mode 100644 index 000000000..7f0e65984 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug584647.js @@ -0,0 +1,2 @@ +(function(){for(j=0;j<3;++j)NaN=42})(); +assertEq(NaN != NaN, true); diff --git a/js/src/jit-test/tests/jaeger/bug585310.js b/js/src/jit-test/tests/jaeger/bug585310.js new file mode 100644 index 000000000..0f65c9131 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585310.js @@ -0,0 +1,19 @@ +gczeal(2) +try { + (function () { + for each(l in [0, 0, 0]) { + print(''.replace(function () {})) + } + })() +} catch (e) {} + +x = gczeal(2) +try { + (function () { + for each(d in [x, x, x]) { + 'a'.replace(/a/, function () {}) + } + })() +} catch (e) {} + +/* Don't assert or segfault. Tests PIC resetting. */ diff --git a/js/src/jit-test/tests/jaeger/bug585341.js b/js/src/jit-test/tests/jaeger/bug585341.js new file mode 100644 index 000000000..7c192029b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585341.js @@ -0,0 +1,6 @@ +this.__defineGetter__("x", () => new Float64Array()) +Function("\ + with(this) {\ + eval(\"x\")\ + }\ +")() diff --git a/js/src/jit-test/tests/jaeger/bug585391.js b/js/src/jit-test/tests/jaeger/bug585391.js new file mode 100644 index 000000000..28f969cf1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585391.js @@ -0,0 +1,11 @@ +var x = (function () { + return [, , ] +}()); +(function () { + while (x > 7 & 0) { + return + } +}()) + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug585408-2.js b/js/src/jit-test/tests/jaeger/bug585408-2.js new file mode 100644 index 000000000..b77f1a984 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585408-2.js @@ -0,0 +1,6 @@ +for (let c in []) { + c << c++ +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug585408-3.js b/js/src/jit-test/tests/jaeger/bug585408-3.js new file mode 100644 index 000000000..9359abad8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585408-3.js @@ -0,0 +1,7 @@ +(function() { + function a() {} + a > a-- +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug585408.js b/js/src/jit-test/tests/jaeger/bug585408.js new file mode 100644 index 000000000..118f219e3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585408.js @@ -0,0 +1,7 @@ +(function() { + function a() {} + a.e = a++ +})() + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug585540.js b/js/src/jit-test/tests/jaeger/bug585540.js new file mode 100644 index 000000000..0fae459e0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug585540.js @@ -0,0 +1,13 @@ +try { + (function () { + gczeal(2)() + })() +} catch (e) {} +(function () { + for (y in [/x/, Boolean, Boolean, 0, Boolean]) { + [Math.floor(this)].some(function () {}) + } +})() + +/* Don't crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug587431.js b/js/src/jit-test/tests/jaeger/bug587431.js new file mode 100644 index 000000000..bfad85776 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug587431.js @@ -0,0 +1,29 @@ +function g() { + var UPPER_MASK = 2147483648 + var mt = new Array + function f1(n1) { + return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK: n1 + } + function f2(n1, n2) { + return f1(n1 + n2 & 4294967295) + } + function f3(n1, n2) { + var sum + for (var i = 0; i < 32; ++i) { + sum = f2(sum, f1(n2 << i)) + } + return sum + } + this.init_genrand = function(s) { + mt[0] = f1(s & 96295) + for (mti = 1; mti < 6; mti++) { + mt[mti] = f2(f3(3, f1(mt[mti - 1] ^ mt[1] > 0)), mti) + } + } +} (function() { + var fuzzMT = new g; + fuzzMT.init_genrand(54) +} ()) + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug588338.js b/js/src/jit-test/tests/jaeger/bug588338.js new file mode 100644 index 000000000..457be238a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588338.js @@ -0,0 +1,16 @@ +// |jit-test| error: is not a function +function f() { + (e) +} +(x = new Proxy(Function, (function(x) { + return { + get: function(r, b) { + return x[b] + } + } +})(/x/))) +for (z = 0; z < 100; x.unwatch(), z++) +for (e in [0]) { + gczeal(2) +} ( [1,2,3])("") + diff --git a/js/src/jit-test/tests/jaeger/bug588362-1.js b/js/src/jit-test/tests/jaeger/bug588362-1.js new file mode 100644 index 000000000..4949c92f6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588362-1.js @@ -0,0 +1,8 @@ +for (a = 0; a < 13; a++) { + (function e() { + yield eval() + }()) +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug588362-2.js b/js/src/jit-test/tests/jaeger/bug588362-2.js new file mode 100644 index 000000000..4e549867d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588362-2.js @@ -0,0 +1,10 @@ +for (a = 0; a < 13; a++) { + (function n() { + with({}) { + yield + } + } ()) +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug588362-3.js b/js/src/jit-test/tests/jaeger/bug588362-3.js new file mode 100644 index 000000000..360399ea6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588362-3.js @@ -0,0 +1,10 @@ +for (a = 0; a < 13; a++) { + (function n() { { + function s() {} + } + yield[]; + }()); +} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug588363-1.js b/js/src/jit-test/tests/jaeger/bug588363-1.js new file mode 100644 index 000000000..6fca00dd8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588363-1.js @@ -0,0 +1,6 @@ +// |jit-test| +({eval} = Object.defineProperty(evalcx("lazy"), "", {})) +eval("eval(/x/)", []) + +/* Don't assert or crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug588363-2.js b/js/src/jit-test/tests/jaeger/bug588363-2.js new file mode 100644 index 000000000..5550be3ea --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug588363-2.js @@ -0,0 +1,7 @@ +with(evalcx('')) { + delete eval; + eval("x", this.__defineGetter__("x", Function)); +} + +/* Don't assert or crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug589108.js b/js/src/jit-test/tests/jaeger/bug589108.js new file mode 100644 index 000000000..e1835ea20 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug589108.js @@ -0,0 +1,10 @@ +try { + var x + for (x in [x]) + gczeal(2) + new NaN +} catch(e) {} +(function() { + for (a in [Boolean(), x.t]) {} +} (function() {})) + diff --git a/js/src/jit-test/tests/jaeger/bug589115.js b/js/src/jit-test/tests/jaeger/bug589115.js new file mode 100644 index 000000000..32a6bebbc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug589115.js @@ -0,0 +1,6 @@ +for each(y in ['', 0, '']) { + y.lastIndexOf-- +} + +/* Don't assert/crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug589461.js b/js/src/jit-test/tests/jaeger/bug589461.js new file mode 100644 index 000000000..89fc7acad --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug589461.js @@ -0,0 +1,7 @@ +function f(h, i, Q) { + var L = Q; + var H = h; + + return h[i] * L ^ L * 0x1010100; +} +assertEq(f([6], 0, 12345), 1768429654); diff --git a/js/src/jit-test/tests/jaeger/bug590083.js b/js/src/jit-test/tests/jaeger/bug590083.js new file mode 100644 index 000000000..c11c7a137 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug590083.js @@ -0,0 +1,11 @@ +eval("\ + (function(){\ + for(var w in [0]) {\ + function w(){}\ + print(w)\ + }\ + })\ +")() + +/* Don't crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug591606.js b/js/src/jit-test/tests/jaeger/bug591606.js new file mode 100644 index 000000000..cb711f0bd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug591606.js @@ -0,0 +1,5 @@ +var c = [] +function c() {} + +/* Don't assert. */ + diff --git a/js/src/jit-test/tests/jaeger/bug592973-1.js b/js/src/jit-test/tests/jaeger/bug592973-1.js new file mode 100644 index 000000000..d3bafac62 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug592973-1.js @@ -0,0 +1,12 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: +function f(x) { + if (x) { + let y; + y = 12; + (function () { + assertEq(y, 12); + })(); + } +} +f(1); + diff --git a/js/src/jit-test/tests/jaeger/bug592973-2.js b/js/src/jit-test/tests/jaeger/bug592973-2.js new file mode 100644 index 000000000..052c62268 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug592973-2.js @@ -0,0 +1,7 @@ +function f(a) { + function a() { + } +} + +/* Don't assert on JOF_NAME test in BindNameToSlot(). */ + diff --git a/js/src/jit-test/tests/jaeger/bug592973-3.js b/js/src/jit-test/tests/jaeger/bug592973-3.js new file mode 100644 index 000000000..541c39981 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug592973-3.js @@ -0,0 +1,8 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: +function f([a, b, c, d]) { + a = b; + return function () { return a + b + c + d; }; +} + +var F = f(["a", "b", "c", "d"]); +assertEq(F(), "bbcd"); diff --git a/js/src/jit-test/tests/jaeger/bug593554.js b/js/src/jit-test/tests/jaeger/bug593554.js new file mode 100644 index 000000000..20143da84 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug593554.js @@ -0,0 +1,8 @@ +/* Don't assert. */ +var b = 7; +var a = []; +for (var j = 0; j < 7; ++j) { + var d = {}; + a.push(b >> d); +} +assertEq(a.toString(), '7,7,7,7,7,7,7'); diff --git a/js/src/jit-test/tests/jaeger/bug595917.js b/js/src/jit-test/tests/jaeger/bug595917.js new file mode 100644 index 000000000..1b3e13295 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug595917.js @@ -0,0 +1,4 @@ +if (!this.parseInt) { + var parseInt = function () { return 5; } +} +assertEq(parseInt(10), 10); diff --git a/js/src/jit-test/tests/jaeger/bug595921.js b/js/src/jit-test/tests/jaeger/bug595921.js new file mode 100644 index 000000000..7f4933a21 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug595921.js @@ -0,0 +1,9 @@ +/* Don't assert. */ +x = [1,2,3] +function f(aaa) { + aaa.e = x +} +for each(let c in [x, x, x]) { + f(c) +} +assertEq(0,0); diff --git a/js/src/jit-test/tests/jaeger/bug597378.js b/js/src/jit-test/tests/jaeger/bug597378.js new file mode 100644 index 000000000..c766407ab --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug597378.js @@ -0,0 +1,12 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: +function f(a, b) { + var o = a; + var q = b; + var p; + do { } while (0); + p = o; + q = p + 1 < q ? p + 1 : 0; + assertEq(q, 0); +} +f(3, 4); + diff --git a/js/src/jit-test/tests/jaeger/bug597871.js b/js/src/jit-test/tests/jaeger/bug597871.js new file mode 100644 index 000000000..a0bb26169 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug597871.js @@ -0,0 +1,8 @@ +for (a in [0, 0, 0, 0, 0, 0, 0, 0, 0]) { + try { (function() { + for each(l in [false, 0, 0, 0]) {} + h + })() + } catch(e) {} +} + diff --git a/js/src/jit-test/tests/jaeger/bug598696.js b/js/src/jit-test/tests/jaeger/bug598696.js new file mode 100644 index 000000000..129275d2a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug598696.js @@ -0,0 +1,6 @@ +function f() { + eval(); + var i = 0; + assertEq(++i, 1); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug599488.js b/js/src/jit-test/tests/jaeger/bug599488.js new file mode 100644 index 000000000..f2cf95209 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug599488.js @@ -0,0 +1,9 @@ +/* Don't crash. */ +function foo(y) { + var x = y; + if (x != x) + return true; + return false; +} +assertEq(foo("three"), false); +assertEq(foo(NaN), true); diff --git a/js/src/jit-test/tests/jaeger/bug600139.js b/js/src/jit-test/tests/jaeger/bug600139.js new file mode 100644 index 000000000..61fa7283a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug600139.js @@ -0,0 +1,10 @@ +// |jit-test| error: ReferenceError +// vim: set ts=8 sts=4 et sw=4 tw=99: +function f(a, b, c) { + if (!a.__SSi) { + throw Components.returnCode = Cr.NS_ERROR_INVALID_ARG; + } + this.restoreWindow(a, b, c); + eval(); +} +f(1, 2, 3); diff --git a/js/src/jit-test/tests/jaeger/bug600419.js b/js/src/jit-test/tests/jaeger/bug600419.js new file mode 100644 index 000000000..981a6a17c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug600419.js @@ -0,0 +1,5 @@ +/* Don't assert. */ +(function() { + var x; + [1].map(function(){}, x << x); +})() diff --git a/js/src/jit-test/tests/jaeger/bug600424.js b/js/src/jit-test/tests/jaeger/bug600424.js new file mode 100644 index 000000000..e59a06614 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug600424.js @@ -0,0 +1,14 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: +function f(a) { + var x = { + g: function () { + return this.a; + } + }; + x.g.prototype.a = a; + assertEq(x.g.prototype.a, a); + return x; +} +f(1); +f(2); +f(3); diff --git a/js/src/jit-test/tests/jaeger/bug601982.js b/js/src/jit-test/tests/jaeger/bug601982.js new file mode 100644 index 000000000..99f4bf906 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug601982.js @@ -0,0 +1,33 @@ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ + +function J(i) { + /* Cause a branch to build(?) */ + if (i % 3) + [1,2,3] +} + +function h(i) { + J(i); + + /* Generate a safe point in the method JIT. */ + if (1 == 14) { eval(); } + + return J(i); +} + +function g(i) { + /* Method JIT will try to remove this frame(?) */ + if (i == 14) { with ({}); } + return h(i); +} + +function f() { + for (var i = 0; i < 9 * 2; i++) { + g(i); + } +} + +f(); + +/* Don't crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug604381.js b/js/src/jit-test/tests/jaeger/bug604381.js new file mode 100644 index 000000000..3ca01cb36 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug604381.js @@ -0,0 +1,14 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function F() { + var T = { }; + try { + throw 12; + } catch (e) { + T.x = 5; + return T; + } +} + +assertEq((new F()).x, 5); + diff --git a/js/src/jit-test/tests/jaeger/bug604427.js b/js/src/jit-test/tests/jaeger/bug604427.js new file mode 100644 index 000000000..1e37df869 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug604427.js @@ -0,0 +1,6 @@ + +function testInt(x) { + var a = x|0; + return (a !== a); +} +assertEq(testInt(10), false); diff --git a/js/src/jit-test/tests/jaeger/bug606662-2.js b/js/src/jit-test/tests/jaeger/bug606662-2.js new file mode 100644 index 000000000..dc38cbb33 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug606662-2.js @@ -0,0 +1,5 @@ +// don't crash +try{a()}catch(e){} +try{for(e in((JSON.e)(x=/x/)))throw []}catch(e){} +try{(function(){c()})()}catch(e){} +try{new function(){}}catch(e){} diff --git a/js/src/jit-test/tests/jaeger/bug606829.js b/js/src/jit-test/tests/jaeger/bug606829.js new file mode 100644 index 000000000..1839c93d2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug606829.js @@ -0,0 +1,8 @@ +/* Don't assert. */ +function f(x) +{ + if ("hi" == (x & 3)) { + return 1; + } +} +f(12); diff --git a/js/src/jit-test/tests/jaeger/bug610652.js b/js/src/jit-test/tests/jaeger/bug610652.js new file mode 100644 index 000000000..b5c64d193 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug610652.js @@ -0,0 +1,5 @@ +function a1(a2) { + return 10 - a2; +} +a3 = a1(-2147483648); +assertEq(a3, 2147483658); diff --git a/js/src/jit-test/tests/jaeger/bug615440.js b/js/src/jit-test/tests/jaeger/bug615440.js new file mode 100644 index 000000000..1ed4cd1c0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug615440.js @@ -0,0 +1,5 @@ +Array.prototype.__proto__ = null; +for (var r = 0; r < 3; ++r) [][0] = 1; + +// Don't crash. + diff --git a/js/src/jit-test/tests/jaeger/bug616508.js b/js/src/jit-test/tests/jaeger/bug616508.js new file mode 100644 index 000000000..d29bf75f9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug616508.js @@ -0,0 +1,14 @@ +// |jit-test| error: ReferenceError +// vim: set ts=8 sts=4 et sw=4 tw=99: + +// Note: modified from original test, which used Uint32Array in place of Array, +// because the behavior has changed in a way that this will throw a TypeError +// before it gets to testing what used to crash. I have no idea whether this +// would actually crash the original version it was written for. +try { + (function () { + __proto__ = Array() + }()) +} catch (e) {}(function () { + length, ([eval()] ? x : 7) +})() diff --git a/js/src/jit-test/tests/jaeger/bug617433.js b/js/src/jit-test/tests/jaeger/bug617433.js new file mode 100644 index 000000000..768f5a414 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617433.js @@ -0,0 +1,12 @@ +// don't crash + +function foo(x) { + (x >>> 3.14); + (x >>> true); + (x >>> (0/0)); + (x >>> 100); + (x >>> -10); + (x >>> (1/0)); + (x >>> (void 0)); +} +foo(10); diff --git a/js/src/jit-test/tests/jaeger/bug617440.js b/js/src/jit-test/tests/jaeger/bug617440.js new file mode 100644 index 000000000..48311e761 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617440.js @@ -0,0 +1,11 @@ + +function f() { + var x = 1.23; + function g() { + var y = x++; + assertEq(y, 1.23); + } + g(); + assertEq(x, 2.23); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug617458.js b/js/src/jit-test/tests/jaeger/bug617458.js new file mode 100644 index 000000000..1dc9b2f87 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617458.js @@ -0,0 +1,6 @@ + +function f(x) { + var a = 4 | x; + a = +a; +} +f(10); diff --git a/js/src/jit-test/tests/jaeger/bug617460.js b/js/src/jit-test/tests/jaeger/bug617460.js new file mode 100644 index 000000000..5b9f7662f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617460.js @@ -0,0 +1,10 @@ + +function f() { + var x = NaN; + if (2 > 0) {} + var y = {}; + var z = (1234 - x); + y.foo = z; + assertEq(x, NaN); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug617549.js b/js/src/jit-test/tests/jaeger/bug617549.js new file mode 100644 index 000000000..a48e80f3c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617549.js @@ -0,0 +1,9 @@ + +function f() { + var a, b, c; + a = -c; + b = c & 2; + a = b; + a = 123 * a; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug617558.js b/js/src/jit-test/tests/jaeger/bug617558.js new file mode 100644 index 000000000..1bbd30f21 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617558.js @@ -0,0 +1,7 @@ + +Array.prototype.__proto__ = Function.prototype; +var x = [1,2,3]; +x[0]; + +[].__proto__.foo = true; +eval("[]"); diff --git a/js/src/jit-test/tests/jaeger/bug617624.js b/js/src/jit-test/tests/jaeger/bug617624.js new file mode 100644 index 000000000..ebf1e661e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug617624.js @@ -0,0 +1,7 @@ + +function f() { + var x; + var a = x; + Boolean(a = Number(12.34)); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug618007.js b/js/src/jit-test/tests/jaeger/bug618007.js new file mode 100644 index 000000000..daa43e504 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug618007.js @@ -0,0 +1,31 @@ +var appendToActual = function(s) { + actual += s + ','; +} + +for(var z=0; z < 3; z++) { + function ff() { + } + ff(); + + // jit-test/tests/closures/setname-closure.js + actual = ''; + expected = '2,4,8,16,32,undefined,64,128,256,512,1024,undefined,2048,4096,8192,16384,32768,undefined,65536,131072,262144,524288,1048576,undefined,2097152,4194304,8388608,16777216,33554432,undefined,'; + + var f = function() { + var p = 1; + function g() { + for (var i = 0; i < 5; ++i) { + p = p * 2; + appendToActual(p); + } + } + return g; + } + var g = f(); + for (var i = 0; i < 5; ++i) { + g(); + appendToActual(); + } + assertEq(actual, expected); +} + diff --git a/js/src/jit-test/tests/jaeger/bug618849.js b/js/src/jit-test/tests/jaeger/bug618849.js new file mode 100644 index 000000000..0df67a069 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug618849.js @@ -0,0 +1,11 @@ + +function f() { + function g() { + var b = x; + var c = b++ & b; + return c; + } + var x = x--; + return g(); +} +assertEq(f(), 0); diff --git a/js/src/jit-test/tests/jaeger/bug618850.js b/js/src/jit-test/tests/jaeger/bug618850.js new file mode 100644 index 000000000..8c423d87b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug618850.js @@ -0,0 +1,6 @@ +function f() { + var x = false; + NaN ? x = Math.floor() : x = Math.ceil(); + return x * 12345; +} +assertEq(f(), NaN); diff --git a/js/src/jit-test/tests/jaeger/bug618863.js b/js/src/jit-test/tests/jaeger/bug618863.js new file mode 100644 index 000000000..939336119 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug618863.js @@ -0,0 +1,23 @@ +function f() { + for(var i=0; i<3; i++) { + var x = -i / 100; + assertEq(x * -100, i); + } +} +f(); + +function g() { + for (var i = 0; i < 2; i++) { + var a = i ? true : false; + var x = -a / 100; + assertEq(x * -100, i); + } +} +g(); + +function h() { + for (var i = 0; i < 20; i++) + var x = (0x7ffffff4 + i) / 100; + assertEq(x, 21474836.55); +} +h(); diff --git a/js/src/jit-test/tests/jaeger/bug619339.js b/js/src/jit-test/tests/jaeger/bug619339.js new file mode 100644 index 000000000..2445d24fc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug619339.js @@ -0,0 +1,3 @@ + +var a; +assertEq(true && 1.1 + a, NaN); diff --git a/js/src/jit-test/tests/jaeger/bug619433-1.js b/js/src/jit-test/tests/jaeger/bug619433-1.js new file mode 100644 index 000000000..8ffb23838 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug619433-1.js @@ -0,0 +1,22 @@ + +/* Test compiling JSOP_STRICTEQ on known doubles. */ + +function foo(x) { + return x === x; +} + +for (var i = 0; i < 20; i++) { + assertEq(foo(1.2), true); + assertEq(foo(NaN), false); +} + +function bar(x) { + if (x === x) + return true; + return false; +} + +for (var i = 0; i < 20; i++) { + assertEq(bar(1.2), true); + assertEq(bar(NaN), false); +} diff --git a/js/src/jit-test/tests/jaeger/bug619433-2.js b/js/src/jit-test/tests/jaeger/bug619433-2.js new file mode 100644 index 000000000..947557da3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug619433-2.js @@ -0,0 +1,10 @@ + +function foo(x) { + var y = 2.5; + y = -x; + var z = [1,2,y]; + return x + 5; +} +for (var i = 0; i < 20; i++) + foo(i); +assertEq(foo(20), 25); diff --git a/js/src/jit-test/tests/jaeger/bug620643.js b/js/src/jit-test/tests/jaeger/bug620643.js new file mode 100644 index 000000000..fcb096e95 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug620643.js @@ -0,0 +1 @@ +var a = new Int32Array(); +(a[0]={}); diff --git a/js/src/jit-test/tests/jaeger/bug621522.js b/js/src/jit-test/tests/jaeger/bug621522.js new file mode 100644 index 000000000..a952502d8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug621522.js @@ -0,0 +1,14 @@ + +/* Don't crash. */ +function f() { + var x; + x.a; + x = {}; +} + +try { + f(); + assertEq(0, 1); +} catch(e) { + +} diff --git a/js/src/jit-test/tests/jaeger/bug621655.js b/js/src/jit-test/tests/jaeger/bug621655.js new file mode 100644 index 000000000..5b14df90b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug621655.js @@ -0,0 +1,10 @@ +/* Don't assert. */ +for(p in 0.3) { } + +Number.prototype.foo = function() {} +var arr = []; + +for(p in 1.2) { + arr.push(p); +} +assertEq(arr[0], "foo"); diff --git a/js/src/jit-test/tests/jaeger/bug623474.js b/js/src/jit-test/tests/jaeger/bug623474.js new file mode 100644 index 000000000..bda90883e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug623474.js @@ -0,0 +1,10 @@ +for (var j=0;j<2;++j) { (function(o){o.length})(String.prototype); } + +for each(let y in [Number, Number]) { + try { + "".length() + } catch(e) {} +} + +/* Don't crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug624100.js b/js/src/jit-test/tests/jaeger/bug624100.js new file mode 100644 index 000000000..744ca0187 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug624100.js @@ -0,0 +1,2 @@ +// |jit-test| error: ReferenceError +eval("'use strict'; for(let j=0;j<9;++j) {} x;"); diff --git a/js/src/jit-test/tests/jaeger/bug624483.js b/js/src/jit-test/tests/jaeger/bug624483.js new file mode 100644 index 000000000..480e53914 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug624483.js @@ -0,0 +1,5 @@ +var arr = new Uint8ClampedArray(16); +for (var i = 0; i < 16; i++) { + arr[i] = "Infinity"; +} +assertEq(arr[14], 255); diff --git a/js/src/jit-test/tests/jaeger/bug625157.js b/js/src/jit-test/tests/jaeger/bug625157.js new file mode 100644 index 000000000..53bed4e68 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625157.js @@ -0,0 +1,16 @@ +function f() { + { + function g() { + var a = []; + for (var i = 0; i < 10; i++) + a.push({}); + for (var i = 0; i < 10; i++) + a[i].m = function() { return 0; } + assertEq(a[8].m !== a[9].m, true); + } + g(); + } +} +f() + + diff --git a/js/src/jit-test/tests/jaeger/bug625377.js b/js/src/jit-test/tests/jaeger/bug625377.js new file mode 100644 index 000000000..4c7893938 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625377.js @@ -0,0 +1,13 @@ +x = [] +for(var i=0; i<3; i++) { + var obj = { first: "first", second: "second" }; + var count = 0; + for (var elem in obj) { + delete obj.second; + count++; + } + x.push(count); +} +assertEq(x[0], 1); +assertEq(x[1], 1); +assertEq(x[2], 1); diff --git a/js/src/jit-test/tests/jaeger/bug625438.js b/js/src/jit-test/tests/jaeger/bug625438.js new file mode 100644 index 000000000..32586d8ab --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625438.js @@ -0,0 +1,10 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +var count = 0; +this.watch("x", function() { + count++; +}); +for(var i=0; i<10; i++) { + x = 2; +} +assertEq(count, 10); diff --git a/js/src/jit-test/tests/jaeger/bug625718-1.js b/js/src/jit-test/tests/jaeger/bug625718-1.js new file mode 100644 index 000000000..601c2a8e6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625718-1.js @@ -0,0 +1,12 @@ +function f3() { return 2; }; +function f4(o) { o.g4 = function() {}; }; + +var f = function() {}; +f.x = undefined; +f4(new String("x")); +f3(); +f4(f); + +for(var i=0; i<20; i++) { + f4(Math); +} diff --git a/js/src/jit-test/tests/jaeger/bug625718-2.js b/js/src/jit-test/tests/jaeger/bug625718-2.js new file mode 100644 index 000000000..029819519 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625718-2.js @@ -0,0 +1,14 @@ +var o3 = new String("foobarbaz"); +var o10 = Math; +var o11 = function() {}; + +function f3(o) { return o; }; +function f4(o) { o.g4 = function() {}; }; + +for(var i=0; i<20; i++) { + o11[3] = undefined; + f4(o3); + f3(o3); + f4(o11); + f4(o10); +} diff --git a/js/src/jit-test/tests/jaeger/bug625718-3.js b/js/src/jit-test/tests/jaeger/bug625718-3.js new file mode 100644 index 000000000..81e788143 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625718-3.js @@ -0,0 +1,52 @@ +var o0 = []; +var o1 = new String("foobarbaz"); +var o2 = {}; +var o3 = new String("foobarbaz"); +var o4 = {}; +var o5 = Math; +var o6 = {}; +var o7 = new String("foobarbaz"); +var o8 = new String("foobarbaz"); +var o9 = Math; +var o10 = Math; +var o11 = function() {}; +var o12 = {}; +var o13 = new String("foobarbaz"); +var o14 = {}; + +function f1(o) { return o.length;}; +function f2(o) { o.g2 = function() {};}; +function f3(o) { return o.g10;}; +function f4(o) { o.g4 = function() {};}; +function f5(o) { return o == o14;}; +function f6(o) { o[3] = o;}; +function f7(o) { o[3] = undefined;}; +function f8(o) { o[3] = undefined;}; +function f9(o) { return o.length;}; +function f10(o) { return o.__proto__; }; + +for(var i=0; i<20; i++) { + f9(o11); + f6(o0); + f2(o1); + f2(o6); + f7(o6); + f8(o11); + f2(o5); + f7(o9); + f7(o12); + f6(o4); + f5(o1); + f4(o1); + f8(o8); + f6(o5); + f2(o0); + f10(o7); + f3(o3); + f4(o1); + f9(o3); + f4(o11); + f4(o0); + f2(o4); + f4(o10); +} diff --git a/js/src/jit-test/tests/jaeger/bug625757.js b/js/src/jit-test/tests/jaeger/bug625757.js new file mode 100644 index 000000000..458c1604a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug625757.js @@ -0,0 +1,4 @@ +for(var i=0; i<20; i++) { + var x = 5e-324; +} +/* Don't crash. */ diff --git a/js/src/jit-test/tests/jaeger/bug627486.js b/js/src/jit-test/tests/jaeger/bug627486.js new file mode 100644 index 000000000..7acc3b01e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug627486.js @@ -0,0 +1,23 @@ +// |jit-test| error: TypeError +// vim: set ts=8 sts=4 et sw=4 tw=99: +g = undefined; +function L() { } + +function h() { + with (h) { } + for (var i = 0; i < 10; i++) + g(); +} + +function f(x) { + g = x; +} + +f(L); +h(); +f(L); +f(2); +h(); + +/* Don't assert/crash. */ + diff --git a/js/src/jit-test/tests/jaeger/bug630366.js b/js/src/jit-test/tests/jaeger/bug630366.js new file mode 100644 index 000000000..acac8d3ef --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug630366.js @@ -0,0 +1,7 @@ +var o = {}; +for(var i=0; i<5; i++) { + o.p = 2; + o.watch("p", function() { }); + o.p = 2; + delete o.p; +} diff --git a/js/src/jit-test/tests/jaeger/bug639459.js b/js/src/jit-test/tests/jaeger/bug639459.js new file mode 100644 index 000000000..035952e81 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639459.js @@ -0,0 +1,6 @@ +function f() { + var a = [].length; + return a / a; +} +assertEq(f(), NaN); + diff --git a/js/src/jit-test/tests/jaeger/bug639478-1.js b/js/src/jit-test/tests/jaeger/bug639478-1.js new file mode 100644 index 000000000..a0f2fd37e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639478-1.js @@ -0,0 +1,5 @@ + +function f(x) { + return (x % 123.45) >> x; +} +assertEq(f(-123), -4); diff --git a/js/src/jit-test/tests/jaeger/bug639478-2.js b/js/src/jit-test/tests/jaeger/bug639478-2.js new file mode 100644 index 000000000..3412dfa3e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639478-2.js @@ -0,0 +1,12 @@ +var y; +function f() { + for(var _ in [3.14]) { + y = 3.14; + y = y ^ y; + return y; + + function g() { + } + } +} +assertEq(f(), 0); diff --git a/js/src/jit-test/tests/jaeger/bug639587.js b/js/src/jit-test/tests/jaeger/bug639587.js new file mode 100644 index 000000000..462c11846 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639587.js @@ -0,0 +1,8 @@ +/* Don't assert. */ + +function f(o) { + o == 1; + if (o == 2) {} +} +for (var i = 0; i < 20; i++) + f(3.14); diff --git a/js/src/jit-test/tests/jaeger/bug639792.js b/js/src/jit-test/tests/jaeger/bug639792.js new file mode 100644 index 000000000..601f047ae --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639792.js @@ -0,0 +1,8 @@ + +for(var i=0; i<20; i++) { + function f(){}; + x = -1; + x = x % 1; + assertEq(x, -0); +} + diff --git a/js/src/jit-test/tests/jaeger/bug639808.js b/js/src/jit-test/tests/jaeger/bug639808.js new file mode 100644 index 000000000..bf6b16c3d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug639808.js @@ -0,0 +1,16 @@ +function f() { + var x = 1.23; + var y = [].length; + x = ++y; + y - 1; +} +f(); + +function g(q) { + var x = 1.23; + var y = [].length; + x = ++y; + if (q) + assertEq(y + 5, 6); +} +g(1); diff --git a/js/src/jit-test/tests/jaeger/bug640098.js b/js/src/jit-test/tests/jaeger/bug640098.js new file mode 100644 index 000000000..b037df8a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug640098.js @@ -0,0 +1,15 @@ + +eval("(function(){({6953421313:0})})")(); + +function f() { + var x = {6953421313: 123}; + assertEq(x[6953421313], 123); + + x[6953421313] = "a"; + assertEq(x[6953421313], "a"); + + var y = {3.3: true}; + assertEq(y[3.3], true); +} +f(); + diff --git a/js/src/jit-test/tests/jaeger/bug640102.js b/js/src/jit-test/tests/jaeger/bug640102.js new file mode 100644 index 000000000..e3ad9fbc0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug640102.js @@ -0,0 +1,3 @@ +try { + eval("v>>([]=x)") +} catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/bug640614.js b/js/src/jit-test/tests/jaeger/bug640614.js new file mode 100644 index 000000000..f17ba2719 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug640614.js @@ -0,0 +1,5 @@ +function f(x) { + x = 2 ^ x++; + if (x) {} +} +f(1.1); diff --git a/js/src/jit-test/tests/jaeger/bug642198.js b/js/src/jit-test/tests/jaeger/bug642198.js new file mode 100644 index 000000000..dec6e7294 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug642198.js @@ -0,0 +1,9 @@ + +function test() { + for(var e=1.2; true; e=20.2) { + if (e > 10) + break; + } +} +test(); + diff --git a/js/src/jit-test/tests/jaeger/bug643653-1.js b/js/src/jit-test/tests/jaeger/bug643653-1.js new file mode 100644 index 000000000..7900f8ddd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug643653-1.js @@ -0,0 +1,10 @@ +function f(x) { + var a; + var b = [1].length; + var c = x; + var d = b + 1; + AA = x; + a = d; + assertEq(b + d, 3); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug643653-2.js b/js/src/jit-test/tests/jaeger/bug643653-2.js new file mode 100644 index 000000000..aea6896f1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug643653-2.js @@ -0,0 +1,58 @@ +var HEAP, IHEAP, FHEAP; +var TOTAL_MEMORY = 50 * 1024 * 1024; +HEAP = IHEAP = new Int32Array(TOTAL_MEMORY); +STACK_ROOT = STACKTOP = undefined; +var _rng; +var __str2; +var __str3; +{ + var __stackBase__ = STACKTOP; + var $n; + var $tmp5 = __stackBase__ + 12; + var $tmp6 = $n; + var $mul7 = ($tmp6) * 3; + $this_addr_i23 = $tmp5; + $id_addr_i = __str2; + $desc_addr_i = __str3; + $N_addr_i = $mul7; + var $this1_i24 = $this_addr_i23; + var $tmp_i25 = $id_addr_i; + var $tmp2_i = $desc_addr_i; + var $tmp3_i = $N_addr_i; + __Z9makeFastaI10RandomizedEvPKcS2_jRT_($tmp_i25, $tmp2_i, $tmp3_i, $this1_i24); +} +function __Z9makeFastaI10RandomizedEvPKcS2_jRT_($id, $desc, $N, $output) +{ + $output_addr = $output; + var $tmp4 = $output_addr; + $this_addr_i = $tmp4; + var $this1_i = $this_addr_i; + var $table_i = $this1_i; + var $call_i = __ZN10LineBuffer7genrandER10Cumulativej(0, $table_i, 0); +} +function __ZN10LineBuffer7genrandER10Cumulativej($this, $table, $N) +{ + var $this_addr_i1; + var $pct_addr_i; + $table_addr = $table; + var $tmp3 = $table_addr; + $this_addr_i = _rng; + $max_addr_i = 1; + var $this1_i = $this_addr_i; + var $last_i = $this1_i; + var $tmp_i = IHEAP[$last_i]; + var $mul_i = ($tmp_i) * 3877; + var $add_i = ($mul_i) + 29573; + var $rem_i = ($add_i) % 139968; + var $last2_i = $this1_i; + IHEAP[$last2_i] = $rem_i; + var $tmp3_i = $max_addr_i; + var $last4_i = $this1_i; + var $tmp5_i = IHEAP[$last4_i]; + var $conv_i = ($tmp5_i); + var $mul6_i = ($tmp3_i) * ($conv_i); + var $div_i = ($mul6_i) / 139968; + $this_addr_i1 = $tmp3; + $pct_addr_i = $div_i; + assertEq($pct_addr_i, NaN); +} diff --git a/js/src/jit-test/tests/jaeger/bug643805.js b/js/src/jit-test/tests/jaeger/bug643805.js new file mode 100644 index 000000000..14a9edb48 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug643805.js @@ -0,0 +1,50 @@ +function _tt_face_get_name() { + var __label__ = -1; + var $rec; + var $n; + while(true) { + switch(__label__) { + case -1: + $rec=0; + $n=0; + case 0: + if ($rec == 20) { + __label__ = 2; + break; + } + var $63 = $n; + var $64 = $63 + 1; + $n = $64; + var $65 = $rec; + $rec = $rec + 1; + assertEq($64 < 30, true); + __label__ = 0; + break; + case 1: + $rec = 0; + case 2: + return; + } + } +} +_tt_face_get_name(); + +/* Test tracking of lifetimes around backedges in nested loops. */ +function nested() { + var x = 100; + var i = 0; + while (i < 10) { + while (i < 10) { + i++; + if (x < 20) + break; + if (i > 10) { + x = 200; + i++; + } + } + if (i > 10) + x = 100; + } +} +nested(); diff --git a/js/src/jit-test/tests/jaeger/bug643829.js b/js/src/jit-test/tests/jaeger/bug643829.js new file mode 100644 index 000000000..43766c012 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug643829.js @@ -0,0 +1,12 @@ +function _build_tree() { + var $n; + var $elems = 20; + while (true) { + var $tmp18 = $n; + var $tmp19 = $elems; + var $cmp = ($n | 0) < ($elems | 0); + return $cmp; + } +} +assertEq(_build_tree(), true); + diff --git a/js/src/jit-test/tests/jaeger/bug643913.js b/js/src/jit-test/tests/jaeger/bug643913.js new file mode 100644 index 000000000..1dc8ac5d0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug643913.js @@ -0,0 +1,8 @@ +function f() { + var x; + eval("x = 3.14"); + x = 123; + var y = -(-x); + assertEq(y, 123); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug645629.js b/js/src/jit-test/tests/jaeger/bug645629.js new file mode 100644 index 000000000..c92d2c7bf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug645629.js @@ -0,0 +1,8 @@ +/* Don't assert. */ +o1 = {}; +o1 = 2; +function f(o) { + o.hasOwnProperty("x"); +} +new f(o1); +f(o1); diff --git a/js/src/jit-test/tests/jaeger/bug645657.js b/js/src/jit-test/tests/jaeger/bug645657.js new file mode 100644 index 000000000..d33870934 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug645657.js @@ -0,0 +1,8 @@ +function f() { + var x = 3; + var y = 1.2; + var z; + y = --z; + x = z++; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug645985.js b/js/src/jit-test/tests/jaeger/bug645985.js new file mode 100644 index 000000000..7ba1a0386 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug645985.js @@ -0,0 +1,5 @@ +function f(o) { + o += ""; + o.hasOwnProperty("x"); +} +f({}); diff --git a/js/src/jit-test/tests/jaeger/bug646001.js b/js/src/jit-test/tests/jaeger/bug646001.js new file mode 100644 index 000000000..eabdb12dc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug646001.js @@ -0,0 +1,12 @@ +function jit(on) +{ + if (on && !options().match(/tracejit/)) { } +} +try { test(); } catch (e) {} +function test( + ) +{ + for (var j=0;j<5;++j) { switch(1.1) { case 2: case NaN: } } + jit(false); + reportCompare('xxxxxxx'.test(new j('(x+)(x*)'))); +} diff --git a/js/src/jit-test/tests/jaeger/bug646060.js b/js/src/jit-test/tests/jaeger/bug646060.js new file mode 100644 index 000000000..f399e1283 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug646060.js @@ -0,0 +1,8 @@ +function f0(i) { + switch(i) { + case "a": + case { TITLE: false, VERSION: false }('test') + : + } +} +try { new TestCase(SECTION, 'switch statement', f0("a"), "ab*"); } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/bug646411.js b/js/src/jit-test/tests/jaeger/bug646411.js new file mode 100644 index 000000000..2e4f6b942 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug646411.js @@ -0,0 +1,12 @@ +load(libdir + "immutable-prototype.js"); + +if (globalPrototypeChainIsMutable()) + __proto__ = Function(); + +eval("\ +var MS = 16;\ +addNewTestCase(new Date(1899,11,31,16,0,0), \"new Date(1899,11,31,16,0,0)\", typeof UTC_DAY == 'undefined');\ +function addNewTestCase( DateCase, DateString, ResultArray ) {\ + ResultArray[MS];\ +}\ +"); diff --git a/js/src/jit-test/tests/jaeger/bug646495.js b/js/src/jit-test/tests/jaeger/bug646495.js new file mode 100644 index 000000000..f961de747 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug646495.js @@ -0,0 +1,6 @@ +function f() { + var x = 1; + var y; + if (x = y = Math) {} +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug646938.js b/js/src/jit-test/tests/jaeger/bug646938.js new file mode 100644 index 000000000..0284bdce3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug646938.js @@ -0,0 +1,21 @@ +function f() { + var x = -[NaN][0]; + assertEq(x === x, false); + assertEq(x !== x, true); + assertEq(x == x, false); + assertEq(x != x, true); + + var y = -("x" / {}); + var z = y; + assertEq(y === z, false); + assertEq(y !== z, true); + assertEq(y == z, false); + assertEq(y != z, true); +} +f(); + +function g(x, y) { + var z = x / y; + assertEq(z === z, false); +} +g(0, 0); diff --git a/js/src/jit-test/tests/jaeger/bug647440.js b/js/src/jit-test/tests/jaeger/bug647440.js new file mode 100644 index 000000000..f03f2c207 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug647440.js @@ -0,0 +1,7 @@ +if (false) + function g() {} +function f() { + var x; + (x = Infinity) >> x--; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug647657.js b/js/src/jit-test/tests/jaeger/bug647657.js new file mode 100644 index 000000000..09c999fa7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug647657.js @@ -0,0 +1 @@ +Function("var{}=Array()")() diff --git a/js/src/jit-test/tests/jaeger/bug647785.js b/js/src/jit-test/tests/jaeger/bug647785.js new file mode 100644 index 000000000..da7dd20a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug647785.js @@ -0,0 +1,4 @@ +assertEq(-(!new Int32Array(5)), -0); +assertEq(-(!Math), -0); +assertEq(-(!{}), -0); +assertEq(-(![]), -0); diff --git a/js/src/jit-test/tests/jaeger/bug648004.js b/js/src/jit-test/tests/jaeger/bug648004.js new file mode 100644 index 000000000..ba215bdea --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648004.js @@ -0,0 +1,4 @@ +var x = eval("gc(); 30"); +var y = x.toString(); +isNaN(x); +assertEq(y, "30"); diff --git a/js/src/jit-test/tests/jaeger/bug648230-1.js b/js/src/jit-test/tests/jaeger/bug648230-1.js new file mode 100644 index 000000000..f684bc689 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648230-1.js @@ -0,0 +1,13 @@ + +function f() { + -null; + -null; + -null; + -null; + -null; +} +{ + function g() {}; +} +f(); +x = Math.abs(); diff --git a/js/src/jit-test/tests/jaeger/bug648230-2.js b/js/src/jit-test/tests/jaeger/bug648230-2.js new file mode 100644 index 000000000..d9e1eb421 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648230-2.js @@ -0,0 +1,14 @@ +var i = 1; +var j = 2; +function f() { + if (false) + function g() {}; + return i / j; +} +-null; +-null; +-null; +-null; +-null; +f(); + diff --git a/js/src/jit-test/tests/jaeger/bug648498.js b/js/src/jit-test/tests/jaeger/bug648498.js new file mode 100644 index 000000000..8e54209e5 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648498.js @@ -0,0 +1,5 @@ +function f(x, y) { + return x; +} +var a = 3.3; +a ? f(f(1, 2), 3) : a; diff --git a/js/src/jit-test/tests/jaeger/bug648586.js b/js/src/jit-test/tests/jaeger/bug648586.js new file mode 100644 index 000000000..dd2dfeb91 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648586.js @@ -0,0 +1,11 @@ +try { eval("\ + function a(y){y.x}\ + for each(let d in[\ + ({}),({}),({}),({}),({}),({}),({}),({}),({}),({})\ + ]){\ + try{\ + a(d)\ + }catch(e){}\ + }\ + n\ +") } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/bug648708.js b/js/src/jit-test/tests/jaeger/bug648708.js new file mode 100644 index 000000000..1f7959637 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug648708.js @@ -0,0 +1,6 @@ +thrown = false +try { + ("".x = Object.seal) + "".x.valueOf(); +} catch (e) {thrown = true} +assertEq(thrown, true); diff --git a/js/src/jit-test/tests/jaeger/bug649272.js b/js/src/jit-test/tests/jaeger/bug649272.js new file mode 100644 index 000000000..b09e324ad --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649272.js @@ -0,0 +1,4 @@ +function f(x) {return x;} +x = f(/abc/); +eval("this.__defineSetter__(\"x\", function(){}); x = 3;"); +eval("var BUGNUMBER = 233483;"); diff --git a/js/src/jit-test/tests/jaeger/bug649593.js b/js/src/jit-test/tests/jaeger/bug649593.js new file mode 100644 index 000000000..9d878d4a2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649593.js @@ -0,0 +1,10 @@ +function RunSingleBenchmark(data) { + if (data == null) + return { runs: 0, elapsed: 0 }; + data.runs += 10; + return data; +} +var data; +data = RunSingleBenchmark(data); +data = RunSingleBenchmark(data); +assertEq(data.runs, 10); \ No newline at end of file diff --git a/js/src/jit-test/tests/jaeger/bug649689.js b/js/src/jit-test/tests/jaeger/bug649689.js new file mode 100644 index 000000000..147197e00 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649689.js @@ -0,0 +1,6 @@ +function f(x) { + eval("a = 3"); + x.p = x.p = a; + assertEq(x.p, 3); +} +f({p: 2}); diff --git a/js/src/jit-test/tests/jaeger/bug649775.js b/js/src/jit-test/tests/jaeger/bug649775.js new file mode 100644 index 000000000..abf136f59 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649775.js @@ -0,0 +1,17 @@ +var x = [, ]; +var n = [, ]; +var np = 18229; +sa = Array; +function copy_(x, y) { + var i; + var k = x < y ? x.length : y.length; + for (i = 0; i < k; i--) { + x[i]; + if (i == -100) + return; + } +} +function mont_(x, y, n, np) { + copy_(x, sa); +} +mont_(x, x, n, np); diff --git a/js/src/jit-test/tests/jaeger/bug649824.js b/js/src/jit-test/tests/jaeger/bug649824.js new file mode 100644 index 000000000..619641c92 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649824.js @@ -0,0 +1,6 @@ +var o = { + w: 2, + x: 3 +}; +var o = 430717; +o.x = 4; diff --git a/js/src/jit-test/tests/jaeger/bug649973.js b/js/src/jit-test/tests/jaeger/bug649973.js new file mode 100644 index 000000000..89b288223 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug649973.js @@ -0,0 +1,2 @@ +x = 2147483647; +(x+10, false) ? [x % x] : [2 * x]; diff --git a/js/src/jit-test/tests/jaeger/bug650076.js b/js/src/jit-test/tests/jaeger/bug650076.js new file mode 100644 index 000000000..a72faa0fe --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug650076.js @@ -0,0 +1,13 @@ +var v0, v1, v2, v3, v4, v5, v6, v7, v8, v9; +var v10, v11, v12, v13, v14, v15, v16, v17, v18, v19; +var v20, v21, v22, v23, v24, v25, v26, v27, v28, v29; +var v30, v31, v32, v33, v34, v35, v36, v37, v38, v39; +var v40, v41, v42, v43; + +function f() {} + +v1 = new Date(0); +v1.setMilliseconds(12); +v2 = eval("''"); +v3 = ""; +f((v2 + v3).indexOf(v3)); diff --git a/js/src/jit-test/tests/jaeger/bug650662.js b/js/src/jit-test/tests/jaeger/bug650662.js new file mode 100644 index 000000000..4c4b2bc85 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug650662.js @@ -0,0 +1,6 @@ +test(); +function test() { + var a = []; + a*=3; + a.length; +} diff --git a/js/src/jit-test/tests/jaeger/bug650663.js b/js/src/jit-test/tests/jaeger/bug650663.js new file mode 100644 index 000000000..786230fb3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug650663.js @@ -0,0 +1,15 @@ +var cnBadSyntax = '1=2'; +var obj = new testObject; +f.call(obj); +g(); +function testObject() { + this.badSyntax = cnBadSyntax; +} +function f() { + try { + eval(this.badSyntax) + } catch (e) {} +} +function g() { + f.call(); +} diff --git a/js/src/jit-test/tests/jaeger/bug651147.js b/js/src/jit-test/tests/jaeger/bug651147.js new file mode 100644 index 000000000..08971faa0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug651147.js @@ -0,0 +1,7 @@ +var BUGNUMBER = 96284; +var BUGNUMBER = "410725"; +function iteratorToArray(iterator) { + var result = []; + for (var i in iterator) BUGNUMBER[result.length]; +} +try { obj = { a: 1, }('["a", "b"]', iteratorToArray(), 'uneval(iteratorToArray(new Iterator(obj,true)))'); } catch (e) { } diff --git a/js/src/jit-test/tests/jaeger/bug652305.js b/js/src/jit-test/tests/jaeger/bug652305.js new file mode 100644 index 000000000..78df18aad --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug652305.js @@ -0,0 +1,25 @@ +var sjcl = { + cipher: {}, +}; +var global = 99; +sjcl.cipher.aes = function (a) { + var b, c, d, e, f = this.h[0][4], + g = this.h[1]; + d = a.slice(0); + this.a = [d, []]; + for (a = 8; a < 60; a++) { + c = d[a - 1]; + if (a % 8 === 0) { + c = global; + if (0 === 0) { + h = 2; + } + } + d[a] = c; + } + assertEq(this.a[0][50], 99); +}; +sjcl.cipher.aes.prototype = { + h: [[[], [], [], [], [99, 0]], [[67175681, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 65537], [17039621, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 16777472], [83952641, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 65537], [17105156, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 16777472], []]], +}; +new sjcl.cipher.aes([0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff]); diff --git a/js/src/jit-test/tests/jaeger/bug652314.js b/js/src/jit-test/tests/jaeger/bug652314.js new file mode 100644 index 000000000..80b4a3208 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug652314.js @@ -0,0 +1,7 @@ +(function() { + for (a in [0]) { + try { + return + } catch(e) {} + } +})() diff --git a/js/src/jit-test/tests/jaeger/bug652590.js b/js/src/jit-test/tests/jaeger/bug652590.js new file mode 100644 index 000000000..5709411a5 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug652590.js @@ -0,0 +1,5 @@ +function f() { + var x = undefined ? 1 : 4294967295; + print(false || x); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug653243.js b/js/src/jit-test/tests/jaeger/bug653243.js new file mode 100644 index 000000000..53e930280 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug653243.js @@ -0,0 +1,12 @@ +try { + obj[i] = "a"; +} catch (e) {} +var obj = { + p: 100 +}; +var name = "p"; +var a = []; +for (var i = 0; i < 10; i++) { + a[i] = obj[name]--; +} +assertEq(a.join(), '100,99,98,97,96,95,94,93,92,91'); diff --git a/js/src/jit-test/tests/jaeger/bug653249.js b/js/src/jit-test/tests/jaeger/bug653249.js new file mode 100644 index 000000000..b85ddd743 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug653249.js @@ -0,0 +1,13 @@ + +function testUnaryImacros() { + function checkArg(x) { + o = { + valueOf: checkArg + } + } + var v = 0; + v += +toString; + for (var i = 0; i;) { + v += [].checkArg.checkArg; + } +}(testUnaryImacros(), "valueOf passed, toString passed"); diff --git a/js/src/jit-test/tests/jaeger/bug653397.js b/js/src/jit-test/tests/jaeger/bug653397.js new file mode 100644 index 000000000..f17167fac --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug653397.js @@ -0,0 +1,16 @@ +try { + function testSlowArrayPopMultiFrame() { + a = undefined; + function parent(a, i) { i }; + function gramps(a, i) { + return parent; + } + var last; + for (var i = 0; ; gramps++) { + last = gramps(a, i) + } + }(testSlowArrayPopMultiFrame(), 23); + assertEq(0, 1); +} catch(e) { + assertEq(e instanceof TypeError, true); +} diff --git a/js/src/jit-test/tests/jaeger/bug655505.js b/js/src/jit-test/tests/jaeger/bug655505.js new file mode 100644 index 000000000..4d2e07c66 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug655505.js @@ -0,0 +1,15 @@ +var a = [, , , , , , ]; +var res = 0; +exhaustiveSliceTest("exhaustive slice test 1", a); +function mySlice(a, from, to) { + var to2 = to; + if (to2 > 0) { + res += to2; + to2 = to2.length + to; + } +} +function exhaustiveSliceTest(testname, a) { x = a; } +for (y = a.length; y >= 0; y--) { + mySlice(a, x, y); +} +assertEq(res, 21); diff --git a/js/src/jit-test/tests/jaeger/bug655508.js b/js/src/jit-test/tests/jaeger/bug655508.js new file mode 100644 index 000000000..712c1c0cf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug655508.js @@ -0,0 +1,15 @@ +switch (3) { +case + function () { + var x; + (function () {})() && false; + x = undefined; + try { + JSON.parse(x) + } catch (e) {} + }([]): +case + function () { + [typeof loopa1] + }(0): +} diff --git a/js/src/jit-test/tests/jaeger/bug655810.js b/js/src/jit-test/tests/jaeger/bug655810.js new file mode 100644 index 000000000..e31d56234 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug655810.js @@ -0,0 +1,6 @@ +function f(arr) { + var x = arr[0]; + if (typeof x) {}; + Math.abs(x); +} +f([1.2]); diff --git a/js/src/jit-test/tests/jaeger/bug655990.js b/js/src/jit-test/tests/jaeger/bug655990.js new file mode 100644 index 000000000..4ca4fd1f6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug655990.js @@ -0,0 +1,12 @@ +expect = 0; +summary = 0; +test(); +function test() { + function f(a, b, c) { + return c; + } + if (gczeal == 'function') actual = f(1.5, 1.25, 1.125) + else expect; + (expect, actual, summary); + var actual = ''; +} diff --git a/js/src/jit-test/tests/jaeger/bug656096.js b/js/src/jit-test/tests/jaeger/bug656096.js new file mode 100644 index 000000000..63fdac76b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656096.js @@ -0,0 +1,37 @@ +function aes(a) { + d = a.slice() + for (; a < 28; a++) + d[0] = d[0] ^ undefined +} +var sjcl = {}; +sjcl.bitArray = { + concat: function (a, b) { + return d ? a : []; + }, + clamp: function (a, b) { + return a + } +}; +function G(a, b, c, d, e, f) { + var g = [], + h = sjcl.bitArray, + f = []; + f = h.concat(f, c) + if (c) g = [] + else c = h.concat([], []) + h.concat(g, d) + h.clamp(f, [1,2,3]) +} +function decrypt(a, b, c, d, e) { + G(a, 1, c, d, e, b) + var g = [], + h = sjcl.bitArray, + f = []; + h.concat(f, c) + if (c) g = [] + else c = h.concat([], []) + h.concat(g, d) + h.concat([], c).concat.slice +} +aes(sjcl.bitArray.clamp([])); +decrypt(1, 2, 3); diff --git a/js/src/jit-test/tests/jaeger/bug656252.js b/js/src/jit-test/tests/jaeger/bug656252.js new file mode 100644 index 000000000..07b0f94f1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656252.js @@ -0,0 +1,14 @@ +o14 = [undefined].__proto__ +function f18() { + try { + [] = o[p] + } catch (e) {} +} +for (var i; i < 20; i++) { + ({ + x: function() { + return eval("o14") + } + }.x().__proto__ = null); + f18() +} diff --git a/js/src/jit-test/tests/jaeger/bug656259.js b/js/src/jit-test/tests/jaeger/bug656259.js new file mode 100644 index 000000000..35de21726 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656259.js @@ -0,0 +1,11 @@ + +function throwsRangeError(t) { + try { + t: for (t[t++] in object) { + t++ + break t; + } + date(t) + } catch (err) {} +} +throwsRangeError(Infinity); diff --git a/js/src/jit-test/tests/jaeger/bug656591.js b/js/src/jit-test/tests/jaeger/bug656591.js new file mode 100644 index 000000000..8d86cdf2b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656591.js @@ -0,0 +1,9 @@ +// |jit-test| error: TypeError +(function () { + var i = 0; + (function () { + var x; + (x = "3") || 1; + (x = "")(i || x); + })(); +})(); diff --git a/js/src/jit-test/tests/jaeger/bug656748.js b/js/src/jit-test/tests/jaeger/bug656748.js new file mode 100644 index 000000000..fd0cb2c11 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656748.js @@ -0,0 +1,8 @@ +function f() { + var x = -0; + x++; + if (3 > 2) {}; + var y = x + 2.14; + assertEq(y, 3.14); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug656914.js b/js/src/jit-test/tests/jaeger/bug656914.js new file mode 100644 index 000000000..e57e0a974 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug656914.js @@ -0,0 +1,23 @@ +try { + new MyObject; +} catch (e) {} + +function MyObject() { + return; + return this; +} + +function Foo(x) { + if (x) + this.f = x; +} +var q = new Foo(false); +for (a in q) { assertEq(true, false); } + +function Bar(x, y) { + if (!x) + return; + this.f = y; +} +var q2 = new Bar(false, true); +for (b in q2) { assertEq(true, false); } diff --git a/js/src/jit-test/tests/jaeger/bug657120.js b/js/src/jit-test/tests/jaeger/bug657120.js new file mode 100644 index 000000000..6e8af1a49 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug657120.js @@ -0,0 +1,6 @@ +function f() { + var x = Object(2); + var y = 3.14; + assertEq(true && x < y, true); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug657247.js b/js/src/jit-test/tests/jaeger/bug657247.js new file mode 100644 index 000000000..539cdf55c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug657247.js @@ -0,0 +1,5 @@ + +a = new Array; +for (var i = 0; i != 1000; ++i) a[i] = 17; +var x = '123' + '\0' + '456'; +(1, a[x], ': 123\\0456'); diff --git a/js/src/jit-test/tests/jaeger/bug657890.js b/js/src/jit-test/tests/jaeger/bug657890.js new file mode 100644 index 000000000..1d74fc48c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug657890.js @@ -0,0 +1,6 @@ +function f() {}; +var x; +for(var i=0; i<200; i++) { + x = f.bind(x, x, 2); + gc(); +} diff --git a/js/src/jit-test/tests/jaeger/bug658240.js b/js/src/jit-test/tests/jaeger/bug658240.js new file mode 100644 index 000000000..033f2fbda --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug658240.js @@ -0,0 +1,11 @@ +function f() { + var x = 0; + for(var i=0; i<5; i++) { + (function() { + var q = parseFloat("2"); + x += q; + })(); + } + return x; +} +assertEq(f(), 10); diff --git a/js/src/jit-test/tests/jaeger/bug658294.js b/js/src/jit-test/tests/jaeger/bug658294.js new file mode 100644 index 000000000..e1496b961 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug658294.js @@ -0,0 +1,15 @@ +test(); +function test() +{ + try { + instances = [] + for (var i = 0; i != 2; ++i) + instances[i]=constructor + var i = 0; + var instance = instances[i]; + var name = instance.name; + for (var j = 1; j != instances; ++j) + if (i != j && instance instanceof name[j].constructor) {} + } catch(ex) {} +} +test(); diff --git a/js/src/jit-test/tests/jaeger/bug658579.js b/js/src/jit-test/tests/jaeger/bug658579.js new file mode 100644 index 000000000..7affcbd5f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug658579.js @@ -0,0 +1,5 @@ +(function () { + var x = 1 || 1.2; + true ? ~x : x; + x >> x; +})(); diff --git a/js/src/jit-test/tests/jaeger/bug658968.js b/js/src/jit-test/tests/jaeger/bug658968.js new file mode 100644 index 000000000..74a15afa1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug658968.js @@ -0,0 +1,13 @@ +function f(){ + var tarr = []; + var elemArray = [ + {name: "C0", checked: true}, + {name: "C1", checked: false}, + ]; + for (var i = 0; i < elemArray.length; i++) { + var element = elemArray[i]; + tarr[i] = (element.checked == true) ? 1 : 2; + } + assertEq(tarr.join(""), "12"); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug659438.js b/js/src/jit-test/tests/jaeger/bug659438.js new file mode 100644 index 000000000..fddfe6a02 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug659438.js @@ -0,0 +1,8 @@ +var o1 = {x: {}}; +function f() { + var o = o1; + for(var i=0; i<10; i++) { + o1 = o.x; + } +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug659439.js b/js/src/jit-test/tests/jaeger/bug659439.js new file mode 100644 index 000000000..e83afebfd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug659439.js @@ -0,0 +1,16 @@ +function bind(f) { + return f.call.apply(f.bind, arguments); +}; +function h(a, b) { + a.x; +} +function g(a, b) { + a.x = b; + h(a); +} +function f() { + for(var i=0; i<20; i++) { + g.call(this, {}, bind(function(){})); + } +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug659448.js b/js/src/jit-test/tests/jaeger/bug659448.js new file mode 100644 index 000000000..d9d7c9f16 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug659448.js @@ -0,0 +1,9 @@ +function TestCase(n, d, e, a) { + this.expect = e; + this.passed = getTestCaseResult(this.expect, this.actual); +} +function getTestCaseResult(expect, actual) {} +new TestCase( + TestCase(3000000000.5) +); +new TestCase(null,null, String('Sally and Fred are sure to come'.match(/^[a-z\s]*/i))); diff --git a/js/src/jit-test/tests/jaeger/bug659456.js b/js/src/jit-test/tests/jaeger/bug659456.js new file mode 100644 index 000000000..b2155f000 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug659456.js @@ -0,0 +1,12 @@ +// |jit-test| error: InternalError +function foo() { return "tracejit,methodjit"; }; +function baz(on) { + foo('bar'); +} +eval("\ +test();\ +function test() {\ + baz(true);\ + test();\ +}\ +"); diff --git a/js/src/jit-test/tests/jaeger/bug660002.js b/js/src/jit-test/tests/jaeger/bug660002.js new file mode 100644 index 000000000..f1bc7ab73 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug660002.js @@ -0,0 +1,4 @@ +// |jit-test| error: ReferenceError +(function() { + let V = x(x, x = w), x +})() diff --git a/js/src/jit-test/tests/jaeger/bug662072.js b/js/src/jit-test/tests/jaeger/bug662072.js new file mode 100644 index 000000000..04c198ccd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug662072.js @@ -0,0 +1,7 @@ +(function () { + var x; + x = arguments.length; + return function () { + [1][x = arguments.length]; + }; +}).call().apply(); diff --git a/js/src/jit-test/tests/jaeger/bug662082.js b/js/src/jit-test/tests/jaeger/bug662082.js new file mode 100644 index 000000000..533fee8ba --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug662082.js @@ -0,0 +1,11 @@ + +function foo(z) +{ + var x = 2; + if (z) { + x = 2.5; + } + var y = x * 10; + assertEq(y, 20); +} +foo(false); diff --git a/js/src/jit-test/tests/jaeger/bug663485.js b/js/src/jit-test/tests/jaeger/bug663485.js new file mode 100644 index 000000000..c6d3555d7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug663485.js @@ -0,0 +1,17 @@ +function makeExpectedMatch(arr) { + expectedMatch = { + x: arr.length + } +} +var expected = makeExpectedMatch(new Int32Array); +this.toSource(); + +function testTypedArrayOther() { + var ar = new Int32Array; + for (; i < ar; ++i) { + ar[i] = i; + } + for (var i = 0; i<40; i++) { + } +} +testTypedArrayOther(); diff --git a/js/src/jit-test/tests/jaeger/bug663910.js b/js/src/jit-test/tests/jaeger/bug663910.js new file mode 100644 index 000000000..33997a3c4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug663910.js @@ -0,0 +1,22 @@ +var otherGlobalSameCompartment = newGlobal("same-compartment"); +eval = otherGlobalSameCompartment.eval; +doesNotNeedParens(1, "if (xx) { }"); +needParens(2, "if (1, xx) { }"); +function doesNotNeedParens(section, pat) { + try { + f = new Function + } catch (e) {} + roundTripTest(section, f) +} +function needParens(section, pat, exp) { + var f, ft; + roundTripTest(section, f, exp) +} +function roundTripTest(section, f, exp) { + uf = "" + f + var euf; + try { + euf = eval("(" + uf + ")"); + } catch (e) { } + + euf +} diff --git a/js/src/jit-test/tests/jaeger/bug669706.js b/js/src/jit-test/tests/jaeger/bug669706.js new file mode 100644 index 000000000..a3ddb4358 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug669706.js @@ -0,0 +1,14 @@ +function printStatus(msg) { + msg.toString() + lines = msg + for (var i = 0; i < lines; i++) i +} +var summary = new Float32Array; +try { + printStatus(summary) + x = { + } + toString.__proto__ = x +} catch (e) {} +var summary = 6; +printStatus(summary) diff --git a/js/src/jit-test/tests/jaeger/bug670885.js b/js/src/jit-test/tests/jaeger/bug670885.js new file mode 100644 index 000000000..a1d8bcbe7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug670885.js @@ -0,0 +1,16 @@ +// arr is an Int8Array, then changes to Int16Array. +// This should trigger recompilation of f. +var arr = new Int8Array(100); +var arr16 = new Int16Array(100); +arr16[2] = 12345; +function f(a) { + var x; + for(var i=0; i<30; i++) { + x = a[2]; + } + return x; +} +assertEq(f(arr), 0); +assertEq(f(arr), 0); +this.arr = arr16; +assertEq(f(arr), 12345); diff --git a/js/src/jit-test/tests/jaeger/bug672122.js b/js/src/jit-test/tests/jaeger/bug672122.js new file mode 100644 index 000000000..14802554e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug672122.js @@ -0,0 +1,3 @@ +// |jit-test| error: ReferenceError + +if (x) {} else if ((evalcx('lazy'))++) {} diff --git a/js/src/jit-test/tests/jaeger/bug678141.js b/js/src/jit-test/tests/jaeger/bug678141.js new file mode 100644 index 000000000..644f13644 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug678141.js @@ -0,0 +1,10 @@ + +c = {}.__proto__[1] = 3; +(function() { + function b(a) { + return a + } + for each(let z in [{}]) { + print(new b(z)) + } +})() diff --git a/js/src/jit-test/tests/jaeger/bug678234.js b/js/src/jit-test/tests/jaeger/bug678234.js new file mode 100644 index 000000000..52a421553 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug678234.js @@ -0,0 +1,10 @@ +a = {} +function f(o) { + for (x in o) { + print + } +} +for (var i = 0; i < 3; i++) { + new f(a) + a.__proto__ = null +} diff --git a/js/src/jit-test/tests/jaeger/bug678782.js b/js/src/jit-test/tests/jaeger/bug678782.js new file mode 100644 index 000000000..1549bbe77 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug678782.js @@ -0,0 +1,9 @@ +var i = -1; var j = -1; var s = ''; var f = ''; +var buf = serialize(new Date(NaN)); +var a = [1/0, -1/0, 8.64e15 + 1, -(8.64e15 + 1)]; +for (var i = 0; i < a.length; i++) { + var n = a[i]; + var nbuf = serialize(n); + for (var Number ; j < 8; j++) + buf[j + 8] = nbuf[j]; +} diff --git a/js/src/jit-test/tests/jaeger/bug679666.js b/js/src/jit-test/tests/jaeger/bug679666.js new file mode 100644 index 000000000..986195ebc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug679666.js @@ -0,0 +1,22 @@ +var arr = new Int32Array(20); + +function f(a1, a2) { + for (var i=0; i<10; i++) { + g1 = a2; + arr[a1] = a2; + assertEq(g1, a2); + + if ([1].length === 10) { + a1 = {}; + } + } +} + +f(1, eval("{}")); + +for (var i=0; i<5; i++) { + f(2, 3); + f(5, -6.1); +} +assertEq(arr[2], 3); +assertEq(arr[5], -6); diff --git a/js/src/jit-test/tests/jaeger/bug680842.js b/js/src/jit-test/tests/jaeger/bug680842.js new file mode 100644 index 000000000..016673fb7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug680842.js @@ -0,0 +1,27 @@ + +var gTestcases = new Array; +var gTc = gTestcases; +var msg = ''; +function TestCase(n, d, e, a) { + gTestcases[gTc++]=this; +} +TestCase.prototype.dump=function () { + lines = msg + for (var i=0; i v3 + v3=1.7 + } while (p1 * v0 > p0); + + v3; +} +f0(4105,8307); diff --git a/js/src/jit-test/tests/jaeger/bug682345.js b/js/src/jit-test/tests/jaeger/bug682345.js new file mode 100644 index 000000000..94d610748 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug682345.js @@ -0,0 +1,16 @@ +// |jit-test| error: TypeError + +for (var i = 0; i <= 0x017f; i++) { + var U = new Unicode(i); +} +function Unicode(c) { + u = GetUnicodeValues(c); + this.upper = u[0]; +} +function GetUnicodeValues(c) { + u = new Array(); + if ((c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178)) try {} finally { + return; + } + return u; +} diff --git a/js/src/jit-test/tests/jaeger/bug684084-2.js b/js/src/jit-test/tests/jaeger/bug684084-2.js new file mode 100644 index 000000000..34ddae320 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684084-2.js @@ -0,0 +1,8 @@ +function Function() { + try { + var g = this; + g.c("evil", eval); + } catch(b) {} +} +var o0 = Function.prototype; +var f = new Function( (null ) ); diff --git a/js/src/jit-test/tests/jaeger/bug684084.js b/js/src/jit-test/tests/jaeger/bug684084.js new file mode 100644 index 000000000..ac2c11a38 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684084.js @@ -0,0 +1,7 @@ +// |jit-test| error: TypeError +function Integer( value, exception ) { + try { } catch ( e ) { } + new (value = this)( this.value ); + if ( Math.floor(value) != value || isNaN(value) ) { } +} +new Integer( 3, false ); diff --git a/js/src/jit-test/tests/jaeger/bug684576.js b/js/src/jit-test/tests/jaeger/bug684576.js new file mode 100644 index 000000000..b845d2160 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684576.js @@ -0,0 +1,10 @@ +// |jit-test| error: TypeError +function f0(p0,p1) { + var v3; + do { + p1 > v3 + v3=1.7 + } while (((p0[p1][5]==1)||(p0[p1][5]==2)||(p0[p1][5] == 3)) + 0 > p0); + + (v3(f0)); +} +f0(4105,8307); diff --git a/js/src/jit-test/tests/jaeger/bug684824.js b/js/src/jit-test/tests/jaeger/bug684824.js new file mode 100644 index 000000000..9e8ad9c7e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684824.js @@ -0,0 +1,7 @@ + +function X(n) { + while ('' + (n--)) { + break; + } +} +X(); diff --git a/js/src/jit-test/tests/jaeger/bug684943.js b/js/src/jit-test/tests/jaeger/bug684943.js new file mode 100644 index 000000000..69ec5ca2b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684943.js @@ -0,0 +1,7 @@ + +function foo(x) { + for (var i = 0; i < 100; i++) { + x.f === i; + } +} +foo({f:"three"}); diff --git a/js/src/jit-test/tests/jaeger/bug687768.js b/js/src/jit-test/tests/jaeger/bug687768.js new file mode 100644 index 000000000..a4b2b4ade --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug687768.js @@ -0,0 +1,17 @@ + +expected = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,'; +function slice(a, b) { + return expected; +} +function f() { + var length = 4; + var index = 0; + function get3() { + if (length - index < 3) + return null; + return slice(index, ++index); + } + var bytes = null; + while (bytes = get3()) { } +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug693311.js b/js/src/jit-test/tests/jaeger/bug693311.js new file mode 100644 index 000000000..39d69ab25 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug693311.js @@ -0,0 +1,8 @@ +function f(x) { + assertEq("a" !== x, true); + assertEq("b" != x, true); + assertEq("c" === x, false); + assertEq("d" == x, false); +} +f(1); +f(1); diff --git a/js/src/jit-test/tests/jaeger/bug704138.js b/js/src/jit-test/tests/jaeger/bug704138.js new file mode 100644 index 000000000..71e495887 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug704138.js @@ -0,0 +1,21 @@ +load(libdir + "immutable-prototype.js"); + +function TestCase(n, d, e, a) { + this.name=n; + return n; +} + +function reportCompare (expected, actual, description) { + new TestCase +} + +reportCompare(true, "isGenerator" in Function, "Function.prototype.isGenerator present"); +var p = new Proxy({}, {}); +function test() { + TestCase.prototype.__proto__=null + if (new TestCase) + TestCase.prototype.__proto__=p +} +test(); +new TestCase; +test() diff --git a/js/src/jit-test/tests/jaeger/bug705873.js b/js/src/jit-test/tests/jaeger/bug705873.js new file mode 100644 index 000000000..1d4d65246 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug705873.js @@ -0,0 +1,7 @@ +a = [] +function f(o) { + o[5] = {} +} +for (var i = 0; i < 20; i++) { + with(a) f(a) +} diff --git a/js/src/jit-test/tests/jaeger/bug706110.js b/js/src/jit-test/tests/jaeger/bug706110.js new file mode 100644 index 000000000..ef1e657ca --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug706110.js @@ -0,0 +1,18 @@ +function test() { + function Bug() { this.prototype } + var actual = (new Bug instanceof Bug); + assertEq(actual, true); +} +test(); +test(); + +function testLambdaCtor() { + var q; + for (var x = 0; x < 2; ++x) { + var f = function(){}; + if (x == 1) gc(); + q = new f; + } + return q.__proto__ === f.prototype; +} +assertEq(testLambdaCtor(), true); diff --git a/js/src/jit-test/tests/jaeger/bug707641.js b/js/src/jit-test/tests/jaeger/bug707641.js new file mode 100644 index 000000000..3df589394 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug707641.js @@ -0,0 +1,7 @@ +function a(a, prototype) { + try { + typeof (arguments[a]) in code + } catch(e) {} +} +a(); +a(); diff --git a/js/src/jit-test/tests/jaeger/bug709067.js b/js/src/jit-test/tests/jaeger/bug709067.js new file mode 100644 index 000000000..3e3bd70b8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug709067.js @@ -0,0 +1,11 @@ +called = 0; +Object.defineProperty(Object.prototype, 0, {set: function() { called++; }}); +function testInit() +{ + var a = []; + for (var i = 0; i < 5; i++) + a[i] = 0; +} +for (var i = 0; i < 100; i++) + testInit(); +assertEq(called, 100); diff --git a/js/src/jit-test/tests/jaeger/bug710780.js b/js/src/jit-test/tests/jaeger/bug710780.js new file mode 100644 index 000000000..84d264692 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug710780.js @@ -0,0 +1,12 @@ + +function foo() { + function bar() { + function baz() { + assertEq(arguments.callee.caller === null, false); + } + for (var i = 0; i < 10; i++) + baz(); + } + bar(); +} +foo(); diff --git a/js/src/jit-test/tests/jaeger/bug714645.js b/js/src/jit-test/tests/jaeger/bug714645.js new file mode 100644 index 000000000..2bcfa2598 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug714645.js @@ -0,0 +1,12 @@ + +function testAddInconvertibleObjectAny() { + var count = 0; + function toString() { } + try { + for (var i = 0; i < 100; i++) + var q = count[count] && this ? testAddInconvertibleObjectAny : ++toString; + } catch (e) { + var dbg = count(toString); + } +} +testAddInconvertibleObjectAny(); diff --git a/js/src/jit-test/tests/jaeger/bug719918.js b/js/src/jit-test/tests/jaeger/bug719918.js new file mode 100644 index 000000000..388189269 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug719918.js @@ -0,0 +1,17 @@ +function test(m) { + do { + if (m = arr[0]) break; + m = 0; + } + while (0); + arr[1] = m; +} + +arr = new Float64Array(2); + +// run function a lot to trigger methodjit compile +for(var i=0; i<200; i++) + test(0); + +// should return 0, not NaN +assertEq(arr[1], 0) diff --git a/js/src/jit-test/tests/jaeger/bug732423.js b/js/src/jit-test/tests/jaeger/bug732423.js new file mode 100644 index 000000000..caf6d116d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug732423.js @@ -0,0 +1,22 @@ +function testStuff(x, y) { + for (var i = 0; i < 60; i++) { + x[y](); + x[y]; + } +} +testStuff({"elements":function(){}}, "elements"); + +var o = { + res: 0, + f: function() { this.res += 3; }, + __noSuchMethod__: function() { this.res += 5; } +}; + +function testNoSuchMethod(x, y) { + for (var i = 0; i < 60; i++) { + x[y](); + } +} + +testNoSuchMethod(o, "f"); +assertEq(o.res, 180); diff --git a/js/src/jit-test/tests/jaeger/bug735161.js b/js/src/jit-test/tests/jaeger/bug735161.js new file mode 100644 index 000000000..c127253fa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug735161.js @@ -0,0 +1,4 @@ +var obj = {valueOf: function() { "use strict"; undeclared = 7; }}; +try { '' + obj; assertEq(true, false); } catch(e) { } +try { '' + obj; assertEq(true, false); } catch(e) { } +assertEq("undeclared" in this, false); diff --git a/js/src/jit-test/tests/jaeger/bug738525.js b/js/src/jit-test/tests/jaeger/bug738525.js new file mode 100644 index 000000000..0e531fa45 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug738525.js @@ -0,0 +1,37 @@ +// Test IC for getters backed by a JSNative. +function test1() { + for (var i = 0; i < 60; i++) { + assertEq(it.customNative, undefined); + } + + var res = 0; + for (var i = 0; i < 60; i++) { + it.customNative = i; + res += it.customNative; + } + + assertEq(res, 1770); +} +function test2() { + function getValue() { + return it.customNative; + } + + for (var i = 0; i < 60; i++) { + it.customNative = i; + assertEq(getValue(), i); + } + + for (var i = 0; i < 60; i++) { + it.customNative = null; + assertEq(getValue(), null); + + delete it["customNativ" + "e"]; + assertEq(getValue(), undefined); + assertEq(it.customNative, undefined); + } +} +if ("it" in this) { + test1(); + test2(); +} diff --git a/js/src/jit-test/tests/jaeger/bug742393.js b/js/src/jit-test/tests/jaeger/bug742393.js new file mode 100644 index 000000000..76d7d5f1c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug742393.js @@ -0,0 +1,11 @@ +var global = 0; +Object.defineProperty(Array.prototype, "2", {get: function() { return global++; }}); + +function f() { + var a = []; + var b = [0, 1, , 3]; + for (var i=0; i<100; i++) + var c = a.concat(b); + assertEq(c[2], 99); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/bug751320.js b/js/src/jit-test/tests/jaeger/bug751320.js new file mode 100644 index 000000000..2013150aa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug751320.js @@ -0,0 +1,22 @@ +datediff = function(date1, date2, interval) { + var delta = 1; + switch(interval) { + case "day": + delta /= 24; + case "hour": + delta /= 60; + case "minute": + delta /= 60; + case "second": + delta /= 1000; + case "millisecond": + delta *= date2.getTime() - date1.getTime(); + } + return Math.round(delta); +}; + +var diff = datediff(new Date("2012-04-28T14:30:00Z"), new Date("2012-04-29T14:30:00Z"), "day"); +for (var i = 0; i < 50; i++) { + diff = datediff(new Date("2012-04-28T17:00:00Z"), new Date("2012-04-28T17:30:00Z"), "minute"); + assertEq(diff, 30); +} diff --git a/js/src/jit-test/tests/jaeger/bug767961.js b/js/src/jit-test/tests/jaeger/bug767961.js new file mode 100644 index 000000000..b5516bd01 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug767961.js @@ -0,0 +1,6 @@ +function C() { + this.x = this[this.y = "foo"]--; +} + +// Don't crash. +new C; diff --git a/js/src/jit-test/tests/jaeger/bug768313.js b/js/src/jit-test/tests/jaeger/bug768313.js new file mode 100644 index 000000000..106235487 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug768313.js @@ -0,0 +1,6 @@ +// |jit-test| --dump-bytecode + +function f() { } +evaluate('function g() { f(); }'); +for (var i = 0; i < 2; i++) + g(0); diff --git a/js/src/jit-test/tests/jaeger/bug769985.js b/js/src/jit-test/tests/jaeger/bug769985.js new file mode 100644 index 000000000..39c6a056b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug769985.js @@ -0,0 +1,19 @@ + +/* Make sure ints are converted to doubles as needed at the head of loops which modify those ints. */ + +function bar() {} + +function foo() { + var n = 0.5; + n -= 0.5; + var iters = 0; + for (var i = n;; ) { + bar(); + iters++; + if (i == 100) + break; + i = (i + 1) | 0; + } + assertEq(iters, 101); +} +foo(); diff --git a/js/src/jit-test/tests/jaeger/bug771871.js b/js/src/jit-test/tests/jaeger/bug771871.js new file mode 100644 index 000000000..23d91aab2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug771871.js @@ -0,0 +1,7 @@ +function test() { + var box = { call: function () { return 42.1; } }; + for (var i = 0; i < 50; i++) { + assertEq(box.call(undefined, 42.1), 42.1); + } +} +test(); diff --git a/js/src/jit-test/tests/jaeger/bug781859-1.js b/js/src/jit-test/tests/jaeger/bug781859-1.js new file mode 100644 index 000000000..7a28c02b7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug781859-1.js @@ -0,0 +1,25 @@ +// |jit-test| error:ReferenceError +function e() { + try {} catch (e) { + return (actual = "FAIL"); + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x + } + while (t) continue; +} +e(); diff --git a/js/src/jit-test/tests/jaeger/bug781859-2.js b/js/src/jit-test/tests/jaeger/bug781859-2.js new file mode 100644 index 000000000..e738bc088 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug781859-2.js @@ -0,0 +1,8 @@ +Function("\ + switch (/x/) {\ + case 8:\ + break;\ + t(function(){})\ + }\ + while (false)(function(){})\ +")() diff --git a/js/src/jit-test/tests/jaeger/bug781859-3.js b/js/src/jit-test/tests/jaeger/bug781859-3.js new file mode 100644 index 000000000..ab3f39b28 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug781859-3.js @@ -0,0 +1,9 @@ +function e() { + try { + var t = undefined; + } catch (e) { } + while (t) + continue; +} +for (var i = 0; i < 20; i++) + e(); diff --git a/js/src/jit-test/tests/jaeger/bug819035.js b/js/src/jit-test/tests/jaeger/bug819035.js new file mode 100644 index 000000000..c1efd3875 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug819035.js @@ -0,0 +1,38 @@ +// This test case check the difference between fp->callee() and fp->fun() on +// lambdas. +(function (a, u) { + var sum = function (array, callback) { + for (var i = 0; i < array.length; i++) + callback(array[i]); + }; + (function () { + (function r(t) { + t !== u, + sum(t, function (v) r(v) ); + })(arguments); + })(a); +}) ( + [ + [ + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1] + ], [ + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1], + [1], [1], [1], [1], [1], [1], [1], [1], [1], [1] + ] + ] +); diff --git a/js/src/jit-test/tests/jaeger/bug825966.js b/js/src/jit-test/tests/jaeger/bug825966.js new file mode 100644 index 000000000..44e165d33 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug825966.js @@ -0,0 +1,18 @@ +datediff = function(date1, date2, interval) { + var delta = 1; + switch(interval) { + case "day": + delta /= 24; + case "minute": + delta /= 60; + case Math: + break; + } + return delta; +}; + +var diff = datediff(new Date("2012-04-28T14:30:00Z"), new Date("2012-04-29T14:30:00Z"), "day"); +for (var i = 0; i < 50; i++) { + diff = datediff(new Date("2012-04-28T17:00:00Z"), new Date("2012-04-28T17:30:00Z"), "minute"); + assertEq(diff, 1/60); +} diff --git a/js/src/jit-test/tests/jaeger/chunk/bug712267.js b/js/src/jit-test/tests/jaeger/chunk/bug712267.js new file mode 100644 index 000000000..929d4d5b7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/chunk/bug712267.js @@ -0,0 +1,14 @@ +expected = 100; +function slice(a, b) { + return expected--; +} +function f() { + var length = 8.724e02 ; + var index = 0; + function get3() { + return slice(index, ++index); + } + var bytes = null; + while (bytes = get3()) { } +} +f(); diff --git a/js/src/jit-test/tests/jaeger/clonefun.js b/js/src/jit-test/tests/jaeger/clonefun.js new file mode 100644 index 000000000..950ae3922 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/clonefun.js @@ -0,0 +1,17 @@ + +// Functions which have been marked as singletons should not be cloned. + +BeatDetektor = function() +{ + this.config = BeatDetektor.config; + + assertEq(this.config.a, 0); + assertEq(this.config.b, 1); +} + +BeatDetektor.config_default = { a:0, b:1 }; +BeatDetektor.config = BeatDetektor.config_default; + +var bd = new BeatDetektor(); + +assertEq(bd.config === BeatDetektor.config, true); diff --git a/js/src/jit-test/tests/jaeger/closure-01.js b/js/src/jit-test/tests/jaeger/closure-01.js new file mode 100644 index 000000000..4c82b6fd3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/closure-01.js @@ -0,0 +1,18 @@ + +/* Non-reentrant call on an inner and outer closure. */ + +function foo() { + var x = 0; + function bar() { + var y = 0; + function baz() { + return ++x + ++y; + } + return baz; + } + return bar(); +} + +var a = foo(); +var b = foo(); +assertEq(a() + a() + b() + b(), 12); diff --git a/js/src/jit-test/tests/jaeger/closure-02.js b/js/src/jit-test/tests/jaeger/closure-02.js new file mode 100644 index 000000000..902c8f5ae --- /dev/null +++ b/js/src/jit-test/tests/jaeger/closure-02.js @@ -0,0 +1,14 @@ + +/* Non-reentrant closure used in an invoke session. */ + +var last = null; + +var a = [1,2,3,4,5,6,7,8]; +var b = a.map(function(x) { + x++; + var res = last ? last() : 0; + last = function() { return x; }; + return res; + }); + +assertEq("" + b, "0,2,3,4,5,6,7,8"); diff --git a/js/src/jit-test/tests/jaeger/closure-03.js b/js/src/jit-test/tests/jaeger/closure-03.js new file mode 100644 index 000000000..e2d1ebe3f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/closure-03.js @@ -0,0 +1,15 @@ + +/* Recovering non-reentrant information on singletons after a GC. */ + +function foo(a) { + return function() { + gc(); + var n = 0; + for (var i = 0; i < 20; i++) + n = a++; + assertEq(n, 29); + }; +} +var a = foo(10); +var b = foo(20); +a(); diff --git a/js/src/jit-test/tests/jaeger/closure-04.js b/js/src/jit-test/tests/jaeger/closure-04.js new file mode 100644 index 000000000..9106e43f4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/closure-04.js @@ -0,0 +1,30 @@ +var depth = 0; +test(); +function test() { + // |test()| is called recursively. When the generator runs in the JIT, the + // recursion limit is ~20x higher than in the interpreter. Limit the depth + // here so that the test doesn't timeout or becomes extremely slow. + if (++depth > 400) + return; + + var catch1, catch2, catch3, finally1, finally2, finally3; + function gen() { + yield 1; + try { + try { + try { + yield 1; + } finally { + test(); + } + } catch (e) { + finally2 = true; + } + } catch (e) { } + } + iter = gen(); + iter.next(); + iter.next(); + iter.close(); + gc(); +} diff --git a/js/src/jit-test/tests/jaeger/closure-05.js b/js/src/jit-test/tests/jaeger/closure-05.js new file mode 100644 index 000000000..b2aeffa36 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/closure-05.js @@ -0,0 +1,17 @@ +var gTestcases = new Array(); +var gTc = gTestcases.length; +function TestCase(n, d, e, a) { + gTestcases[gTc++] = this; +} +new TestCase("SECTION", "with MyObject, eval should return square of "); +test(); +function test() { + for (gTc = 0; gTc < gTestcases.length; gTc++) { + var MYOBJECT = (function isPrototypeOf(message) { + delete input; + })(); + with({}) { + gTestcases[gTc].actual = eval(""); + } + } +} diff --git a/js/src/jit-test/tests/jaeger/compare-wrong-1.js b/js/src/jit-test/tests/jaeger/compare-wrong-1.js new file mode 100644 index 000000000..dec3ada45 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/compare-wrong-1.js @@ -0,0 +1,4 @@ +function f(a) { return a; } +assertEq(print < f, false); +assertEq(print > f, true); + diff --git a/js/src/jit-test/tests/jaeger/crash-on-compare.js b/js/src/jit-test/tests/jaeger/crash-on-compare.js new file mode 100644 index 000000000..5abd7aa04 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/crash-on-compare.js @@ -0,0 +1 @@ +assertEq(Infinity >= Infinity ? true : false, true); diff --git a/js/src/jit-test/tests/jaeger/deepBailAfterRunTracer.js b/js/src/jit-test/tests/jaeger/deepBailAfterRunTracer.js new file mode 100644 index 000000000..63399a474 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/deepBailAfterRunTracer.js @@ -0,0 +1,25 @@ +var o = { }; +for (var i = 0; i <= 50; i++) + o[i] = i; + +Object.defineProperty(o, "51", { get: assertEq }); + +var threw = 0; +function g(o, i) { + try { + assertEq(o[i], i); + } catch (e) { + threw++; + } +} + +function f() { + for (var i = 0; i <= 51; i++) + g(o, i); +} + +f(); +f(); +f(); +assertEq(threw, 3); + diff --git a/js/src/jit-test/tests/jaeger/floatTypedArrays.js b/js/src/jit-test/tests/jaeger/floatTypedArrays.js new file mode 100644 index 000000000..51ea7c0a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/floatTypedArrays.js @@ -0,0 +1,64 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testFloat32Array(L) { + var f = new Float32Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13.5; + f[2] = f[1]; + f[L+3] = 4294967295; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13.5); + assertEq(f[2], 13.5); + assertEq(f[3], 4294967296); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testFloat64Array(L) { + var f = new Float64Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13.5; + f[2] = f[1]; + f[L+3] = 4294967295; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13.5); + assertEq(f[2], 13.5); + assertEq(f[3], 4294967295); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testNaNCanonicalization() { + var buf = new ArrayBuffer(128); + + var u8 = new Uint8Array(buf); + for (var i = 0; i < 128; i++) + u8[i] = 0xFF; + + var dblarr = new Float64Array(buf); + var asstr = dblarr[0] + ""; + var asnum = dblarr[0] + 0.0; + assertEq(asstr, "NaN"); + assertEq(asnum, NaN); +} + +for (var i = 0; i < 10; i++) { + //testFloat32Array(0); + //testFloat64Array(0); + testNaNCanonicalization(); + if (i == 5) + gc(); +} + diff --git a/js/src/jit-test/tests/jaeger/fromCharCode.js b/js/src/jit-test/tests/jaeger/fromCharCode.js new file mode 100644 index 000000000..971878372 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/fromCharCode.js @@ -0,0 +1,8 @@ +/* +* Any copyright is dedicated to the Public Domain. +* http://creativecommons.org/licenses/publicdomain/ +*/ + +for (var i = 0; i <= 0xFFFF; i++) { + assertEq(String.fromCharCode(i).charCodeAt(0), i); +} diff --git a/js/src/jit-test/tests/jaeger/fused-eq-ifeq.js b/js/src/jit-test/tests/jaeger/fused-eq-ifeq.js new file mode 100644 index 000000000..b5d2bf2f6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/fused-eq-ifeq.js @@ -0,0 +1,6 @@ +function ack(m,n){ + if (m==0) { return n+1; } + if (n==0) { return ack(m-1,1); } + return ack(m-1, ack(m,n-1) ); +} +assertEq(ack(3, 3), 61); diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-1.js b/js/src/jit-test/tests/jaeger/getelem-sanity-1.js new file mode 100644 index 000000000..4bad91ecc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-1.js @@ -0,0 +1,9 @@ +var obj = {attr: 'value'}; + +(function() { + var name = 'attr'; + for (var i = 0; i < 10; ++i) + assertEq(obj[name], 'value'); +})(); + +/* Look up a string id. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-2.js b/js/src/jit-test/tests/jaeger/getelem-sanity-2.js new file mode 100644 index 000000000..399219b48 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-2.js @@ -0,0 +1,22 @@ +var obj = {firstAttr: 'value', secondAttr: 'another value'}; + +(function() { + for (var i = 0; i < 12; ++i) { + var name; + if (i < 4) + name = 'firstAttr'; + else if (i < 8) + name = 'secondAttr'; + else + name = 'firstAttr'; + + var result = obj[name]; + + switch (name) { + case 'firstAttr': assertEq(result, 'value'); break; + case 'secondAttr': assertEq(result, 'another value'); break; + } + } +})(); + +/* Toggle lookup between two ids. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-3.js b/js/src/jit-test/tests/jaeger/getelem-sanity-3.js new file mode 100644 index 000000000..4b5b87900 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-3.js @@ -0,0 +1,22 @@ +var obj = {firstAttr: 'value', secondAttr: 'another value', thirdAttr: 'the last value'}; + +(function() { + for (var i = 0; i < 64; ++i) { + var name; + switch (~~(i / 4) % 3) { + case 0: name = 'firstAttr'; break; + case 1: name = 'secondAttr'; break; + case 2: name = 'thirdAttr'; break; + } + + var result = obj[name]; + + switch (name) { + case 'firstAttr': assertEq(result, 'value'); break; + case 'secondAttr': assertEq(result, 'another value'); break; + case 'thirdAttr': assertEq(result, 'the last value'); break; + } + } +})(); + +/* Rotate lookup between three ids. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-4.js b/js/src/jit-test/tests/jaeger/getelem-sanity-4.js new file mode 100644 index 000000000..983713376 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-4.js @@ -0,0 +1,51 @@ +var obj = { + attr0: 'val0', + attr1: 'val1', + attr2: 'val2', + attr3: 'val3', + attr4: 'val4', + attr5: 'val5', + attr6: 'val6', + attr7: 'val7', + attr8: 'val8', + attr9: 'val9', + attr10: 'val10', + attr11: 'val11', + attr12: 'val12', + attr13: 'val13', + attr14: 'val14', + attr15: 'val15', + attr16: 'val16', + attr17: 'val17', +} + +var baseName = 'attr'; + +(function() { + for (var i = 0; i < 128; ++i) { + var name = baseName + (i % 18); + var result = obj[name]; + switch (i) { + case 0: assertEq('val0', result); break; + case 1: assertEq('val1', result); break; + case 2: assertEq('val2', result); break; + case 3: assertEq('val3', result); break; + case 4: assertEq('val4', result); break; + case 5: assertEq('val5', result); break; + case 6: assertEq('val6', result); break; + case 7: assertEq('val7', result); break; + case 8: assertEq('val8', result); break; + case 9: assertEq('val9', result); break; + case 10: assertEq('val10', result); break; + case 11: assertEq('val11', result); break; + case 12: assertEq('val12', result); break; + case 13: assertEq('val13', result); break; + case 14: assertEq('val14', result); break; + case 15: assertEq('val15', result); break; + case 16: assertEq('val16', result); break; + case 17: assertEq('val17', result); break; + } + } +})(); + +/* Megamorphic index atom. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-5.js b/js/src/jit-test/tests/jaeger/getelem-sanity-5.js new file mode 100644 index 000000000..e82547153 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-5.js @@ -0,0 +1,4 @@ +var x = { 0: 5, 1: 5 }; +assertEq(x[0] + x[1], 10); + +/* int32_t getelem on object. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-6.js b/js/src/jit-test/tests/jaeger/getelem-sanity-6.js new file mode 100644 index 000000000..693453d69 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-6.js @@ -0,0 +1,4 @@ +var x = {1: 2, 3: 4}; +assertEq(x[1], 2); + +/* getelem with non-dense array and known type int32. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-7.js b/js/src/jit-test/tests/jaeger/getelem-sanity-7.js new file mode 100644 index 000000000..483d8b558 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-7.js @@ -0,0 +1,10 @@ +var obj = {count: 24}; +var key = 'count'; + +for (var i = 0; i < 1024; ++i) { + var result = obj[key]; + if (i === 2) + obj.newAttr = 42; +} + +/* Perform getelem across shape change. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-8.js b/js/src/jit-test/tests/jaeger/getelem-sanity-8.js new file mode 100644 index 000000000..f203216ac --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-8.js @@ -0,0 +1,13 @@ + +// TI does not account for GETELEM accessing strings, so the GETELEM PIC must +// update type constraints according to generated stubs. +function foo(a, b) { + for (var j = 0; j < 5; j++) + a[b[j]] + " what"; +} +var a = {a:"zero", b:"one", c:"two", d:"three", e:"four"}; +var b = ["a", "b", "c", "d", "e"]; +foo(a, b); +foo(a, b); +a.e = 4; +foo(a, b); diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js b/js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js new file mode 100644 index 000000000..d278a97dc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js @@ -0,0 +1,7 @@ +var arr = ['this', 'works', 'for', 'me']; +assertEq('this', arr[0]); +assertEq('works', arr[1]); +assertEq('for', arr[2]); +assertEq('me', arr[3]); + +/* Multiple int32_t getelem for dense array. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js b/js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js new file mode 100644 index 000000000..add4568ef --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js @@ -0,0 +1,12 @@ +var arr = ['this', 'works', 'for', 'me']; +for (var i = 0; i < arr.length; ++i) { + var result = arr[i]; + switch (i) { + case 0: assertEq('this', result); break; + case 1: assertEq('works', result); break; + case 2: assertEq('for', result); break; + case 3: assertEq('me', result); break; + } +} + +/* int32_t getelem for dense array. */ diff --git a/js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js b/js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js new file mode 100644 index 000000000..91fb50f50 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js @@ -0,0 +1,19 @@ +var a = [1, 2]; +a[3.1415926535] = 'value'; + +for (var i = 0; i < 3; i++) { + var attr; + switch (i) { + case 0: attr = 0; break; + case 1: attr = 1; break; + case 2: attr = 3.1415926535; break; + } + var result = a[attr]; + switch (i) { + case 0: assertEq(result, 1); break; + case 1: assertEq(result, 2); break; + case 2: assertEq(result, 'value'); break; + } +} + +/* int32_t and string getelem for non-dense array. */ diff --git a/js/src/jit-test/tests/jaeger/getter-hook-1.js b/js/src/jit-test/tests/jaeger/getter-hook-1.js new file mode 100644 index 000000000..29ab9552e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getter-hook-1.js @@ -0,0 +1,18 @@ +// GETPROP PIC with multiple stubs containing getter hooks. + +function foo(arr) { + for (var i = 0; i < 100; i++) + arr[i].caller; +} +arr = Object.create(Object.prototype); +first = Object.create({}); +first.caller = null; +second = Object.create({}); +second.caller = null; +for (var i = 0; i < 100; ) { + arr[i++] = first; + arr[i++] = foo; + arr[i++] = second; +} +foo.caller; +foo(arr); diff --git a/js/src/jit-test/tests/jaeger/getter-hook-2.js b/js/src/jit-test/tests/jaeger/getter-hook-2.js new file mode 100644 index 000000000..4361ce126 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/getter-hook-2.js @@ -0,0 +1,19 @@ +// PIC on CALLPROP invoking getter hook. + +function foo(arr) { + for (var i = 0; i < 100; i++) + arr[i].caller(false); +} +arr = Object.create(Object.prototype); +first = Object.create({}); +first.caller = bar; +second = Object.create({}); +second.caller = bar; +for (var i = 0; i < 100; ) + arr[i++] = foo; +foo.caller; +function bar(x) { + if (x) + foo(arr); +} +bar(true); diff --git a/js/src/jit-test/tests/jaeger/globalOptimize-1.js b/js/src/jit-test/tests/jaeger/globalOptimize-1.js new file mode 100644 index 000000000..f90114c33 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/globalOptimize-1.js @@ -0,0 +1,5 @@ +/* Test that NaN does not trigger js_InitMathClass & constants while parsing. */ +var NaN + +var x = 2; + diff --git a/js/src/jit-test/tests/jaeger/globalOptimize-2.js b/js/src/jit-test/tests/jaeger/globalOptimize-2.js new file mode 100644 index 000000000..2756ec5a3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/globalOptimize-2.js @@ -0,0 +1,10 @@ + +x = 30; +function foo() { + assertEq(x, 30); + delete x; + y = 20; + Object.defineProperty(this, 'x', {value:10}); + assertEq(x, 10); +} +foo(); diff --git a/js/src/jit-test/tests/jaeger/globalOptimize-4.js b/js/src/jit-test/tests/jaeger/globalOptimize-4.js new file mode 100644 index 000000000..5df15f55a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/globalOptimize-4.js @@ -0,0 +1,8 @@ + +x = 30; +assertEq(x, 30); + +for (var i = 0; i < 10000; i++) + this[i] = 0; + +assertEq(x, 30); diff --git a/js/src/jit-test/tests/jaeger/in.js b/js/src/jit-test/tests/jaeger/in.js new file mode 100644 index 000000000..a179d60ec --- /dev/null +++ b/js/src/jit-test/tests/jaeger/in.js @@ -0,0 +1,21 @@ +function f(arr, b) { + var res = ""; + var a; + if (b) + a = arr; + for (var i=100; i>-200; i--) { + if (i in a) { + res += i; + } + } + return res; +} + +assertEq(f([1, , 2, 3], true), "320"); + +try { + f([1, , 2, 3], false); + assertEq(0, 1); +} catch(e) { + assertEq(e instanceof TypeError, true); +} diff --git a/js/src/jit-test/tests/jaeger/inline/bug645645.js b/js/src/jit-test/tests/jaeger/inline/bug645645.js new file mode 100644 index 000000000..6649b559e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug645645.js @@ -0,0 +1,4 @@ +function f() { + f = Math.x; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/inline/bug645666.js b/js/src/jit-test/tests/jaeger/inline/bug645666.js new file mode 100644 index 000000000..34fd6822a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug645666.js @@ -0,0 +1,16 @@ +function f1() { + gc(); +} +function f2() { + with(this) {}; + f1(); +} +function f3() { + f2(); +} +function f4() { + f3(); +} +f3(); +f3(); +f4(); diff --git a/js/src/jit-test/tests/jaeger/inline/bug646004.js b/js/src/jit-test/tests/jaeger/inline/bug646004.js new file mode 100644 index 000000000..8ffb4bd55 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug646004.js @@ -0,0 +1,9 @@ +function reportCompare (expected, actual, description) {} +function f() +{ + f(f, 0x09AA, 0x09B0, f); +} +try { + reportCompare ("outer", f(), + "Inner function statement should not have been called."); +} catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/inline/bug646480.js b/js/src/jit-test/tests/jaeger/inline/bug646480.js new file mode 100644 index 000000000..e870e33ef --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug646480.js @@ -0,0 +1,7 @@ +if (true) + function f1() {}; +function f2() { + var y = -8; + return y % 2; +} +f2() / 3; diff --git a/js/src/jit-test/tests/jaeger/inline/bug647973.js b/js/src/jit-test/tests/jaeger/inline/bug647973.js new file mode 100644 index 000000000..c19797a24 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug647973.js @@ -0,0 +1,11 @@ +function f(a1, a2, a3, a4) { +} +function g(a1, a2) { + var d = new Date(0); + f(); + assertEq(typeof d, 'object'); +} +g(); +gc(); +f(2, 2, 2, f(2, 2, 2, 12 === 12)); +g(false, false); diff --git a/js/src/jit-test/tests/jaeger/inline/bug651209.js b/js/src/jit-test/tests/jaeger/inline/bug651209.js new file mode 100644 index 000000000..27e14a17b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug651209.js @@ -0,0 +1,11 @@ +var i = 0; +try { test(); } catch (e) { } +function test() { + var jstop = 900; + var code = ''; + code+=createCode(i); + eval(); +} +function createCode(i) { + jstop+= + + + i + " string.';"; +} diff --git a/js/src/jit-test/tests/jaeger/inline/bug655954.js b/js/src/jit-test/tests/jaeger/inline/bug655954.js new file mode 100644 index 000000000..f57488b95 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug655954.js @@ -0,0 +1,5 @@ +// |jit-test| error: TypeError +foo(); +function foo() { + this(); +} diff --git a/js/src/jit-test/tests/jaeger/inline/bug656221.js b/js/src/jit-test/tests/jaeger/inline/bug656221.js new file mode 100644 index 000000000..8319bcf83 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug656221.js @@ -0,0 +1,5 @@ +function f() { + var a = []; + a.push(a); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/inline/bug676491.js b/js/src/jit-test/tests/jaeger/inline/bug676491.js new file mode 100644 index 000000000..82e6095a0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug676491.js @@ -0,0 +1,14 @@ +Array.prototype.__defineSetter__(32, function() { print("Hello from arbitrary JS");}); +var UBound = 0; +var expect= ''; +var expectedvalues = []; +for (var j=0; j < 10; j++) { + addThis(); + addThis(); + addThis(); + addThis(); +} +function addThis() { + expectedvalues[UBound] = expect; + UBound++; +} diff --git a/js/src/jit-test/tests/jaeger/inline/bug680759.js b/js/src/jit-test/tests/jaeger/inline/bug680759.js new file mode 100644 index 000000000..975f9e3b7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/bug680759.js @@ -0,0 +1,14 @@ + +TryToCatch(); +TryToCatch(); +function Thrower( v ) { + throw "Caught"; +} +function Eval( v ) { + SECTION : Thrower(TryToCatch, v, ': 3') +} +function TryToCatch( value, expect ) { + try { + Eval( value ) + } catch (e) { } +} diff --git a/js/src/jit-test/tests/jaeger/inline/doubleArg.js b/js/src/jit-test/tests/jaeger/inline/doubleArg.js new file mode 100644 index 000000000..bd4422599 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/doubleArg.js @@ -0,0 +1,10 @@ +function foo(x, y) { + if (y < 0) {} + return x * 1000; +} +function bar(x, y) { + while (false) {} + assertEq(foo(x, false), 10500); + assertEq(foo(y, false), 11000); +} +bar(10.5, 11); diff --git a/js/src/jit-test/tests/jaeger/inline/mathAbs.js b/js/src/jit-test/tests/jaeger/inline/mathAbs.js new file mode 100644 index 000000000..b1d077add --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/mathAbs.js @@ -0,0 +1,31 @@ + +assertEq(Math.abs(-10), 10); +assertEq(Math.abs(-2147483648), 2147483648); +assertEq(Math.abs(2147483648), 2147483648); +assertEq(Math.abs(-0), 0); +assertEq(Math.abs(0), 0); +assertEq(Math.abs(-3.14), 3.14); +assertEq(Math.abs(NaN), NaN); + +/* Inferred as abs(int). */ +function abs1(x) { + return Math.abs(x); +} +assertEq(abs1(1), 1); +assertEq(abs1(-1), 1); +assertEq(abs1(0), 0); +assertEq(abs1(-123) + abs1(234), 357); +assertEq(abs1(-2147483648), 2147483648); // recompile to return double +assertEq(abs1(-2), 2); + +/* Inferred as abs(double). */ +function abs2(x) { + return Math.abs(x); +} +assertEq(abs2(-2.2), 2.2); +assertEq(abs2(123), 123); +assertEq(abs2(-456), 456); +assertEq(abs2(-0), 0); +assertEq(abs2(1.3), 1.3); +assertEq(abs2(NaN), NaN); + diff --git a/js/src/jit-test/tests/jaeger/inline/mathFloor.js b/js/src/jit-test/tests/jaeger/inline/mathFloor.js new file mode 100644 index 000000000..1419beb9f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/mathFloor.js @@ -0,0 +1,34 @@ + +assertEq(Math.floor(3.14), 3); +assertEq(Math.floor(-0), -0); +assertEq(Math.floor(0), 0); +assertEq(Math.floor(-1.23), -2); +assertEq(Math.floor(2147483649), 2147483649); +assertEq(Math.floor(2147483648.5), 2147483648); +assertEq(Math.floor(2147483647.1), 2147483647); + +/* Inferred as floor(double). */ +function floor1(x) { + return Math.floor(x); +} +assertEq(floor1(10.3), 10); +assertEq(floor1(-3.14), -4); +assertEq(floor1(-0), -0); // recompile to return double +assertEq(floor1(678.3), 678); + +/* Inferred as floor(double). */ +function floor2(x) { + return Math.floor(x); +} +assertEq(floor2(3.4), 3); +assertEq(floor2(NaN), NaN); // recompile to return double +assertEq(floor2(-4.4), -5); + +/* Inferred as floor(int). */ +function floor3(x) { + return Math.floor(x); +} +assertEq(floor3(4), 4); +assertEq(floor3(-5), -5); +assertEq(floor3(0), 0); + diff --git a/js/src/jit-test/tests/jaeger/inline/mathPow.js b/js/src/jit-test/tests/jaeger/inline/mathPow.js new file mode 100644 index 000000000..717e087c9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/mathPow.js @@ -0,0 +1,35 @@ + +assertEq(Math.pow(100, 2), 10000); +assertEq(Math.pow(-Infinity, -0.5), 0); +assertEq(Math.pow(-Infinity, 0.5), Infinity); +assertEq(Math.pow(Infinity, -0.5), 0); +assertEq(Math.pow(Infinity, 0.5), Infinity); +assertEq(Math.pow(NaN, -0.5), NaN); +assertEq(Math.pow(NaN, 0.5), NaN); +assertEq(Math.pow(-3.14, -0.5), NaN); +assertEq(Math.pow(-1.23, 0.5), NaN); +assertEq(Math.pow(-0, -0.5), Infinity); +assertEq(Math.pow(-0, 0.5), 0); +assertEq(Math.pow(-1, -0.5), NaN); +assertEq(Math.pow(-1, 0.5), NaN); +assertEq(Math.pow(0, -0.5), Infinity); +assertEq(Math.pow(0, 0.5), 0); +assertEq(Math.pow(1, -0.5), 1); +assertEq(Math.pow(1, 0.5), 1); +assertEq(Math.pow(100, -0.5), 0.1); +assertEq(Math.pow(100, 0.5), 10); + +/* Inferred as pow(double, double). */ +function pow1(x) { + return Math.pow(x, 0.5); +} +assertEq(pow1(100), 10); +assertEq(pow1(144), 12); +assertEq(pow1(-0), 0); +assertEq(pow1(0), 0); +assertEq(pow1(1), 1); +assertEq(pow1(-1), NaN); +assertEq(pow1(NaN), NaN); +assertEq(pow1(-Infinity), Infinity); +assertEq(pow1(Infinity), Infinity); + diff --git a/js/src/jit-test/tests/jaeger/inline/mathRound.js b/js/src/jit-test/tests/jaeger/inline/mathRound.js new file mode 100644 index 000000000..60a59e202 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/mathRound.js @@ -0,0 +1,41 @@ + +assertEq(Math.round(3.14), 3); +assertEq(Math.round(0.5), 1); +assertEq(Math.round(-0), -0); +assertEq(Math.round(0), 0); +assertEq(Math.round(-1.03), -1); +assertEq(Math.round(2147483649), 2147483649); +assertEq(Math.round(2147483647.5), 2147483648); +assertEq(Math.floor(2147483647.1), 2147483647); + +/* Inferred as round(double). */ +function round1(x) { + return Math.round(x); +} +assertEq(round1(10.3), 10); +assertEq(round1(-3.14), -3); +assertEq(round1(-3.5), -3); +assertEq(round1(-3.6), -4); +assertEq(round1(3.5), 4); +assertEq(round1(3.6), 4); +assertEq(round1(0), 0); +assertEq(round1(-0), -0); // recompile to return double +assertEq(round1(12345), 12345); +assertEq(round1(654.6), 655); + +/* Inferred as round(double). */ +function round2(x) { + return Math.round(x); +} +assertEq(round2(1234.5), 1235); +assertEq(round2(NaN), NaN); // recompile to return double +assertEq(round2(4.6), 5); + +/* Inferred as round(int). */ +function round3(x) { + return Math.round(x); +} +assertEq(round3(4), 4); +assertEq(round3(-5), -5); +assertEq(round3(0), 0); + diff --git a/js/src/jit-test/tests/jaeger/inline/mathSqrt.js b/js/src/jit-test/tests/jaeger/inline/mathSqrt.js new file mode 100644 index 000000000..340149942 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/mathSqrt.js @@ -0,0 +1,29 @@ + +assertEq(Math.sqrt(-Infinity), NaN); +assertEq(Math.sqrt(-3.14), NaN); +assertEq(Math.sqrt(-2), NaN); +assertEq(Math.sqrt(-0), -0); +assertEq(Math.sqrt(0), 0); +assertEq(Math.sqrt(2), Math.SQRT2); +assertEq(Math.sqrt(49), 7); +assertEq(Math.sqrt(Infinity), Infinity); + +/* Inferred as sqrt(double). */ +function sqrt1(x) { + return Math.sqrt(x); +} +assertEq(sqrt1(NaN), NaN); +assertEq(sqrt1(-Infinity), NaN); +assertEq(sqrt1(Infinity), Infinity); +assertEq(sqrt1(-0), -0); +assertEq(sqrt1(2), Math.SQRT2); +assertEq(sqrt1(16), 4); + +/* Inferred as sqrt(int). */ +function sqrt2(x) { + return Math.sqrt(x); +} +assertEq(sqrt2(4), 2); +assertEq(sqrt2(169), 13); +assertEq(sqrt2(0), 0); + diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-01.js b/js/src/jit-test/tests/jaeger/inline/scripted-01.js new file mode 100644 index 000000000..f6a585d05 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-01.js @@ -0,0 +1,17 @@ +function bar(x, y) { + return x + y; +} + +function foo(x, y) { + var a = 0; + for (var i = 0; i < 1000; i++) { + a += bar(x, y); + a += bar(x, y); + a += bar(x, y); + a += bar(x, y); + } + return a; +} + +var q = foo(0, 1); +assertEq(q, 4000); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-02.js b/js/src/jit-test/tests/jaeger/inline/scripted-02.js new file mode 100644 index 000000000..fede7f494 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-02.js @@ -0,0 +1,22 @@ +function getter(a, i) { + return a[i]; +} + +function foo(a, n) { + var res = 0; + for (var i = 0; i < 10; i++) { + res = 0; + for (var j = 0; j < n; j++) { + res += getter(a, j); + } + } + return res; +} + +var n = 100; +var a = Array(n); +for (var i = 0; i < n; i++) + a[i] = i; + +var q = foo(a, n); +assertEq(q, 4950); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-03.js b/js/src/jit-test/tests/jaeger/inline/scripted-03.js new file mode 100644 index 000000000..f54c1c66d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-03.js @@ -0,0 +1,14 @@ +function choose(x, y, z) { + return x ? y : z; +} + +function foo(x, y, z) { + var a = 0; + for (var i = 0; i < 100; i++) { + a += choose(x, y, z); + } + return a; +} + +var q = foo(true, 10, 0); +assertEq(q, 1000); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-04.js b/js/src/jit-test/tests/jaeger/inline/scripted-04.js new file mode 100644 index 000000000..d2f8535bc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-04.js @@ -0,0 +1,12 @@ +function adder(x, y) { + return x + y; +} + +function foo(x) { + for (var i = 0; i < 100; i++) + var a = adder(x, i); + return a; +} + +var q = foo(0x7ffffff0); +assertEq(q, 2147483731); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-05.js b/js/src/jit-test/tests/jaeger/inline/scripted-05.js new file mode 100644 index 000000000..b763fb364 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-05.js @@ -0,0 +1,13 @@ +function adder(x, y) { + return Math.floor(x + y); +} + +function foo(x) { + for (var i = 0; i < 100; i++) { + var a = adder(x, i); + } + return a; +} + +var q = foo(0x7ffffff0 + .5); +assertEq(q, 2147483731); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-06.js b/js/src/jit-test/tests/jaeger/inline/scripted-06.js new file mode 100644 index 000000000..074bb5201 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-06.js @@ -0,0 +1,17 @@ +function popper(a) { + return a.pop(); +} + +function foo(x) { + for (var i = 0; i < 10; i++) { + var q = popper(x); + if (i < 5) + assertEq(q, 5 - i); + else + assertEq(q, undefined); + } + return q; +} + +var q = foo([1,2,3,4,5]); +assertEq(q, undefined); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-07.js b/js/src/jit-test/tests/jaeger/inline/scripted-07.js new file mode 100644 index 000000000..dfe076a65 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-07.js @@ -0,0 +1,15 @@ +function multiple(a) { + if (a > 10) + return 1; + return 0; +} + +function foo(x) { + var a = 0; + for (var i = 0; i < 100; i++) + a += multiple(i); + return a; +} + +var q = foo([1,2,3,4,5]); +assertEq(q, 89); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-08.js b/js/src/jit-test/tests/jaeger/inline/scripted-08.js new file mode 100644 index 000000000..22198388e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-08.js @@ -0,0 +1,21 @@ +function first(a, b) { + return second(a, b); +} + +function second(a, b) { + return third(a, b, a + b); +} + +function third(a, b, c) { + return a + b + c; +} + +function foo(x) { + var a = 0; + for (var i = 0; i < 100; i++) + a += first(x, i); + return a; +} + +var q = foo(10); +assertEq(q, 11900); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-09.js b/js/src/jit-test/tests/jaeger/inline/scripted-09.js new file mode 100644 index 000000000..e970b77e4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-09.js @@ -0,0 +1,19 @@ +function multiple(a) { + if (a > 10) + return a * 20; + return 0; +} + +function deeper(a, b) { + return multiple(a + b); +} + +function foo() { + var a = 0; + for (var i = 0; i < 10; i++) + a += deeper(0x7ffffff0, i); + return a; +} + +var q = foo(); +assertEq(q, 429496727300); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-10.js b/js/src/jit-test/tests/jaeger/inline/scripted-10.js new file mode 100644 index 000000000..492d055e8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-10.js @@ -0,0 +1,13 @@ +function copied(x, y) { + return x + y; +} + +function foo(x) { + var a = 0; + for (var i = 0; i < 100; i++) + a += copied(x, x); + return a; +} + +var q = foo(5); +assertEq(q, 1000); diff --git a/js/src/jit-test/tests/jaeger/inline/scripted-11.js b/js/src/jit-test/tests/jaeger/inline/scripted-11.js new file mode 100644 index 000000000..750add398 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/scripted-11.js @@ -0,0 +1,12 @@ +what = 0; + +function f(x) { + g(x); +} + +function g(x) { + eval("what = true"); +} + +f(10); +assertEq(what, true); diff --git a/js/src/jit-test/tests/jaeger/inline/stringCharAt.js b/js/src/jit-test/tests/jaeger/inline/stringCharAt.js new file mode 100644 index 000000000..bf2bbbd67 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/stringCharAt.js @@ -0,0 +1,49 @@ + +assertEq("foo".charAt(-123), ""); +assertEq("foo".charAt(-1), ""); +assertEq("foo".charAt(0), "f"); +assertEq("foo".charAt(1), "o"); +assertEq("foo".charAt(2), "o"); +assertEq("foo".charAt(3.4), ""); +assertEq("foo".charAt(), "f"); +assertEq("".charAt(), ""); +assertEq("".charAt(0), ""); +assertEq("abc\u9123".charAt(3), "\u9123"); // char without unit string + +/* Inferred as string.charAt(int). */ +function charAt1(x) { + return "abc".charAt(x); +} +assertEq(charAt1(-1), ""); +assertEq(charAt1(0), "a"); +assertEq(charAt1(1), "b"); +assertEq(charAt1(2), "c"); +assertEq(charAt1(3), ""); +assertEq(charAt1(1234), ""); + +/* Inferred as string.charAt(double). */ +function charAt2(x) { + return "abc".charAt(x); +} +assertEq(charAt2(-1.3), ""); +assertEq(charAt2(-0), "a"); +assertEq(charAt2(2), "c"); +assertEq(charAt2(2.3), "c"); +assertEq(charAt2(3.14), ""); +assertEq(charAt2(NaN), "a"); + +/* Test ropes. */ +function charAt3(s, i) { + var s2 = "abcdef" + s + "12345"; + return s2.charAt(i); +} +assertEq(charAt3("abcdef", 14), "3"); +assertEq(charAt3("a" + "b", 1), "b"); +assertEq(charAt3("abcdefg" + "hijklmnop", 10), "e"); + +/* Other 'this'. */ +var arr = [1, 2]; +arr.charAt = String.prototype.charAt; +assertEq(arr.charAt(1), ","); + + diff --git a/js/src/jit-test/tests/jaeger/inline/stringCharCodeAt.js b/js/src/jit-test/tests/jaeger/inline/stringCharCodeAt.js new file mode 100644 index 000000000..3f0bfe2cf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/stringCharCodeAt.js @@ -0,0 +1,47 @@ + +assertEq("foo".charCodeAt(-123), NaN); +assertEq("foo".charCodeAt(-0), 102); +assertEq("foo".charCodeAt(0), 102); +assertEq("foo".charCodeAt(2), 111); +assertEq("foo".charCodeAt(3.4), NaN); +assertEq("foo".charCodeAt(), 102); +assertEq("".charCodeAt(), NaN); +assertEq("".charCodeAt(0), NaN); + +/* Inferred as string.charCodeAt(int). */ +function charCodeAt1(x) { + return "abc".charCodeAt(x); +} +assertEq(charCodeAt1(-1), NaN); +assertEq(charCodeAt1(0), 97); +assertEq(charCodeAt1(1), 98); +assertEq(charCodeAt1(2), 99); +assertEq(charCodeAt1(3), NaN); +assertEq(charCodeAt1(1234), NaN); + +/* Inferred as string.charCodeAt(double). */ +function charCodeAt2(x) { + return "abc".charCodeAt(x); +} +assertEq(charCodeAt2(-1.3), NaN); +assertEq(charCodeAt2(-0), 97); +assertEq(charCodeAt2(2), 99); +assertEq(charCodeAt2(2.3), 99); +assertEq(charCodeAt2(3.14), NaN); +assertEq(charCodeAt2(NaN), 97); + +/* Test ropes. */ +function charCodeAt3(s, i) { + var s2 = "abcdef" + s + "12345"; + return s2.charCodeAt(i); +} +assertEq(charCodeAt3("abcdef", 14), 51); +assertEq(charCodeAt3("a" + "b", 1), 98); +assertEq(charCodeAt3("abcdefg" + "hijklmnop", 10), 101); + +/* Other 'this'. */ +var n = new Number(123); +n.charCodeAt = String.prototype.charCodeAt; +assertEq(n.charCodeAt(1), 50); + + diff --git a/js/src/jit-test/tests/jaeger/inline/undefinedLocal.js b/js/src/jit-test/tests/jaeger/inline/undefinedLocal.js new file mode 100644 index 000000000..f6fb12996 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/inline/undefinedLocal.js @@ -0,0 +1,19 @@ + +function bar(n) { + var a; + if (n < 50) + a = n; + return a; +} + +function foo() { + for (var i = 0; i < 100; i++) { + var q = bar(i); + if (i < 50) + assertEq(q, i); + else + assertEq(q, undefined); + } +} + +foo(); diff --git a/js/src/jit-test/tests/jaeger/instanceOfWithKnownTypes.js b/js/src/jit-test/tests/jaeger/instanceOfWithKnownTypes.js new file mode 100644 index 000000000..0ca3dc8d9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/instanceOfWithKnownTypes.js @@ -0,0 +1,13 @@ +// |jit-test| error: TypeError + +// Verify that the compiler doesn't assert. + +function f() { + var o = {}, p = {}; + z = o instanceof p; + z = 3 instanceof p; + z = p instanceof 3; + z = 3 instanceof 4; +} + +f(); diff --git a/js/src/jit-test/tests/jaeger/invokeSessionGuard.js b/js/src/jit-test/tests/jaeger/invokeSessionGuard.js new file mode 100644 index 000000000..53bdbe5d6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/invokeSessionGuard.js @@ -0,0 +1,8 @@ +load(libdir + "evalInFrame.js"); + +[1,2,3,4,5,6,7,8].forEach( + function(x) { + // evalInFrame means lightweight gets call obj + assertEq(evalInFrame(0, "x"), x); + } +); diff --git a/js/src/jit-test/tests/jaeger/loops/bug651155.js b/js/src/jit-test/tests/jaeger/loops/bug651155.js new file mode 100644 index 000000000..37c16fff1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug651155.js @@ -0,0 +1,6 @@ +ForIn_2(); +function ForIn_2( object ) { + PropertyArray=new Array; + var PropertyArray = 'Do not assert: !cx->throwing'; + for ( i in object ) PropertyArray.length-1; +} diff --git a/js/src/jit-test/tests/jaeger/loops/bug654393.js b/js/src/jit-test/tests/jaeger/loops/bug654393.js new file mode 100644 index 000000000..e603392a4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug654393.js @@ -0,0 +1,12 @@ +var VERSION = "ECMA_2"; +DoWhile( + new DoWhileObject(false, false, false, VERSION) +); +function DoWhileObject( out1, out2, out3, in1 ) { + this.breakIn = in1 +} +function DoWhile(object) { + do { + if (object.breakIn) {} + } while(false); +} diff --git a/js/src/jit-test/tests/jaeger/loops/bug655854.js b/js/src/jit-test/tests/jaeger/loops/bug655854.js new file mode 100644 index 000000000..81c719431 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug655854.js @@ -0,0 +1,8 @@ + +function foo(a, b, c) { + var res = 0; + for (var b = 0; b < c; b++) + res += a[b]; + return res; +} +assertEq(foo([1,2,3], 0, 10), NaN); diff --git a/js/src/jit-test/tests/jaeger/loops/bug658290.js b/js/src/jit-test/tests/jaeger/loops/bug658290.js new file mode 100644 index 000000000..cfb42066a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug658290.js @@ -0,0 +1,8 @@ +var SECTION = "15.4.5.2-2"; +addCase(new Array, 0, Math, Math.pow(2, SECTION)); +var arg = "", i = 0; +var a = eval("new Array(" + arg + ")"); +addCase(a, i, +i + 1, Math.pow(2, 12) + i + 1, true); +function addCase(object, old_len, set_len, new_len, checkitems) { + for (var i = old_len; i < new_len; i++) if (object[i] != 0) {} +} diff --git a/js/src/jit-test/tests/jaeger/loops/bug659452.js b/js/src/jit-test/tests/jaeger/loops/bug659452.js new file mode 100644 index 000000000..cf5015c72 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug659452.js @@ -0,0 +1,5 @@ +test(); +function test() { + var t = function () function printStatus() {}; + for (var j = 0; j < 10; j++) t["-1"] +} diff --git a/js/src/jit-test/tests/jaeger/loops/bug668643.js b/js/src/jit-test/tests/jaeger/loops/bug668643.js new file mode 100644 index 000000000..fe41c7ffc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug668643.js @@ -0,0 +1,12 @@ + +function foo(a,n) { + var x = {a:[]}; + for (var i = 0; i < n; ) { + a[i]; + x.a[i]; + a[++i]; + } +} +var a = [1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0]; +var n = a.length; +foo(a,n); diff --git a/js/src/jit-test/tests/jaeger/loops/bug671814.js b/js/src/jit-test/tests/jaeger/loops/bug671814.js new file mode 100644 index 000000000..69b581f77 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug671814.js @@ -0,0 +1,12 @@ +var ta = Int8Array([]); +function Int8Array(summary) { + summary.length; +} +function test() { + ctors = [ Int8Array ] + for (var i = 0; i < 10; i++) { + ctor = ctors[0] + b = ctor(0) + } +} +test(); diff --git a/js/src/jit-test/tests/jaeger/loops/bug680809.js b/js/src/jit-test/tests/jaeger/loops/bug680809.js new file mode 100644 index 000000000..22bcbf3c4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug680809.js @@ -0,0 +1,8 @@ +function f0(p0) { + var v0; + v0 = 1.7; + loop0: while (v0) { + v0 = p0; + } +} +f0(0); diff --git a/js/src/jit-test/tests/jaeger/loops/bug684621.js b/js/src/jit-test/tests/jaeger/loops/bug684621.js new file mode 100644 index 000000000..9ca13bc7f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/bug684621.js @@ -0,0 +1,15 @@ +function runRichards() { + queue = new Packet; + Packet(queue, ID_DEVICE_A, KIND_DEVICE); + new Packet; +} +var ID_DEVICE_A = 4; +var KIND_DEVICE = 0; +Packet = function (queue) { + this.link = null + if (queue == null) return; + var peek, next = queue; + while ((peek = next.link) != null) + ID_HANDLER_B +}; +runRichards() diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-01.js b/js/src/jit-test/tests/jaeger/loops/hoist-01.js new file mode 100644 index 000000000..0c0f12357 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-01.js @@ -0,0 +1,35 @@ +function foo(x, n) { + for (var i = 0; i < n; i++) + x[i] = i; + var q = 0; + for (var i = 0; i < 10; i++) { + for (var j = 0; j < n; j++) + q += x[j]; + } + return q; +} + +var a = foo([], 100); +assertEq(a, 49500); + +function basic1(x) { + var q = 0; + for (var i = 0; i < 4; i++) + q += x[i]; + return q; +} + +var b = basic1([1,2,3,4]); +assertEq(b, 10); + +ARRAY = [1,2,3,4]; + +function basic2() { + var q = 0; + for (var i = 0; i < 4; i++) + q += ARRAY[i]; + return q; +} + +var c = basic2(); +assertEq(c, 10); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-02.js b/js/src/jit-test/tests/jaeger/loops/hoist-02.js new file mode 100644 index 000000000..79c3f1195 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-02.js @@ -0,0 +1,12 @@ +function foo(x, n) { + var a = 0; + for (var i = 0; i < n; i++) + a += x[3]; + return a; +} + +var a = foo([1,2,3,4], 100); +assertEq(a, 400); + +var b = foo([1,2], 100); +assertEq(b, NaN); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-03.js b/js/src/jit-test/tests/jaeger/loops/hoist-03.js new file mode 100644 index 000000000..c5c2ba619 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-03.js @@ -0,0 +1,12 @@ +function foo(x, j, n) { + var a = 0; + for (var i = 0; i < n; i++) + a += x[j]; + return a; +} + +var a = foo([1,2,3,4], 3, 100); +assertEq(a, 400); + +var b = foo([1,2,3,4], 5, 100); +assertEq(b, NaN); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-04.js b/js/src/jit-test/tests/jaeger/loops/hoist-04.js new file mode 100644 index 000000000..f17bd7f73 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-04.js @@ -0,0 +1,18 @@ +function bar(x, i) { + if (i == 50) + x.length = 0; +} + +function foo(x, j, n) { + var a = 0; + for (var i = 0; i < n; i++) { + var q = x[j]; + bar(x, i); + if (typeof q == 'undefined') + a++; + } + return a; +} + +var a = foo([1,2,3,4], 3, 100); +assertEq(a, 49); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-05.js b/js/src/jit-test/tests/jaeger/loops/hoist-05.js new file mode 100644 index 000000000..b99b07893 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-05.js @@ -0,0 +1,19 @@ +function bar(x, i) { + if (i == 50) + foo.arguments[1] = 20; +} + +function foo(x, j, n) { + var a = 0; + arguments; + for (var i = 0; i < n; i++) { + var q = x[j]; + bar(x, i); + if (typeof q == 'undefined') + a++; + } + return a; +} + +var a = foo([1,2,3,4], 3, 100); +assertEq(a, 0); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-06.js b/js/src/jit-test/tests/jaeger/loops/hoist-06.js new file mode 100644 index 000000000..fc2919cda --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-06.js @@ -0,0 +1,14 @@ + +function foo(x, n, y) { + var q = 0; + for (var j = 0; j < n; j++) { + if (x[j] < y) + q++; + } + assertEq(q, 1); +} + +var x = [1,2,3,4,5]; +var y = { valueOf: function() { x.length = 0; return 6; } }; + +var a = foo(x, 5, y); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-07.js b/js/src/jit-test/tests/jaeger/loops/hoist-07.js new file mode 100644 index 000000000..a409f7055 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-07.js @@ -0,0 +1,17 @@ + +var res = 0; + +function foo(x, n, y) { + for (var j = 0; j < n; j++) { + x[j]; + y.f; + } +} + +var x = [1,2,3,4,5]; +var y = {}; +Object.defineProperty(y, 'f', {get:function() { res++; x.length = 2; }}); + +var a = foo(x, 5, y); + +assertEq(res, 5); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-08.js b/js/src/jit-test/tests/jaeger/loops/hoist-08.js new file mode 100644 index 000000000..a695dd1a7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-08.js @@ -0,0 +1,7 @@ + +function foo(x,n) { + for (var i = -5; i < n; i++) { + x[i] = 10; + } +} +foo([1,2,3,4,5],5); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-09.js b/js/src/jit-test/tests/jaeger/loops/hoist-09.js new file mode 100644 index 000000000..1b398c7c2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-09.js @@ -0,0 +1,11 @@ + +function foo(x, y) { + for (var i = 0; i < x.length; i++) { + x[i]; + if (i < 20) + y[i + 1] = 0; + } +} + +var q = Array(1,2,3,4,5); +foo(q, []); diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-10.js b/js/src/jit-test/tests/jaeger/loops/hoist-10.js new file mode 100644 index 000000000..43a3084c9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/hoist-10.js @@ -0,0 +1,39 @@ +function foo1(x, n) { + var i = 0; + while (--n >= 0) { + x[i++] = 0; + } +} +foo1([1,2,3,4,5],5); + +function foo2(x, n) { + var i = 0; + while (--n >= 0) { + x[i++] = 0; + } +} +foo2([1,2,3,4,5],6); + +function foo3(x, n) { + var i = 0; + while (n-- >= 0) { + x[i++] = 0; + } +} +foo3([1,2,3,4,5],5); + +function foo4(x, n) { + var i = 0; + while (--n >= 0) { + x[++i] = 0; + } +} +foo4([1,2,3,4,5],5); + +function foo5(x, n) { + var i = 0; + while (--n >= 0) { + x[++i] = 0; + } +} +foo5([1,2,3,4,5,6],5); diff --git a/js/src/jit-test/tests/jaeger/loops/integer-1.js b/js/src/jit-test/tests/jaeger/loops/integer-1.js new file mode 100644 index 000000000..f0ef122f3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/integer-1.js @@ -0,0 +1,7 @@ +function foo(x) { + for (var i = 0x7ffffff0; i <= x; i++) { + var y = i; + } + return y; +} +assertEq(foo(0x7fffffff), 0x7fffffff); diff --git a/js/src/jit-test/tests/jaeger/loops/integer-2.js b/js/src/jit-test/tests/jaeger/loops/integer-2.js new file mode 100644 index 000000000..129c92f1f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/integer-2.js @@ -0,0 +1,10 @@ +function foo(x, y, z, a) { + for (var i = 0x7fff; i < 0xffff; i++) { + var y = ((x + y) + (z + a[0])) | 0; + } + return y; +} +assertEq(foo(0x7fffffff, 0x7fffffff, 0x7fffffff, [0x7fffffff]), 2147385343); + +var q = [0x7fffffff]; +assertEq(eval("foo(0x7fffffff, 0x7fffffff, {valueOf:function() {q[0] = 'e4'; return 0;}}, q)"), 438048096); diff --git a/js/src/jit-test/tests/jaeger/loops/integer-3.js b/js/src/jit-test/tests/jaeger/loops/integer-3.js new file mode 100644 index 000000000..26c7b76a8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/integer-3.js @@ -0,0 +1,7 @@ +function foo(x) { + for (var i = 0x7ffffff0; i <= x; i++) { + var y = (i % -2147483648); + } + return y + 5; +} +assertEq(foo(0x7fffffff), 0x7fffffff + 5); diff --git a/js/src/jit-test/tests/jaeger/loops/multiply-by-int32min.js b/js/src/jit-test/tests/jaeger/loops/multiply-by-int32min.js new file mode 100644 index 000000000..bc692f148 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/multiply-by-int32min.js @@ -0,0 +1,59 @@ +function foo() +{ + // Range analysis incorrectly computes a range for the multiplication. Once + // that incorrect range is computed, the goal is to compute a new value whose + // range analysis *thinks* is in int32_t range, but which goes past it using + // JS semantics. + // + // On the final iteration, in JS semantics, the multiplication produces 0, and + // the next addition 0x7fffffff. Adding any positive integer to that goes + // past int32_t range: here, (0x7fffffff + 5) or 2147483652. + // + // Range analysis instead thinks the multiplication produces a value in the + // range [INT32_MIN, INT32_MIN], and the next addition a value in the range + // [-1, -1]. Adding any positive value to that doesn't overflow int32_t range + // but *does* overflow the actual range in JS semantics. Thus omitting + // overflow checks produces the value 0x80000004, which interpreting as signed + // is (INT32_MIN + 4) or -2147483644. + // + // For this test to trigger the bug it was supposed to trigger: + // + // * 0x7fffffff must be the LHS, not RHS, of the addition in the loop, and + // * i must not be incremented using ++ + // + // The first is required because JM LoopState doesn't treat *both* V + mul and + // mul + V as not overflowing, when V is known to be int32_t -- only V + mul. + // (JM pessimally assumes V's type might change before it's evaluated. This + // obviously can't happen if V is a constant, but JM's puny little mind + // doesn't detect this possibility now.) + // + // The second is required because JM LoopState only ignores integer overflow + // on multiplications if the enclosing loop is a "constrainedLoop" (the name + // of the relevant field). Loops become unconstrained when unhandled ops are + // found in the loop. Increment operators generate a DUP op, which is not + // presently a handled op, causing the loop to become unconstrained. + for (var i = 0; i < 15; i = i + 1) { + var y = (0x7fffffff + ((i & 1) * -2147483648)) + 5; + } + return y; +} +assertEq(foo(), (0x7fffffff + ((14 & 1) * -2147483648)) + 5); + +function bar() +{ + // Variation on the theme of the above test with -1 as the other half of the + // INT32_MIN multiplication, which *should* result in -INT32_MIN on multiply + // (exceeding int32_t range). + // + // Here, range analysis again thinks the range of the multiplication is + // INT32_MIN. We'd overflow-check except that adding zero (on the LHS, see + // above) prevents overflow checking, so range analysis thinks the range is + // [INT32_MIN, INT32_MIN] when -INT32_MIN is actually possible. This direct + // result of the multiplication is already out of int32_t range, so no need to + // add anything to bias it outside int32_t range to get a wrong result. + for (var i = 0; i < 17; i = i + 1) { + var y = (0 + ((-1 + (i & 1)) * -2147483648)); + } + return y; +} +assertEq(bar(), (0 + ((-1 + (16 & 1)) * -2147483648))); diff --git a/js/src/jit-test/tests/jaeger/loops/property-1.js b/js/src/jit-test/tests/jaeger/loops/property-1.js new file mode 100644 index 000000000..81a6b3c36 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/loops/property-1.js @@ -0,0 +1,19 @@ + +function foo(x, y) { + var res = 0; + for (var i = 0; i < 10; i++) { + res += x.f + y[i]; + } + return res; +} + +var x = {f:0}; +var y = Array(10); +for (var i = 0; i < 10; i++) { + if (i == 5) + Object.defineProperty(Object.prototype, 5, {get: function() { x.f = 10; return 5}}); + else + y[i] = i; +} + +assertEq(foo(x, y), 85); diff --git a/js/src/jit-test/tests/jaeger/modConstDoubles.js b/js/src/jit-test/tests/jaeger/modConstDoubles.js new file mode 100644 index 000000000..807782ce6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/modConstDoubles.js @@ -0,0 +1,8 @@ + +function f() { + var x = 2.6; + var y = 2.1; + return x % y; +} +assertEq(f(), 0.5); + diff --git a/js/src/jit-test/tests/jaeger/modConstInt.js b/js/src/jit-test/tests/jaeger/modConstInt.js new file mode 100644 index 000000000..cdb0711da --- /dev/null +++ b/js/src/jit-test/tests/jaeger/modConstInt.js @@ -0,0 +1,8 @@ + +function f() { + var i = 1000; + var rest = i % 3; + var div = (i - rest) / 3; + assertEq(div, 333); +} +f(); \ No newline at end of file diff --git a/js/src/jit-test/tests/jaeger/modConstZeroRhs.js b/js/src/jit-test/tests/jaeger/modConstZeroRhs.js new file mode 100644 index 000000000..75ef88410 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/modConstZeroRhs.js @@ -0,0 +1,8 @@ + +function f() { + var x = 5; + var y = 0; + return x % y; +} +assertEq(f(), NaN); + diff --git a/js/src/jit-test/tests/jaeger/modWithConstLhs.js b/js/src/jit-test/tests/jaeger/modWithConstLhs.js new file mode 100644 index 000000000..67bf398b0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/modWithConstLhs.js @@ -0,0 +1,2 @@ +// |jit-test| error: ReferenceError; +7%s; diff --git a/js/src/jit-test/tests/jaeger/mulNegZero.js b/js/src/jit-test/tests/jaeger/mulNegZero.js new file mode 100644 index 000000000..6758dab7c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/mulNegZero.js @@ -0,0 +1,31 @@ + +function mul(x, y) { return x * y; }; +function mulConst0(x) { return x * 0; }; +function mulConst1(x) { return -5 * x; }; +function mulConst2(x) { return x * -5; }; + +function f() { + assertEq(mulConst0(7), 0); + assertEq(mulConst0(-5), -0); + assertEq(mulConst0(0), 0); + assertEq(mulConst0(-0), -0); + + assertEq(mulConst1(7), -35); + assertEq(mulConst1(-8), 40); + assertEq(mulConst1(0), -0); + assertEq(mulConst1(-0), 0); + + assertEq(mulConst2(7), -35); + assertEq(mulConst2(-8), 40); + assertEq(mulConst2(0), -0); + assertEq(mulConst2(-0), 0); + + assertEq(mul(55, 2), 110); + assertEq(mul(0, -10), -0); + assertEq(mul(-5, 0), -0); + assertEq(mul(-0, 0), -0); + assertEq(mul(0, -0), -0); + assertEq(mul(0, 0), 0); + assertEq(mul(-0, -0), 0); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/negation.js b/js/src/jit-test/tests/jaeger/negation.js new file mode 100644 index 000000000..f0f3e5185 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/negation.js @@ -0,0 +1,2 @@ +var n = -2147483648; +assertEq(-n, 2147483648); diff --git a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js new file mode 100644 index 000000000..8bb4627fa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js @@ -0,0 +1,49 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testInt32Array(L) { + var f = new Int32Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 4294967295; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], -1); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testUint32Array(L) { + var f = new Uint32Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 4294967295; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], 4294967295); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +for (var i = 0; i < 10; i++) { + //testInt32Array(0); + testUint32Array(0); + if (i == 5) + gc(); +} + diff --git a/js/src/jit-test/tests/jaeger/optimize-globals-1.js b/js/src/jit-test/tests/jaeger/optimize-globals-1.js new file mode 100644 index 000000000..4197a2717 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/optimize-globals-1.js @@ -0,0 +1,9 @@ + +function testLocalNames() { + var NaN = 4; + var undefined = 5; + var Infinity = 6; + return NaN + undefined + Infinity; +} +assertEq(testLocalNames(), 15); + diff --git a/js/src/jit-test/tests/jaeger/optimize-globals-2.js b/js/src/jit-test/tests/jaeger/optimize-globals-2.js new file mode 100644 index 000000000..2e01cdcb0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/optimize-globals-2.js @@ -0,0 +1,20 @@ + +function testNaN(x) { + var x = NaN; + assertEq(isNaN(x), true); +} +testNaN(); + +function testInfinity(x) { + return (x === Infinity); +} +assertEq(testInfinity(Infinity), true); +assertEq(testInfinity(6), false); +assertEq(testInfinity(-Infinity), false); + +function testUndefined(x) { + return (x === undefined); +} +assertEq(testUndefined(undefined), true); +assertEq(testUndefined(), true); +assertEq(testUndefined(5), false); diff --git a/js/src/jit-test/tests/jaeger/optimize-globals-3.js b/js/src/jit-test/tests/jaeger/optimize-globals-3.js new file mode 100644 index 000000000..eb2474c45 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/optimize-globals-3.js @@ -0,0 +1,9 @@ + +NaN = 4; +undefined = 5; +Infinity = 6; + +assertEq(isNaN(NaN), true); +assertEq(Infinity > 100, true); +assertEq(undefined != 5, true); + diff --git a/js/src/jit-test/tests/jaeger/propertyOptimize-1.js b/js/src/jit-test/tests/jaeger/propertyOptimize-1.js new file mode 100644 index 000000000..47ac2fc6e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-1.js @@ -0,0 +1,29 @@ + +function Foo(x) +{ + this.f = x + 10; +} + +function Bar() +{ + this.g = 0; +} + +Bar.prototype = Foo.prototype; + +var x = new Foo(0); +var y = new Bar(); + +assertEq(10, eval("x.f")); +assertEq(undefined, eval("y.f")); + +function Other(x) +{ + this.f = x + 10; +} + +var a = new Other(0); +var b = Object.create(Other.prototype); + +assertEq(10, eval("a.f")); +assertEq(undefined, eval("b.f")); diff --git a/js/src/jit-test/tests/jaeger/propertyOptimize-2.js b/js/src/jit-test/tests/jaeger/propertyOptimize-2.js new file mode 100644 index 000000000..88df13e2c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-2.js @@ -0,0 +1,16 @@ + +function Foo(x) +{ + this.f = x + 10; +} + +var x = new Foo(0); +assertEq(10, eval("x.f")); + +called = false; +Object.defineProperty(Foo.prototype, 'f', {set: function() { called = true; }}); + +var y = new Foo(0); +assertEq(10, eval("x.f")); +assertEq(undefined, eval("y.f")); +assertEq(called, true); diff --git a/js/src/jit-test/tests/jaeger/propertyOptimize-3.js b/js/src/jit-test/tests/jaeger/propertyOptimize-3.js new file mode 100644 index 000000000..90327e47a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-3.js @@ -0,0 +1,67 @@ + +// Properties cleared in the middle of a single function constructor. + +function foo(x, y) { + this.f = 0; + this.g = x + y; + this.h = 2; +} + +var called = false; +var a = 0; +var b = {valueOf: function() { Object.defineProperty(Object.prototype, 'g', {set: function() { called = true }}) }}; +var c = new foo(a, b); + +assertEq(called, true); +assertEq(c.g, undefined); + +// Properties cleared in the middle of a constructor callee. + +function foo2(x, y) { + this.a = 0; + this.b = 1; + bar2.call(this, x, y); + this.c = 2; +} +function bar2(x, y) { + this.d = x + y; + this.e = 3; +} + +var called2 = false; +var xa = 0; +var xb = {valueOf: function() { Object.defineProperty(Object.prototype, 'e', {set: function() { called2 = true }}) }}; +var xc = new foo2(xa, xb); + +assertEq(called2, true); +assertEq(xc.e, undefined); +assertEq(xc.c, 2); + +// Properties cleared after a constructor callee. + +function foo3() { + this.aa = 0; + this.bb = 1; + bar3.call(this); + this.cc = 2; + baz(); + xbar3.call(this); + this.dd = 3; +} +function bar3() { + this.ee = 4; +} +function xbar3() { + this.ff = 5; +} +function baz() { + eval("xbar3.call = function() { called3 = true }"); +} + +var called3 = false; +var c3 = new foo3(); +assertEq(c3.cc, 2); +assertEq(c3.ee, 4); +assertEq(c3.ff, undefined); +assertEq(c3.dd, 3); +assertEq(called3, true); diff --git a/js/src/jit-test/tests/jaeger/propertyOptimize-4.js b/js/src/jit-test/tests/jaeger/propertyOptimize-4.js new file mode 100644 index 000000000..942474875 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-4.js @@ -0,0 +1,17 @@ +// Make sure new script properties can be invalidated on specialized prototype +// types while they are still being constructed. + +function Foo(a, b, c) { + this.x = a + b; + this.y = c; +} + +updated = false; +var o = {valueOf: function() { + Object.defineProperty(Object.prototype, 'y', {set:function() { updated = true; }}) + }}; + +function Bar() {} +Bar.prototype = new Foo(o, 1, 2); +assertEq(updated, true); +assertEq(Bar.prototype.y, undefined); diff --git a/js/src/jit-test/tests/jaeger/recompile/arith.js b/js/src/jit-test/tests/jaeger/recompile/arith.js new file mode 100644 index 000000000..a705a2937 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/arith.js @@ -0,0 +1,49 @@ + +/* Handle recompilation of arithmetic operations, and on-stack int -> double conversion. */ + +function add(x, y) +{ + var z = x + y; + assertEq(z, 2147483732); + assertEq(z - 10, 2147483722); +} +add(0x7ffffff0, 100); + +function mul(x, y) +{ + var z = x * y; + assertEq(z, 4294967264); +} +mul(0x7ffffff0, 2); + +function div1(x, y) +{ + var z = x / y; + assertEq(z + 10, 20); +} +div1(100, 10); + +function div2(x, y) +{ + var z = x / y; + assertEq(z + 10, 20.5); +} +div2(105, 10); + +function uncopy(x, y) +{ + var q = x; + x += y; + q++; + assertEq(q, 2147483633); + assertEq(x, 2147483732); +} +uncopy(0x7ffffff0, 100); + +function addmore(x, y) +{ + var q = (x + 10) + (x + y); + assertEq(q, 4294967374); + x = q; +} +addmore(0x7ffffff0, 100); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug617592.js b/js/src/jit-test/tests/jaeger/recompile/bug617592.js new file mode 100644 index 000000000..cec177480 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug617592.js @@ -0,0 +1,3 @@ + +var x; +-(x === null); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug621292.js b/js/src/jit-test/tests/jaeger/recompile/bug621292.js new file mode 100644 index 000000000..11dca9471 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug621292.js @@ -0,0 +1,24 @@ + +/* Don't crash. */ + +var count = 0; + +function callbackfn(v) { + if (++count == 98) + count = 0x7ffffff0; + return arr[0] + count; +} + +function foo() { + arr = [1,2,3,4,5]; + for (var i = 0; i < 50; i++) + arr = arr.map(callbackfn); +} +foo(); + +function f(a,b,c) { + a = 1; b = 'str'; c = 2.1; + return arguments[0]; +} +for (var i = 0; i < 20; i++) + assertEq(f(10,'sss',1), 1); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug621328.js b/js/src/jit-test/tests/jaeger/recompile/bug621328.js new file mode 100644 index 000000000..f755549c9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug621328.js @@ -0,0 +1,9 @@ +function foo() { +}; +function f() { + var e = foo; + a = new e(); + assertEq(typeof(a), "object"); + e=a; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug638977.js b/js/src/jit-test/tests/jaeger/recompile/bug638977.js new file mode 100644 index 000000000..0fac78224 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug638977.js @@ -0,0 +1,6 @@ +function f() { + gc(); + [].unshift(false); +} +f(); +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug639508.js b/js/src/jit-test/tests/jaeger/recompile/bug639508.js new file mode 100644 index 000000000..a25a70c60 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug639508.js @@ -0,0 +1,2 @@ +var o = 2; +o = o.p; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug639882.js b/js/src/jit-test/tests/jaeger/recompile/bug639882.js new file mode 100644 index 000000000..3f9f898a2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug639882.js @@ -0,0 +1,5 @@ +var x = 2; +x = -(x == 3); + +var y = ""; +typeof(z) + typeof(eval("z = y")); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug640608.js b/js/src/jit-test/tests/jaeger/recompile/bug640608.js new file mode 100644 index 000000000..1c5c3c810 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug640608.js @@ -0,0 +1,10 @@ +try { +{ + function x() {} +} +o = (0).__proto__; +function f(o) { + o._("", function() {}) +} +f(o) +} catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641225.js b/js/src/jit-test/tests/jaeger/recompile/bug641225.js new file mode 100644 index 000000000..a6e3a86c7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641225.js @@ -0,0 +1,150 @@ +gczeal(1); +var o0 = Function.prototype; +o1 = {}; +var o4 = Error.prototype; +o5 = new Int32Array(100); +o6 = new Proxy({}, {}) +o8 = new Proxy(function() { return {}; }, { + get: function() { return 10; }, +}); +o9 = {}; +var o10 = -500; +var o12 = new Int32Array(100); +function f0(o) { +} +function f1(o) { +} +function f3(o) { + with(o) {} + o[o5] = o5; +} +function f5(o) { +}for(var f2 in o9) { + for(var i1=0; i1<83; i1++) { + for(var i3=0; i3<98; i3++) { + for(var x in f1) { f1[x]; }; + } + Object.defineProperty(o0, 'constructor', {enumerable: true,unused: 1 }); + f1(f5); + f4(f3); + f3(o8); + f2(o5); + o9.toString(1, 2); + f4.caller = o3; + f2(o6); + f0(f2); + f1(f2); + f0(f1); + var key = Object.getOwnPropertyNames(o9)[2]; if(key) delete o9[key]; + var props = Object.getOwnPropertyNames(o5); + if (props.length > 6) { + var prop = props[6]; + o8[prop] = o5[prop]; + } + f3(f1); + f1(f5); + } + for(var o3 in f1) { + f1(o3); + f4(o3); + o0 == f4; + f1(f3); + Object.freeze(o12); + f0(o9); + new f0(o1); + o4 = o5.call(o4, o4, o4, o4, o4, o4); + f2(o10); + var prop = Object.getOwnPropertyNames(o0)[15]; + if (prop) { Object.defineProperty(o0, prop, {configurable: true,enumerable: true,get: function(){},set: function(){},unused: 1 }); } + f3(f1); + new f2(o0); + } + f5(o9); + gc(); + f0(o2); + f3(f4); + new f4(o7); + f1 = new o10(f1, f1, f1, f1); + f5(o10); + f5(o7); + f0(o7); + f1(o10); + f3(o10); + delete f0.constructor; + f0(f3); + f1 = wrap(f3); + f4(f1); + delete o1.prototype; + f4(o5); + f2(f2); + o1 + ''; + f2(f2); + f0(o12); + f0(o12); + f1(o3); + o5[3] = 8.3; + o10['__proto_' + '_']; +} +for(var o2 in f5) { + for(var o10 in f3) { + delete f2['__proto_' + '_']; + o8 = f1.toString; + f1(o1); + f0(o9); + f2(o12); + var key = Object.getOwnPropertyNames(o3)[19]; if(key) o9 = o3[key]; + f1(o10); + f4(f1); + f1(o1); + f1(o7); + for(var x in o1) { o1[x]; }; + f0(o8); + f4(o1); + f0(o1); + f0.p0 = o6; + f3(o9); + f5(o8); + f2 >>> o7; + if(o3 === o8) {} + f5(o3); + } + o5[0] = f4; + o0.caller = function() { }; + Object.freeze(f0); + f4(o3); + o7.p0 = o3; + f1(f5); + f4(o10); + f2(o5); + f2(o5); + f0(o3); + o9.watch('p3', function() {}); + o8[o8] = o8; + f0(o5); + f1(o6); + f2 = Object.create(o5); + var key = Object.getOwnPropertyNames(o11)[23]; if(key) f2 = o11[key]; + f5(o9); + o12 = o6.bind(o12, o12, o12); + f5(f4); + f1(o1); + f0(o11); + f1(o11); + eval('f4'); + f4(o1); + Object.isExtensible(o7); +} +(function() { + f1(o12); + f5 + ''; + if(o8 != o3) {} +})(); +f1(o10); +f3(f0); +o4.toSource = function() { }; +var _o = o1; +var prop = Object.getOwnPropertyNames(_o)[5]; +if (prop) { _o[prop](o2, o2); } +f3(o0); +f1(f3); +Object.isExtensible(f1); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641269.js b/js/src/jit-test/tests/jaeger/recompile/bug641269.js new file mode 100644 index 000000000..7eca2e2d8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641269.js @@ -0,0 +1,8 @@ +// |jit-test| error: ReferenceError + +var g = newGlobal(); +var dbg = new g.Debugger(this); + +(function() { + const x = [][x] +})() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641535.js b/js/src/jit-test/tests/jaeger/recompile/bug641535.js new file mode 100644 index 000000000..732eeb08c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641535.js @@ -0,0 +1,2 @@ +var o = {}; +o[o.p] = 2; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug642405.js b/js/src/jit-test/tests/jaeger/recompile/bug642405.js new file mode 100644 index 000000000..2bbca3483 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug642405.js @@ -0,0 +1,13 @@ +function startTest() {}; +try { +} +catch(ex) +{ + actual = ex + ''; +} +var actual = 'no error'; +var prefValue; +DESCRIPTION = "var class = true"; +EXPECTED = "error"; +foo(EXPECTED[prefValue], DESCRIPTION[prefValue], startTest[prefValue]); +function foo() {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643182.js b/js/src/jit-test/tests/jaeger/recompile/bug643182.js new file mode 100644 index 000000000..cb134fe0b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643182.js @@ -0,0 +1,7 @@ +x = 123; +function f() {} +function g(o) { + y = x.p; + eval('o'); +} +g(f); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643376.js b/js/src/jit-test/tests/jaeger/recompile/bug643376.js new file mode 100644 index 000000000..300fbc90d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643376.js @@ -0,0 +1,8 @@ +SECTION = 0; +function TestCase() {} +function outer_func(x) +{ + var y = "inner"; + new TestCase( SECTION, { SECTION: ++y }); +} +outer_func(1111); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643669.js b/js/src/jit-test/tests/jaeger/recompile/bug643669.js new file mode 100644 index 000000000..d66639df4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643669.js @@ -0,0 +1,3 @@ +try {(function () { + eval("gc().l()") + })() } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug645044.js b/js/src/jit-test/tests/jaeger/recompile/bug645044.js new file mode 100644 index 000000000..e31762a8e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug645044.js @@ -0,0 +1,4 @@ + +this.__defineGetter__("x", gc); +x.__proto__ = this; +__proto__ = 44; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug646267.js b/js/src/jit-test/tests/jaeger/recompile/bug646267.js new file mode 100644 index 000000000..2f1503767 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug646267.js @@ -0,0 +1,8 @@ +function t(code) { + var f = new Function(code); + try { f(); } catch (e) { } +} +t(""); +t(""); +t(""); +t("this.function = 7;"); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647183.js b/js/src/jit-test/tests/jaeger/recompile/bug647183.js new file mode 100644 index 000000000..0405a548a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647183.js @@ -0,0 +1,23 @@ +var SECTION = ""; +var VERSION = ""; +function test() {} +function writeTestCaseResult( expect, actual, string ) { + if (typeof document != "object" || +!document.location.href.match(/jsreftest.html/)) { + } +} +TIME_0000 = now = new Date; +TIME_NOW = now.valueOf(); +function DaysInYear( y ) { +function MakeDate( day, time ) { + +} +} +function TimeClip( t ) { + if ( isNaN ) { Number.NaN; } +} +function runDSTOffsetCachingTestsFraction(part, parts) { print; }; +test_times=( TIME_NOW, TIME_0000, ( SECTION, VERSION+".getUTCMinutes()", + TIME_NOW.test_times,VERSION.SECTION ) , TIME_0000, TIME_0000, + 0, 0 ); +try { j = 0( SECTION, TimeClip(1.1), 0 ); } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647199.js b/js/src/jit-test/tests/jaeger/recompile/bug647199.js new file mode 100644 index 000000000..b9d330f8f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647199.js @@ -0,0 +1,11 @@ +TryInWhile( new TryObject( "hello", ThrowException, true ) ); +function TryObject( value, throwFunction, result ) { + this.thrower=throwFunction +} +function ThrowException() TryInWhile(1); +function TryInWhile( object ) { + try { + object.thrower() + } catch ( e ) { + } +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647532.js b/js/src/jit-test/tests/jaeger/recompile/bug647532.js new file mode 100644 index 000000000..3c8bc3f40 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647532.js @@ -0,0 +1,4 @@ +try { Function("\ + __defineSetter__(\"x\",Object.keys)\ + (z=x instanceof[].some)\ +")() } catch (e) { } diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647547.js b/js/src/jit-test/tests/jaeger/recompile/bug647547.js new file mode 100644 index 000000000..6f9c970aa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647547.js @@ -0,0 +1,9 @@ +DoWhile(new DoWhileObject); +new DoWhileObject("", Boolean); +function DoWhileObject( d, e, s ) { + this.whileExpression=e; +} +function DoWhile( object ) { + while ( object.whileExpression ) eval( ); + Boolean +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js b/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js new file mode 100644 index 000000000..259752447 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js @@ -0,0 +1,18 @@ +function f() { + function g() { + eval(""); + gc(); + Math.abs(4); + NaN; + } + g(); +} +function h() { + var x, y; + x = Math.floor(-0); + y = parseInt("1"); +} + +f(); +h(); + diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js b/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js new file mode 100644 index 000000000..6ebea8482 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js @@ -0,0 +1,2 @@ +[""][NaN] = 2; +-([][[""][String] = ""] = null); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648502.js b/js/src/jit-test/tests/jaeger/recompile/bug648502.js new file mode 100644 index 000000000..26caf6b61 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648502.js @@ -0,0 +1,12 @@ +function f(x, y) { + -(undefined ? 0 : 0); + assertEq(y === y, true); + return 0; +} +f(1, 2); +{ + f(3, 3.14); + f(true, f(4, 5)); + + function g() {} +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648567.js b/js/src/jit-test/tests/jaeger/recompile/bug648567.js new file mode 100644 index 000000000..5b7df219d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648567.js @@ -0,0 +1,16 @@ +var arr = [-10, true]; +true || arr[0]; + +function g() { + var x = arr[12]; + var y = arr.length; + arr[undefined] = x; + assertEq(y, 2); +} +{ + function f() { + gc(); + g(); + } + f(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648843.js b/js/src/jit-test/tests/jaeger/recompile/bug648843.js new file mode 100644 index 000000000..37de8fbbe --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648843.js @@ -0,0 +1,8 @@ + +function Q(on) +{ + options().match +} +function options() { return "methodjit"; } +gczeal(2); +for (i = 0; i < 100 ; ++i) { Q(Q(42, [])); } diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648966.js b/js/src/jit-test/tests/jaeger/recompile/bug648966.js new file mode 100644 index 000000000..df0f9d8cd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648966.js @@ -0,0 +1,7 @@ + +function f(x) { + gc(); + -x; + -null; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug649261.js b/js/src/jit-test/tests/jaeger/recompile/bug649261.js new file mode 100644 index 000000000..fabc38e73 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug649261.js @@ -0,0 +1,2 @@ +var DESCRIPTION; +eval("DESCRIPTION += \"Non-character escapes in identifiers negative test.\";"); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug649769.js b/js/src/jit-test/tests/jaeger/recompile/bug649769.js new file mode 100644 index 000000000..28c823b42 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug649769.js @@ -0,0 +1,16 @@ + +function g(x) { + if (!x) { + throw 1; + } +} + +function f(a, b, c, d) { + var x = [].push(3); + g(true); + assertEq(x, 1); +} +f(1.2, 2, 3, 4); +gc(); +f(1, 2, 3, 4); + diff --git a/js/src/jit-test/tests/jaeger/recompile/bug651119.js b/js/src/jit-test/tests/jaeger/recompile/bug651119.js new file mode 100644 index 000000000..598a36574 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug651119.js @@ -0,0 +1,51 @@ +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property]; +}; +var Enumerable = { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + each: function(iterator, context) { + var index = 0; + this._each(function(value) { + iterator.call(context, value, index++); + }); + }, + map: function(iterator, context) { + var results = []; + this.each(function(value, index) { + var res = iterator.call(context, value); + results.push(res); + }); + return results; + }, + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, +}; +Object.extend(Array.prototype, Enumerable); +function $A(iterable) { + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} +function g() { + return [1, 2, 3, 4, 5].each(function(part) { + return 0; + }); +} +function f() { + g(); + g(); + g(); + g(); + var result = [[2, 1, 3], [6, 5, 4]]; + result = result.invoke('invoke', 'toString', 2); + result[0].join(', '); +}; +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug653980.js b/js/src/jit-test/tests/jaeger/recompile/bug653980.js new file mode 100644 index 000000000..f5a4d2a9f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug653980.js @@ -0,0 +1,13 @@ + +function f(code) { + try { + Function(code)() + } catch(r) {} +} { + function x() {} +} +f("") +f("") +f("") +f("x::e") +if (typeof w == "") {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug654536.js b/js/src/jit-test/tests/jaeger/recompile/bug654536.js new file mode 100644 index 000000000..5a3266ff6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug654536.js @@ -0,0 +1,6 @@ +function f() { + var x = Object.prototype.hasOwnProperty.call(1); + assertEq(x, false); + isNaN(2); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug655949.js b/js/src/jit-test/tests/jaeger/recompile/bug655949.js new file mode 100644 index 000000000..1adace1a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug655949.js @@ -0,0 +1,6 @@ +var a; +try { + a(); +} catch(e) { + assertEq(e instanceof TypeError, true); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug655998.js b/js/src/jit-test/tests/jaeger/recompile/bug655998.js new file mode 100644 index 000000000..a48eb3215 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug655998.js @@ -0,0 +1,7 @@ +function f(x) { + var y; + gc(); + ++x.x; +} +f(1); +f.call(2, 3); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug656753.js b/js/src/jit-test/tests/jaeger/recompile/bug656753.js new file mode 100644 index 000000000..b897c7d09 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug656753.js @@ -0,0 +1,20 @@ + +var global = 0; + +function foo(i) { + global = i; + if (global == 8) { + eval("global = 'three'"); + throw global; + } +} + +var caught = false; +try { + for (var i = 0; i < 10; i++) { + Array.map([i], foo); + } +} catch (e) { caught = true; } + +assertEq(caught, true); +assertEq(global, 'three'); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug657288.js b/js/src/jit-test/tests/jaeger/recompile/bug657288.js new file mode 100644 index 000000000..2a19c5c51 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug657288.js @@ -0,0 +1,9 @@ +// |jit-test| error: TypeError +new DoWhileObject; +function DoWhileObject(breakOut, breakIn, iterations, loops) { + loops.prototype = new DoWhile; + this.looping; +} +function DoWhile(object) { + do {} while (object); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658209.js b/js/src/jit-test/tests/jaeger/recompile/bug658209.js new file mode 100644 index 000000000..966c10f28 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658209.js @@ -0,0 +1,10 @@ +for (var i=0; i<20; i++) { + (function () { + var x; + (function () { + x = /abc/; + x++; + gc(); + })(); + })(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658211.js b/js/src/jit-test/tests/jaeger/recompile/bug658211.js new file mode 100644 index 000000000..02de29259 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658211.js @@ -0,0 +1,13 @@ +function foo(x) { + return bar(x); +} +function bar(x) { + return x.f + 10; +} +var g = Object(); +g.f = 10; +assertEq(foo(g), 20); +assertEq(foo(g), 20); +assertEq(foo(g), 20); +eval("g.f = 'three'"); +assertEq(foo(g), 'three10'); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658212.js b/js/src/jit-test/tests/jaeger/recompile/bug658212.js new file mode 100644 index 000000000..a18764923 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658212.js @@ -0,0 +1,30 @@ +var gTestcases = Array; +function TestCase(n, d, e, a) { + this.description = d + gTestcases[gTc] = this +} +TestCase.prototype.dump=function () + + + + + this.description + + + + + '\n';function printStatus (msg) +function toPrinted(value) { +} +function reportCompare(expected, actual, description) { + new TestCase("unknown-test-name", description, expected, actual) +} +gTc = 0;; +function jsTestDriverEnd() { + for (var i = 0; i < gTestcases.length; i++) + gTestcases[i].dump() +} +var summary = 'Do not assert with try/finally inside finally'; +var expect = 'No Crash'; +reportCompare(expect, printStatus, summary); +jsTestDriverEnd(); +jsTestDriverEnd(); +try { + f +} catch (ex) { + actual = '' +} +reportCompare(expect, actual, 5); +jsTestDriverEnd() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658561.js b/js/src/jit-test/tests/jaeger/recompile/bug658561.js new file mode 100644 index 000000000..ad10b3dac --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658561.js @@ -0,0 +1,5 @@ +var s1 = 'xx'; +for (var x = 0; x < 10 ; ++x ) { + new function() s1++; + gc(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658777.js b/js/src/jit-test/tests/jaeger/recompile/bug658777.js new file mode 100644 index 000000000..9bc6854f4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658777.js @@ -0,0 +1,11 @@ +function Employee(name, dept) this.name = name || ""; +function WorkerBee(name, dept, projs) { + this.base = Employee + this.base(name, dept) +} +function Engineer(name, projs, machine) { + this.base = WorkerBee + this.base(name, "engineering", projs) + __proto__["a" + constructor] = 1 +} +new Engineer; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug659639.js b/js/src/jit-test/tests/jaeger/recompile/bug659639.js new file mode 100644 index 000000000..4e7ffe288 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug659639.js @@ -0,0 +1,16 @@ +test(); +function iso(d) { new Date(d).toISOString() } +function check(s,millis) { iso(millis); } +function dd(year, month, day, hour, minute, second, millis) { + return Date.UTC(year, 1, day, hour, minute, second, millis); +} +function test() { + try { + check("", 20092353211) + check("", 2009) + check("", 0) + check("", dd(BUGNUMBER, 7, 23, 19, 53, 21, 1)) + } catch (e) {} +} +var BUGNUMBER = "10278"; +test() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug659766.js b/js/src/jit-test/tests/jaeger/recompile/bug659766.js new file mode 100644 index 000000000..012447ba4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug659766.js @@ -0,0 +1,29 @@ +var gTestcases = new Array; +var gTc = gTestcases; +function TestCase(n, d, e, a) { + this.description=d + this.reason='' + gTestcases[gTc++]=this +} +TestCase.prototype.dump=function () + toPrinted(this.description) + toPrinted(this.reason) + '\n'; +function toPrinted(value) value=value.replace(/\\n/g, 'NL').replace(/[^\x20-\x7E]+/g, escapeString); +function escapeString (str) { + try { + err + } catch(ex) { } +} +function jsTestDriverEnd() { + for (var i = 0; i < gTestcases.length; i++) + gTestcases[i].dump() +} +var SECTION = "dowhile-007"; +DoWhile(); +function DoWhile( object ) result1=false; +new TestCase( + SECTION, + "break one: ", + result1 +); +jsTestDriverEnd(); +new TestCase( SECTION, "'�O� �:i��'.match(new RegExp('.+'))", [], '�O� �:i��'); +jsTestDriverEnd(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug660737.js b/js/src/jit-test/tests/jaeger/recompile/bug660737.js new file mode 100644 index 000000000..b36b8ee77 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug660737.js @@ -0,0 +1,10 @@ +(function() { + function f(l) { + w++ + } + for each(let w in ['', '', 0]) { + try { + f(w) + } catch (e) {} + } +})() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug661859.js b/js/src/jit-test/tests/jaeger/recompile/bug661859.js new file mode 100644 index 000000000..b99e301a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug661859.js @@ -0,0 +1,24 @@ +function TestCase(n, d, e, a) this.expect = e; +function reportCompare(expected, actual, description) { + typeof actual +} +expect = 1; +var summary = 'Do not assert: top < ss->printer->script->depth'; +var actual = 'No Crash'; +var expect = 'No Crash'; +test(); +function notInlined(f) { + // prevent inlining this function, as a consequence, it prevent inlining + // Array.prototype.some (Bug 1087468) + with ({}) {} + return f; +} +function test(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) { + try { + p = [1].some(notInlined(function (y) test())) ? 4 : 0x0041; + } catch (ex) {} + reportCompare(expect, actual, summary) +} +test(); +TestCase(); +test() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug663690.js b/js/src/jit-test/tests/jaeger/recompile/bug663690.js new file mode 100644 index 000000000..1738d0196 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug663690.js @@ -0,0 +1,14 @@ + +function g(c) { + b = b = h(c); +} +function j(s) { + return Function(s) +} +function h(c) { + return j(c)() +} +g() +var a +Boolean.__proto__[a] = [] +g("return gc()") diff --git a/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js b/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js new file mode 100644 index 000000000..3562f9327 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js @@ -0,0 +1,12 @@ +gczeal(2); +o1 = Iterator; +var o2 = (function() { return arguments; })(); +function f(o) { + for(var j=0; j<20; j++) { + Object.seal(o2); + (function() { return eval(o); })() == o1; + (function() { return {x: arguments}.x; })(); + if (false) {}; + } +} +f({}); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js b/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js new file mode 100644 index 000000000..7b262b9b6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js @@ -0,0 +1,10 @@ +if (typeof schedulegc != 'undefined') + schedulegc(11); +function foo(n) { + if (n == 10) + foo.apply = function(a, b) { return b[0]; } + return n; +} +function bar() { return foo.apply(null, arguments); } +for (var i = 0; i < 20; i++) + assertEq(bar(i), i); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug672123.js b/js/src/jit-test/tests/jaeger/recompile/bug672123.js new file mode 100644 index 000000000..d2ca2497e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug672123.js @@ -0,0 +1,46 @@ +var caught = false; +function h(code) { + f = eval("(function(){" + code + "})") + g() +} +function g() { + try { + f(); + } catch (r) { caught = true } +} +h("") +for (i = 0; i < 9; i++) { + h("") +} +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("\"\"(gc())") +assertEq(caught, true); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug673812.js b/js/src/jit-test/tests/jaeger/recompile/bug673812.js new file mode 100644 index 000000000..cf16ba78b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug673812.js @@ -0,0 +1,18 @@ +gczeal(2); +try { + DoWhile_3(); +} catch (e) {} +function f() { + test(); + yield 170; +} +function test() { + function foopy() { + try { + for (var i in f()); + } catch (e) {} + } + foopy(); + gc(); +} +test(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug674391.js b/js/src/jit-test/tests/jaeger/recompile/bug674391.js new file mode 100644 index 000000000..7fdc2c303 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug674391.js @@ -0,0 +1,11 @@ +a = []; +for (var i = 0; i < 1000; i++) { + a[i] = i; +} +function foo(x) { + for (var i in x) { + } +} +if (typeof schedulegc != "undefined") + schedulegc(100); +foo(a); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug676764.js b/js/src/jit-test/tests/jaeger/recompile/bug676764.js new file mode 100644 index 000000000..fca27de64 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug676764.js @@ -0,0 +1,14 @@ + +try { with( {"a":1} ) { + (function () { + for (;;) { + t + } + })() +} } catch (e) {} + +with( {"b":2} ) { + (function () { + for (b = 0; b < 18; ++b) {} + })(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/callic.js b/js/src/jit-test/tests/jaeger/recompile/callic.js new file mode 100644 index 000000000..6647c9acf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/callic.js @@ -0,0 +1,27 @@ + +/* Recompilation while being processed by a call IC. */ + +var g; +function foo() { + for (g = 0; g < 5; g++) { + bar(); + } + function bar() { + with ({}) { + eval("g = undefined;"); + } + } +} +foo(); + +assertEq(g, NaN); + +/* Recompilation while being processed by a native call IC. */ + +function native() { + var x; + x = x; + x = Math.ceil(NaN); + assertEq(x, NaN); +} +native(); diff --git a/js/src/jit-test/tests/jaeger/recompile/exotic.js b/js/src/jit-test/tests/jaeger/recompile/exotic.js new file mode 100644 index 000000000..3a00dd362 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/exotic.js @@ -0,0 +1,74 @@ + +// Test exotic ways of triggering recompilation. + +// Lowered native call. + +var x = 0; +var y = true; +for (var i = 0; i < 20; i++) { + x += Array.map.apply(undefined, [[0], function(x) { if (i == 10) eval("y = 20"); return 1; }])[0]; +} +assertEq(x, 20); +assertEq(y, 20); + +// Recompilation triggered by local function. + +var o = {}; +function what(q) { + function inner() { return q; } + o.f = inner; + var a = o.f(); + return a; +} +for (var i = 0; i < 10; i++) { + var a = what(i); + assertEq(a, i); +} + +// Lowered scripted call to apply returning code pointer. + +var global = 3; +function foo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(global, true); +} +foo(function(a) { global = a; return 10; }, [1]); +foo(function(a) { global = a; return 10; }, [1]); +foo(function(a) { global = a; return 10; }, [1]); +assertEq(global, 1); +foo(function(a) { global = a; return 3; }, [true]); +assertEq(global, true); + +// Lowered scripted call returning NULL. + +var oglobal = 3; +function xfoo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(oglobal, true); +} +xfoo(function(a) { oglobal = a; return 10; }, [1]); +xfoo(function(a) { oglobal = a; return 10; }, [1]); +xfoo(function(a) { oglobal = a; return 10; }, [1]); +assertEq(oglobal, 1); +xfoo(function(a) { [1,2,3]; oglobal = a; return 3; }, [true]); +assertEq(oglobal, true); + +// Recompilation out of SplatApplyArgs. + +weirdarray = [,,1,2,3]; +Object.defineProperty(weirdarray, 0, {get: function() { vglobal = 'true'; }}); + +var vglobal = 3; +function yfoo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(vglobal, 'true'); + else + assertEq(vglobal, 3); +} +yfoo(function(a) { return 10; }, [1]); +yfoo(function(a) { return 10; }, [1]); +yfoo(function(a) { return 10; }, [1]); +yfoo(function() { return 0; }, weirdarray); diff --git a/js/src/jit-test/tests/jaeger/recompile/flush.js b/js/src/jit-test/tests/jaeger/recompile/flush.js new file mode 100644 index 000000000..81681e604 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/flush.js @@ -0,0 +1,18 @@ + +/* Handle flushing of scripted call ICs pointing to recompiled functions. */ + +function add(x, y) { + var z = x + y; + return String(x + y); +} + +function foo() { + var x = 0x7ffffff0; + var res = ""; + for (var i = 0; i < 20; i++) { + res += add(x, i) + ","; + res += add(x, i) + ","; + } + assertEq(res, "2147483632,2147483632,2147483633,2147483633,2147483634,2147483634,2147483635,2147483635,2147483636,2147483636,2147483637,2147483637,2147483638,2147483638,2147483639,2147483639,2147483640,2147483640,2147483641,2147483641,2147483642,2147483642,2147483643,2147483643,2147483644,2147483644,2147483645,2147483645,2147483646,2147483646,2147483647,2147483647,2147483648,2147483648,2147483649,2147483649,2147483650,2147483650,2147483651,2147483651,"); +} +foo(); diff --git a/js/src/jit-test/tests/jaeger/recompile/getelem.js b/js/src/jit-test/tests/jaeger/recompile/getelem.js new file mode 100644 index 000000000..1c976ac7e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/getelem.js @@ -0,0 +1,26 @@ + +/* Unexpected values out of GETELEM */ + +function foo() { + var x = [1,2,3]; + var y; + var z = x[y]; + y = 10; + assertEq(z, "twelve"); +} +Array.prototype["undefined"] = "twelve"; +foo(); + +function fna() { + var a = {}; + a[true] = 1; + assertEq(a["true"], 1); +} +fna(); + +function fnb() { + var a = []; + a[1.1] = 2; + assertEq(a["1.1"], 2); +} +fnb(); diff --git a/js/src/jit-test/tests/jaeger/recompile/incdec.js b/js/src/jit-test/tests/jaeger/recompile/incdec.js new file mode 100644 index 000000000..93786ba34 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/incdec.js @@ -0,0 +1,92 @@ + +/* Handle recompilation on overflow of inc/dec operations. */ + +function local() +{ + var j = 0x7ffffff0; + for (var i = 0; i < 100; i++) + j++; + assertEq(j, 2147483732); +} +local(); + +function olocal() +{ + var j = 0x7ffffff0; + for (var i = 0; i < 100; i++) { + if (j++ == 5000) + break; + } + assertEq(j, 2147483732); +} +olocal(); + +function arg(j) +{ + for (var i = 0; i < 100; i++) + j++; + assertEq(j, 2147483732); +} +arg(0x7ffffff0); + +function oarg(j) +{ + for (var i = 0; i < 100; i++) { + if (j++ == 5000) + break; + } + assertEq(j, 2147483732); +} +oarg(0x7ffffff0); + +// basic global inc/dec correctness +var x = 1.23; +x = x--; +x = x++; +x = ++x; +x = --x; +assertEq(x, 1.23); + +var g = 0x7ffffff0; +function glob() +{ + for (var i = 0; i < 100; i++) + g++; + assertEq(g, 2147483732); +} +glob(); + +function gname() +{ + n = 0x7ffffff0; + for (var i = 0; i < 100; i++) + n++; + assertEq(n, 2147483732); +} +gname(); + +function prop() +{ + var v = {f: 0x7ffffff0}; + for (var i = 0; i < 100; i++) + v.f++; + assertEq(v.f, 2147483732); +} +prop(); + +function elem(v, f) +{ + for (var i = 0; i < 100; i++) + v[f]++; + assertEq(v.f, 2147483732); +} +elem({f: 0x7ffffff0}, "f"); + +function name() +{ + var v = 0x7ffffff0; + var i; + eval("for (i = 0; i < 100; i++) v++"); + assertEq(v + 10, 2147483742); +} +name(); diff --git a/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js b/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js new file mode 100644 index 000000000..05a7ee8ef --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js @@ -0,0 +1,43 @@ +// rejoining after recompilation from CompileFunction or a native called by an inlined frame. + +var global = 0; +var arr = [ + function() { return 0; }, + function() { return 1; }, + function() { return 2; }, + function() { return 3; }, + function() { return 4; }, + function() { return 5; }, + function() { return 6; }, + function() { return 7; }, + function() { global = -"three"; return 8; } + ]; +function wrap_call(i) { + var fn = arr["" + i]; + return fn(); +} +function foo1() { + var res = 0; + for (var i = 0; i < arr.length; i++) { + res += wrap_call(i); + var expected = (i == arr.length - 1) ? NaN : 10; + assertEq(global + 10, expected); + } +} +foo1(); + +var callfn = Function.call; +function wrap_floor(x, y) { + var z = x; + if (y) + z = {}; // trick the compiler into not inlining the floor() call. + return Math.floor(z); +} + +function foo2(x, y) { + var z = 0; + for (var i = 0; i < y; i++) + z = wrap_floor(x + i, false); + assertEq(z + 10, 2147483661); +} +foo2(0x7ffffff0 + .5, 20); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-01.js b/js/src/jit-test/tests/jaeger/recompile/memory-01.js new file mode 100644 index 000000000..aa1474621 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-01.js @@ -0,0 +1,12 @@ + +function foo(n) { + for (var i = 0; i < n; i++) {} + return i; +} + +assertEq(foo(1000), 1000); + +gc(); + +eval("assertEq(foo(1000.5), 1001)"); + diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-02.js b/js/src/jit-test/tests/jaeger/recompile/memory-02.js new file mode 100644 index 000000000..875487abc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-02.js @@ -0,0 +1,19 @@ + +var g = 10; + +function bar(n) { + return g; +} + +function foo(n, v) { + for (var i = 0; i < n; i++) + assertEq(bar(i), v); +} + +foo(10, 10); + +gc(); + +eval("g = 10.5"); + +foo(10, 10.5); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-03.js b/js/src/jit-test/tests/jaeger/recompile/memory-03.js new file mode 100644 index 000000000..c5eaf8296 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-03.js @@ -0,0 +1,6 @@ + +eval("var x = 10; function foo() { return x; }"); + +assertEq(foo(), 10); +gc(); +assertEq(foo(), 10); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-04.js b/js/src/jit-test/tests/jaeger/recompile/memory-04.js new file mode 100644 index 000000000..794c93802 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-04.js @@ -0,0 +1,8 @@ + +function foo(x, y) { + gc(); + var z = x + y; + print(z); +} + +foo(0x7ffffff0, 100); diff --git a/js/src/jit-test/tests/jaeger/recompile/native.js b/js/src/jit-test/tests/jaeger/recompile/native.js new file mode 100644 index 000000000..72a6c2576 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/native.js @@ -0,0 +1,26 @@ + +/* Handle recompilations triggered by native calls. */ + +function dofloor(v) +{ + var res = ""; + for (var i = 0; i < 10; i++) { + var q = Math.floor(v + i); + res += q + ","; + } + assertEq(res, "2147483642,2147483643,2147483644,2147483645,2147483646,2147483647,2147483648,2147483649,2147483650,2147483651,"); +} +dofloor(0x7ffffffa + .5); + +function mapfloor(a) +{ + var b = a.map(function(v) { return Math.floor(v); }); + + var res = ""; + for (var i = 0; i < b.length; i++) + res += b[i] + ","; + return res; +} +mapfloor([1,2]); +mapfloor([3,4]); +assertEq(mapfloor([0x7ffffffa + 2.5, 0x7ffffffa + 20.5]), "2147483644,2147483662,"); diff --git a/js/src/jit-test/tests/jaeger/recompile/nativemulti.js b/js/src/jit-test/tests/jaeger/recompile/nativemulti.js new file mode 100644 index 000000000..d61158697 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/nativemulti.js @@ -0,0 +1,21 @@ + +/* Recompilation that requires patching the same native stub multiple times. */ + +var first = 0; +var second = 0; + +function foreachweird(a, f, vfirst, vsecond) +{ + a.forEach(f); + assertEq(first, vfirst); + assertEq(second, vsecond); +} + +function weird() { + eval("first = 'one';"); + eval("second = 'two';"); +} + +foreachweird([0], function() {}, 0, 0); +foreachweird([0], function() {}, 0, 0); +foreachweird([0], weird, 'one', 'two'); diff --git a/js/src/jit-test/tests/jaeger/recompile/nativestack.js b/js/src/jit-test/tests/jaeger/recompile/nativestack.js new file mode 100644 index 000000000..350649afc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/nativestack.js @@ -0,0 +1,25 @@ + +/* Recompilation that requires patching the same native stub multiple times on one stack. */ + +var first = 0; +var second = 0; + +function eacher(f, vfirst, vsecond) { + var a = [0]; + a.forEach(f); + assertEq(first, vfirst); + assertEq(second, vsecond); +} + +function one() { + eacher(two, 'one', 'two'); +} + +function two() { + eval("first = 'one';"); + eval("second = 'two';"); +} + +eacher(function () {}, 0, 0); +eacher(function () {}, 0, 0); +eacher(one, 'one', 'two'); diff --git a/js/src/jit-test/tests/jaeger/recompile/patchdouble.js b/js/src/jit-test/tests/jaeger/recompile/patchdouble.js new file mode 100644 index 000000000..4de083813 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/patchdouble.js @@ -0,0 +1,7 @@ +// only fix doubles for slots which the recompiled script thinks are doubles. +function foo(x) { + var y = x & 0xffff; + y = (y * (x * 1000)); + assertEq(y, 140735340806145000); +} +foo(0x7fffffff); diff --git a/js/src/jit-test/tests/jaeger/recompile/property.js b/js/src/jit-test/tests/jaeger/recompile/property.js new file mode 100644 index 000000000..37223563a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/property.js @@ -0,0 +1,26 @@ + +/* Handle recompilation on undefined properties and array holes. */ + +var v = {}; +if (typeof v == 'string') + v.x = 0; +function prop(v) +{ + var z = v.x + 1; + assertEq(z, NaN); +} +prop(v); + +v = []; +v[0] = 0; +v[1] = 1; +v[3] = 3; +v[4] = 4; +function elem(x) +{ + var x = ""; + for (var i = 0; i < 5; i++) + x += v[i]; + assertEq(x, "01undefined34"); +} +elem(v); diff --git a/js/src/jit-test/tests/jaeger/recompile/propic.js b/js/src/jit-test/tests/jaeger/recompile/propic.js new file mode 100644 index 000000000..f394c4c46 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/propic.js @@ -0,0 +1,24 @@ + +/* Recompilation while being processed by property ICs. */ + +var ga = 10; +var gb = 10; + +Object.defineProperty(Object.prototype, "a", { + set: function(a) { eval("ga = true;"); }, + get: function() { eval("gb = true;"); } + }); + +function foo() { + var x = {}; + x.a = 10; + assertEq(ga + 1, 2); +} +foo(); + +function bar() { + var x = {}; + var a = x.a; + assertEq(gb + 1, 2); +} +bar(); diff --git a/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js b/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js new file mode 100644 index 000000000..738777244 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js @@ -0,0 +1,26 @@ + +// overflows occurring during constant folding + +var y = -null - y; +assertEq(y, NaN); + +var x = -(void 0); +assertEq(x, NaN); + +function overdiv() { + for(var i=0; i<25; i++) { + var a, b; + function f() { + } + a = f(); + b = (123 ^ 1) / 1234; + } +} +overdiv(); + +function overadd() { + var a = 0x7ffffff0; + var b = 100; + return a + b; +} +overadd(); diff --git a/js/src/jit-test/tests/jaeger/recompile/undef.js b/js/src/jit-test/tests/jaeger/recompile/undef.js new file mode 100644 index 000000000..a738c802c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/undef.js @@ -0,0 +1,61 @@ + +/* Handle recompilation on undefined variables. */ + +function local() +{ + var x; + x++; + assertEq(x, NaN); + x = 0; +} +local(); + +function name(v) +{ + var x; + with (v) { + x++; + assertEq(x, NaN); + } + assertEq(x, NaN); + x = 0; +} +name({}); + +function letname(v) +{ + if (v) { + let x; + with (v) { + x = "twelve"; + } + assertEq(x, "twelve"); + } +} +letname({}); + +function upvar() +{ + var x; + function inner() { + x++; + assertEq(x, NaN); + } + inner(); +} +upvar(); + +var x; +var y; + +function global() +{ + x++; + assertEq(x, NaN); + var z = 2 + y; + assertEq(z, NaN); +} +global(); + +x = 0; +y = 0; diff --git a/js/src/jit-test/tests/jaeger/regalloc-double.js b/js/src/jit-test/tests/jaeger/regalloc-double.js new file mode 100644 index 000000000..8d49eb54f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/regalloc-double.js @@ -0,0 +1,12 @@ +// register allocation involving doubles. + +function foo(a,b) { + var c; + if (a < b) { + c = a + 1; + } else { + c = 0.5; + } + return c; +} +assertEq(foo(0, 1), 1); diff --git a/js/src/jit-test/tests/jaeger/regalloc-live.js b/js/src/jit-test/tests/jaeger/regalloc-live.js new file mode 100644 index 000000000..b50ee2a2d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/regalloc-live.js @@ -0,0 +1,41 @@ + +// test local/arg liveness analysis in presence of many locals + +function foo(a, b, c) { + var x = 0, y = 0, z = 0; + if (a < b) { + x = a + 0; + y = b + 0; + z = c + 0; + } else { + x = a; + y = b; + z = c; + } + return x + y + z; +} +assertEq(foo(1, 2, 3), 6); + +// restore liveness correctly before switch statements + +function foo(a, b, c) { + var x = 0, y = 0, z = 0; + if (a < b) { + x = a + 0; + y = b + 0; + z = c + 0; + } else { + switch (c) { + case 1: + case 2: + case 3: + case 4: + case 5: return 0; + } + x = 0; + y = 0; + z = 0; + } + return x + y + z; +} +assertEq(foo(1, 2, 3), 6); diff --git a/js/src/jit-test/tests/jaeger/regress-bug625701.js b/js/src/jit-test/tests/jaeger/regress-bug625701.js new file mode 100644 index 000000000..a6f24d9bd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/regress-bug625701.js @@ -0,0 +1,10 @@ +gczeal(2); + +for(var i=0; i<20; i++) { + function f() { + for (var j = 0; j < 3; j++) { + (function() {})(); + } + } + f(); +} diff --git a/js/src/jit-test/tests/jaeger/rsh-sanity-1.js b/js/src/jit-test/tests/jaeger/rsh-sanity-1.js new file mode 100644 index 000000000..3127a32ab --- /dev/null +++ b/js/src/jit-test/tests/jaeger/rsh-sanity-1.js @@ -0,0 +1,17 @@ +/* Unknown types. */ +function rsh(lhs, rhs) { return lhs >> rhs; } +assertEq(rsh(1024, 2), 256) +assertEq(rsh(1024.5, 2), 256) +assertEq(rsh(1024.5, 2.0), 256) + +/* Constant rhs. */ +var lhs = 1024; +assertEq(lhs >> 2, 256); +lhs = 1024.5; +assertEq(lhs >> 2, 256); + +/* Constant lhs. */ +var rhs = 2; +assertEq(256, 1024 >> rhs); +var rhs = 2.0; +assertEq(256, 1024 >> rhs); diff --git a/js/src/jit-test/tests/jaeger/scriptedICs-1.js b/js/src/jit-test/tests/jaeger/scriptedICs-1.js new file mode 100644 index 000000000..b0fd505c7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/scriptedICs-1.js @@ -0,0 +1,39 @@ +T = 12; + +function arity2(q, w, r, t, y) { + var Q1; + var Q2; + var Q3; + var Q4; + var Q5; + var Q6; + var Q7; + var Q8; + var Q9; + T; + return arguments; +} + +function arity(q, w, r) { + var Q1; + var Q2; + var Q3; + var Q4; + var Q5; + var Q6; + var Q7; + var Q8; + var Q9; + T; + return Q9; +} + +for (var i = 0; i < 10; i++) { + arity(); + if (i == 6) + arity = arity2; +} + +/* Don't assert - stubs::CompileFunction must correct |regs.sp| */ + + diff --git a/js/src/jit-test/tests/jaeger/setPropTypeGuard.js b/js/src/jit-test/tests/jaeger/setPropTypeGuard.js new file mode 100644 index 000000000..3786fc88a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/setPropTypeGuard.js @@ -0,0 +1,23 @@ + +/* + * Get a SETPROP site which is monitored (unknown lhs) and is repeatedly + * invoked on objects with the same shape but different types (and without + * triggering a recompile of the function). The SETPROP PIC needs a type guard + * when the object is being monitored. + */ +var x = {g:0}; +var y = {g:0,f:"fubar"}; +x.f = 10; + +function foo(x) { + for (var i = 0; i < 30; i++) + x.f = 10; +} +function access(x) { + return x.f + 10; +} +foo(Object.create({})); +eval("foo(x)"); +assertEq(access(y), "fubar10"); +eval("foo(y)"); +assertEq(access(y), 20); diff --git a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js new file mode 100644 index 000000000..c63d36bf2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js @@ -0,0 +1,112 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testInt8Array(L) { + var f = new Int8Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 500; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], -12); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testUint8Array(L) { + var f = new Uint8Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 500; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], 244); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testUint8ClampedArray(L) { + var f = new Uint8ClampedArray(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 500; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], 255); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testInt16Array(L) { + var f = new Int16Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 190000; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], -6608); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +function testUint16Array(L) { + var f = new Uint16Array(8); + assertEq(f[0], 0); + assertEq(f[L], 0); + assertEq(f[L+8], undefined); + assertEq(f[8], undefined); + f[0] = 12; + f[L+1] = 13; + f[2] = f[1]; + f[L+3] = 190000; + f[L+4] = true; + f[L+5] = L; + assertEq(f[0], 12); + assertEq(f[1], 13); + assertEq(f[2], 13); + assertEq(f[3], 58928); + assertEq(f[4], 1); + assertEq(f[5], 0); +} + +for (var i = 0; i < 10; i++) { + testInt8Array(0); + testUint8Array(0); + testUint8ClampedArray(0); + testInt16Array(0); + testUint16Array(0); + if (i == 5) + gc(); +} + diff --git a/js/src/jit-test/tests/jaeger/strictModeSetUndefinedVar.js b/js/src/jit-test/tests/jaeger/strictModeSetUndefinedVar.js new file mode 100644 index 000000000..99b846c17 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/strictModeSetUndefinedVar.js @@ -0,0 +1,8 @@ +// |jit-test| error: ReferenceError; + +function f() { + "use strict"; + foo = 1; +} + +f(); diff --git a/js/src/jit-test/tests/jaeger/subCommutativity.js b/js/src/jit-test/tests/jaeger/subCommutativity.js new file mode 100644 index 000000000..89885c27a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/subCommutativity.js @@ -0,0 +1,4 @@ +assertEq(6 - ((void 0) ^ 0x80000005), 2147483649); + +var x = ((void 0) ^ 0x80000005); +assertEq(6 - x, 2147483649); diff --git a/js/src/jit-test/tests/jaeger/tableSwitchConst.js b/js/src/jit-test/tests/jaeger/tableSwitchConst.js new file mode 100644 index 000000000..6422af318 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/tableSwitchConst.js @@ -0,0 +1,18 @@ +function f() { + switch(2) { + case 1: return 1; + case 2: return 2; + default: return -1; + } +} +assertEq(f(), 2); + +function g() { + switch(3.14) { + case 3: return 3; + case 4: return 4; + default: return -1; + } +} +assertEq(g(), -1); + diff --git a/js/src/jit-test/tests/jaeger/tableSwitchDouble.js b/js/src/jit-test/tests/jaeger/tableSwitchDouble.js new file mode 100644 index 000000000..df9fe2a55 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/tableSwitchDouble.js @@ -0,0 +1,13 @@ + +function f(a) { + switch(a) { + case 3: return 3; + case 4: return 4; + default: return -1; + } +} + +assertEq(f(-0.0), -1); +assertEq(f(3.14), -1); +assertEq(f(12.34), -1); + diff --git a/js/src/jit-test/tests/jaeger/tableSwitchEmpty.js b/js/src/jit-test/tests/jaeger/tableSwitchEmpty.js new file mode 100644 index 000000000..42a050dc6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/tableSwitchEmpty.js @@ -0,0 +1,14 @@ + +function f(a) { + switch(a) { + } + switch(a) { + default: return 0; + } + assertEq(0, 1); +} + +assertEq(f(), 0); +assertEq(f(0), 0); +assertEq(f(1.1), 0); + diff --git a/js/src/jit-test/tests/jaeger/tableSwitchFloat.js b/js/src/jit-test/tests/jaeger/tableSwitchFloat.js new file mode 100644 index 000000000..6422af318 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/tableSwitchFloat.js @@ -0,0 +1,18 @@ +function f() { + switch(2) { + case 1: return 1; + case 2: return 2; + default: return -1; + } +} +assertEq(f(), 2); + +function g() { + switch(3.14) { + case 3: return 3; + case 4: return 4; + default: return -1; + } +} +assertEq(g(), -1); + diff --git a/js/src/jit-test/tests/jaeger/tableSwitchNeg.js b/js/src/jit-test/tests/jaeger/tableSwitchNeg.js new file mode 100644 index 000000000..ae370262e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/tableSwitchNeg.js @@ -0,0 +1,27 @@ + +function f(a) { + switch(a) { + case -1: return 1; + case -2: return 2; + case -5: return 5; + default: return 10; + } +} + +assertEq(f(-1), 1); +assertEq(f(-2), 2); +assertEq(f(-5), 5); + +assertEq(f(-3), 10); +assertEq(f(-6), 10); +assertEq(f(0), 10); +assertEq(f(1), 10); + +assertEq(f(-2147483647), 10); +assertEq(f(-2147483648), 10); +assertEq(f(-2147483649), 10); + +assertEq(f(2147483647), 10); +assertEq(f(2147483648), 10); +assertEq(f(2147483649), 10); + diff --git a/js/src/jit-test/tests/jaeger/testAddStringObject.js b/js/src/jit-test/tests/jaeger/testAddStringObject.js new file mode 100644 index 000000000..0ed0288e6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testAddStringObject.js @@ -0,0 +1,17 @@ +String.prototype.m = function(s) { + return this.indexOf('a'); +}; + +var g = function(s) { + return (s + 'asdf').m(); +}; + +var h = function(s) { + return ('asdf' + s).m(); +}; + +var ix = g(new String('abc')); +assertEq(ix, 0); + +var ix = h(new String('abc')); +assertEq(ix, 0); diff --git a/js/src/jit-test/tests/jaeger/testBug550743.js b/js/src/jit-test/tests/jaeger/testBug550743.js new file mode 100644 index 000000000..50349d6a3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testBug550743.js @@ -0,0 +1,21 @@ +expected = ''; + +function g(code) { + f = Function(code); + gen = f(); + gen.next(); + try { gen.next(); } catch (ex) { expected = ex.toString() } +} + +g("\ + yield this.__defineGetter__('x', function(){ return z }); \ + let z = new String('hi'); \ + "); + +eval(); +gc(); + +str = x; + +assertEq(expected, "[object StopIteration]"); +assertEq(str.toString(), "hi"); diff --git a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js new file mode 100644 index 000000000..369aa2c6f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js @@ -0,0 +1,20 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function A() { + this.x = 12; + this.y = function () { return this.x; }; + this[1] = function () { return this.x; }; +} + +function f(obj, key){ + assertEq(obj[key](), 12); +} + +a = new A(); +f(a, "y"); +f(a, "y"); +f(a, 1); +gc(); +f(a, "y"); +f(a, "y"); + diff --git a/js/src/jit-test/tests/jaeger/testDenseCallElem.js b/js/src/jit-test/tests/jaeger/testDenseCallElem.js new file mode 100644 index 000000000..0301048bf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testDenseCallElem.js @@ -0,0 +1,89 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function fillDense(a) { +} + +function testDenseUKeyUArray(a, key) { + a.push(function () { return this[3]; }); + a.push(function () { return this[4]; }); + a.push(function() { return this[5]; }); + a.push(20); + a.push("hi"); + a.push(500); + assertEq(a[key](), 20); + assertEq(a[key + 1](), "hi"); + assertEq(a[key + 2](), 500); +} + +function testDenseVKeyUArray(a) { + a.push(function () { return this[3]; }); + a.push(function () { return this[4]; }); + a.push(function() { return this[5]; }); + a.push(20); + a.push("hi"); + a.push(500); + var key = a.length & 1; + assertEq(a[key](), 20); + assertEq(a[(key + 1) & 3](), "hi"); + assertEq(a[(key + 2) & 3](), 500); +} + +function testDenseKKeyUArray(a, key) { + a.push(function () { return this[3]; }); + a.push(function () { return this[4]; }); + a.push(function() { return this[5]; }); + a.push(20); + a.push("hi"); + a.push(500); + assertEq(a[0](), 20); + assertEq(a[1](), "hi"); + assertEq(a[2](), 500); +} + +function testDenseUKeyVArray(key) { + var a = [function () { return this[3]; }, + function () { return this[4]; }, + function() { return this[5]; }, + 20, + "hi", + 500]; + assertEq(a[key](), 20); + assertEq(a[key + 1](), "hi"); + assertEq(a[key + 2](), 500); +} + +function testDenseVKeyVArray() { + var a = [function () { return this[3]; }, + function () { return this[4]; }, + function() { return this[5]; }, + 20, + "hi", + 500]; + var key = a.length & 1; + assertEq(a[key](), 20); + assertEq(a[(key + 1) & 3](), "hi"); + assertEq(a[(key + 2) & 3](), 500); +} + +function testDenseKKeyVArray() { + var a = [function () { return this[3]; }, + function () { return this[4]; }, + function() { return this[5]; }, + 20, + "hi", + 500]; + assertEq(a[0](), 20); + assertEq(a[1](), "hi"); + assertEq(a[2](), 500); +} + +for (var i = 0; i < 5; i++) { + testDenseUKeyUArray([], 0); + testDenseVKeyUArray([]); + testDenseKKeyUArray([]); + testDenseUKeyVArray(0); + testDenseVKeyVArray(); + testDenseKKeyVArray(); +} + + diff --git a/js/src/jit-test/tests/jaeger/testForOps.js b/js/src/jit-test/tests/jaeger/testForOps.js new file mode 100644 index 000000000..773aae249 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testForOps.js @@ -0,0 +1,67 @@ +// |jit-test| +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function assertObjectsEqual(obj1, obj2) { + assertEq(obj1.a, obj2.a); + assertEq(obj1.b, obj2.b); + assertEq(obj1.c, obj2.c); + assertEq(obj1.d, obj2.d); + assertEq(obj2.a, 1); + assertEq(obj2.b, "bee"); + assertEq(obj2.c, "crab"); + assertEq(obj2.d, 12); +} + +function forName(obj) { + eval(''); + var r = { }; + for (x in obj) + r[x] = obj[x]; + return r; +} + +function forGlobalName(obj) { + var r = { }; + for (x in obj) + r[x] = obj[x]; + return r; +} + +function forProp(obj) { + var r = { }; + var c = { }; + for (c.x in obj) + r[c.x] = obj[c.x]; + return r; +} + +function forElem(obj, x) { + var r = { }; + var c = { }; + for (c[x] in obj) + r[c[x]] = obj[c[x]]; + return r; +} + +function forLocal(obj) { + var r = { }; + for (var x in obj) + r[x] = obj[x]; + return r; +} + +function forArg(obj, x) { + var r = { }; + for (x in obj) + r[x] = obj[x]; + return r; +} + +var obj = { a: 1, b: "bee", c: "crab", d: 12 }; +assertObjectsEqual(obj, forName(obj)); +assertObjectsEqual(obj, forGlobalName(obj)); +assertObjectsEqual(obj, forProp(obj)); +assertObjectsEqual(obj, forElem(obj, "v")); +assertObjectsEqual(obj, forLocal(obj)); +assertObjectsEqual(obj, forArg(obj)); + diff --git a/js/src/jit-test/tests/jaeger/testIfEqX.js b/js/src/jit-test/tests/jaeger/testIfEqX.js new file mode 100644 index 000000000..6940619e6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testIfEqX.js @@ -0,0 +1,37 @@ +// Tests for IFEQX and GOTOX ops. +function testIfElse() { + var src = + "var a = 0;\n" + + "if (x) {\n"; + for (var i=0; i<7000; i++) { + src += "a = 1;"; + } + src += "} else {\n"; + for (var i=0; i<7000; i++) { + src += "a = 2;"; + } + src += "}\n"; + src += "return a;"; + + var f = new Function("x", src); + assertEq(f(true), 1); + assertEq(f(false), 2); + assertEq(f([1, 2, 3]), 1); + assertEq(f(), 2); +} +testIfElse(); + +function testWhile() { + var src = + "var i = 0, j = 0;\n" + + "while (i++ < 50) {\n"; + for (var i=0; i<5000; i++) { + src += "j = i;"; + } + src += "}\n"; + src += "return j;"; + + var f = new Function(src); + assertEq(f(), 50); +} +testWhile(); diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem.js b/js/src/jit-test/tests/jaeger/testPropCallElem.js new file mode 100644 index 000000000..2bb97fbe6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testPropCallElem.js @@ -0,0 +1,93 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testUKeyUObject(a, key1, key2, key3) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testVKeyUObject(a, key1, key2, key3) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + assertEq(a["" + key1](), 20); + assertEq(a["" + key2](), "hi"); + assertEq(a["" + key3](), 500); +} + +function testKKeyUObject(a) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + var key1 = "a"; + var key2 = "b"; + var key3 = "c"; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testUKeyVObject(key1, key2, key3) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +function testVKeyVObject(key1, key2, key3) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + assertEq(a["" + key1](), 20); + assertEq(a["" + key2](), "hi"); + assertEq(a["" + key3](), 500); +} + +function testKKeyVObject(a) { + a = { a: function () { return this.d; }, + b: function () { return this.e; }, + c: function () { return this.f; }, + d: 20, + e: "hi", + f: 500 + }; + var key1 = "a"; + var key2 = "b"; + var key3 = "c"; + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +for (var i = 0; i < 5; i++) { + testUKeyUObject({}, "a", "b", "c"); + testVKeyUObject({}, "a", "b", "c"); + testKKeyUObject({}); + testUKeyVObject("a", "b", "c"); + testVKeyVObject("a", "b", "c"); + testKKeyVObject(); +} + + diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem2.js b/js/src/jit-test/tests/jaeger/testPropCallElem2.js new file mode 100644 index 000000000..43f8efb0f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testPropCallElem2.js @@ -0,0 +1,20 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testUKeyUObject(a, key1, key2, key3) { + a.a = function () { return this.d; } + a.b = function () { return this.e; } + a.c = function() { return this.f; } + a.d = 20; + a.e = "hi"; + a.f = 500; + delete a["b"]; + Object.defineProperty(a, "b", { get: function () { return function () { return this.e; } } }); + assertEq(a[key1](), 20); + assertEq(a[key2](), "hi"); + assertEq(a[key3](), 500); +} + +for (var i = 0; i < 5; i++) + testUKeyUObject({}, "a", "b", "c"); + + diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js new file mode 100644 index 000000000..ed8fc7c9a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js @@ -0,0 +1,41 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testBadSetElems(obj, key) { + obj[key] = 5; + obj[-1] = 5; + var L = obj; + L[L] = L; + obj = []; + obj.K = 5; + obj[2] = 5; + var T = "a"; + obj[T] = 12; + obj = []; + obj[Object] = key; +} + +function testDenseSets(L) { + var obj = [,,,,,,,,,,]; + obj[2] = 2; + assertEq(obj[2], 2); + var T = L; + assertEq(obj[T], 2); + assertEq(obj.length, 10); + obj[10] = T; + assertEq(obj[10], T); + assertEq(obj.length, 11); + var K = T + 9; + obj[K] = K; + assertEq(obj[K], K); + assertEq(obj.length, 12); + obj[K + 1] = obj; + assertEq(obj[K + 1], obj); + assertEq(obj.length, 13); +} + +for (var i = 0; i < 10; i++) { + testBadSetElems([], -1); + testDenseSets(2); +} + + diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js new file mode 100644 index 000000000..01b42bd6b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js @@ -0,0 +1,36 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function f() { + return [[], [], [], []]; +} + +function setelem(obj, key, val) { + obj[key] = val; +} + +// Generate IC +setelem([], 0, "hi"); +setelem([], 0, "hi"); + +// Get some arrays pre-indexing. +var arrays = f(); + +// Do bad stuff. +Object.defineProperty(Object.prototype, "1", { set: function (v) { this.kettle = v; } }); + +var k = arrays[0]; +setelem(k, 1, 13); +assertEq(k.kettle, 13); +assertEq(k.hasOwnProperty("1"), false); + +Object.defineProperty(Array.prototype, "2", { set: function (v) { this.pot = v; } }); +k = arrays[1]; +setelem(k, 2, "yam"); +assertEq(k.pot, "yam"); + +gc(); + +// make sure this reset okay. +setelem([], 0, "hi"); +setelem([], 0, "hi"); + diff --git a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js new file mode 100644 index 000000000..f202513d5 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js @@ -0,0 +1,24 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function f() { + return [[], [], [], []]; +} + +function setelem(obj, key, val) { + obj[key] = val; +} + +// Generate IC +setelem([], 0, "hi"); +setelem([], 0, "hi"); + +var arrays = f(); + +var evil = { }; +Object.defineProperty(evil, "1", { set: function (v) { this.ham = v; } }); +Array.prototype.__proto__ = evil; + +var k = arrays[0]; +setelem(k, 1, "yam"); +assertEq(k.ham, "yam"); + diff --git a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js new file mode 100644 index 000000000..33e38dd3f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js @@ -0,0 +1,61 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testSetTypedFloat32Array(k) { + var ar = new Float32Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 897 * 800 * 800 * 810 * 1923437; + var t = k + 555; + var L = ar[k+7] = t & 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3" + k; + ar[k+3] = true; + assertEq(ar[0] - 12.3 >= 0 && + ar[0] - 12.3 <= 0.0001, true); + assertEq(ar[1], 500); + assertEq(ar[2], 30); + assertEq(ar[3], 1); + assertEq(ar[4], 715525927453369300000); + assertEq(ar[5], NaN); + assertEq(ar[6], NaN); + assertEq(ar[7], 1); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedFloat64Array(k) { + var ar = new Float64Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 897 * 800 * 800 * 810 * 1923437; + var t = k + 555; + var L = ar[k+7] = t & 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3" + k; + ar[k+3] = true; + assertEq(ar[0] - 12.3 >= 0 && + ar[0] - 12.3 <= 0.0001, true); + assertEq(ar[1], 500); + assertEq(ar[2], 30); + assertEq(ar[3], 1); + assertEq(ar[4], 715525949998080000000); + assertEq(ar[5], NaN); + assertEq(ar[6], NaN); + assertEq(ar[7], 1); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +for (var i = 0; i <= 10; i++) { + testSetTypedFloat32Array(0); + testSetTypedFloat64Array(0); + if (i == 5) + gc(); +} + diff --git a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js new file mode 100644 index 000000000..89e943b69 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js @@ -0,0 +1,190 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function testSetTypedInt8Array(k) { + var ar = new Int8Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = k + 800; + var t = k + 555; + var t = ar[k+7] = t & 5; + ar[0] = 12; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], -12); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], 32); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 1); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedUint8ClampedArray(k) { + var ar = new Uint8ClampedArray(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = k + 800; + var t = k + 555; + var L = ar[k+7] = t & 5; + var Q = ar[k+7] = t + 5; + ar[0] = 12; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = -500; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], 0); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], 255); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 255); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedUint8Array(k) { + var ar = new Uint8Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = k + 800; + var t = k + 555; + var L = ar[k+7] = t + 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], 244); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], 32); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 48); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedInt16Array(k) { + var ar = new Int16Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 800 * 800 * 913; + var t = k + 555; + var L = ar[k+7] = t + 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500000; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], -24288); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], -32768); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 560); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedUint16Array(k) { + var ar = new Uint16Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 800 * 800 * 913; + var t = k + 555; + var L = ar[k+7] = t + 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500000; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], 41248); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], 32768); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 560); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedInt32Array(k) { + var ar = new Int32Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 800 * 800 * 800 * 800; + var t = k + 555; + var L = ar[k+7] = t + 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], 500); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], -234881024); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 560); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +function testSetTypedUint32Array(k) { + var ar = new Uint32Array(8); + ar[k+5] = { }; + ar[k+6] = ar; + ar[k+4] = (k + 800) * 800 * 800 * 800 * 800; + var t = k + 555; + var L = ar[k+7] = t + 5; + ar[0] = 12.3; + ar[8] = 500; + ar[k+8] = 1200; + ar[k+1] = 500; + ar[k+2] = "3"; + ar[k+3] = true; + assertEq(ar[0], 12); + assertEq(ar[1], 500); + assertEq(ar[2], 3); + assertEq(ar[3], 1); + assertEq(ar[4], 4060086272); + assertEq(ar[5], 0); + assertEq(ar[6], 0); + assertEq(ar[7], 560); + assertEq(ar[8], undefined); + assertEq(ar[k+8], undefined); +} + +for (var i = 0; i <= 10; i++) { + testSetTypedInt8Array(0); + testSetTypedUint8Array(0); + testSetTypedUint8ClampedArray(0); + testSetTypedInt16Array(0); + testSetTypedUint16Array(0); + testSetTypedInt32Array(0); + testSetTypedUint32Array(0); + if (i == 5) + gc(); +} + diff --git a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js new file mode 100644 index 000000000..1cbe064d3 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js @@ -0,0 +1,12 @@ +// vim: set ts=8 sts=4 et sw=4 tw=99: + +function f(a) { + var x = a; + var y = x; + + assertEq((x << y), (a << a)); + assertEq((y << x), (a << a)); +} + +f(2); + diff --git a/js/src/jit-test/tests/jaeger/testTableSwitchX.js b/js/src/jit-test/tests/jaeger/testTableSwitchX.js new file mode 100644 index 000000000..c92d4c275 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/testTableSwitchX.js @@ -0,0 +1,25 @@ +// Tests for JSOP_TABLESWITCHX. +function test1() { + var src = + "var a = 0;\n" + + "switch(x) {\n"; + for (var i=-1; i<4; i++) { + src += (i >= 0) ? + "case " + i + ":\n" : + "default:\n"; + for (var j=0; j<1500; j++) { + src += "a = " + i + ";"; + } + src += "break;\n"; + } + src += "}\n"; + src += "return a;"; + + var f = new Function("x", src); + assertEq(f(0), 0); + assertEq(f(4), -1); + assertEq(f(), -1); + assertEq(f(1.1), -1); + assertEq(f(3), 3); +} +test1(); diff --git a/js/src/jit-test/tests/jaeger/undoAdd.js b/js/src/jit-test/tests/jaeger/undoAdd.js new file mode 100644 index 000000000..007a29c97 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/undoAdd.js @@ -0,0 +1,25 @@ + +/* Test undoing addition in overflow paths when under heavy register pressure. */ + +function add1(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } +function add2(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } +function add3(x, y, a, b, res) { var nres = res + 0; var z = (x + a) + (y + b); assertEq(z, nres); } +add1(0x7ffffff0, 100, 0, 0, 2147483732); +add2(-1000, -0x80000000, 0, 0, -2147484648); +add3(-0x80000000, -1000, 0, 0, -2147484648); + +function cadd1(x, a, b, res) { + var nres = res + 0; + var nb = b + 0; + var z = (x + a) + 1000; + assertEq(z, nres + nb); +} +cadd1(0x7ffffff0, 0, 0, 2147484632); + +function cadd2(x, a, b, res) { + var nres = res + 0; + var nb = b + 0; + var z = (x + a) + (-0x80000000); + assertEq(z, nres + nb); +} +cadd2(-1000, 0, 0, -2147484648); diff --git a/js/src/jit-test/tests/jaeger/unsignedShiftZero.js b/js/src/jit-test/tests/jaeger/unsignedShiftZero.js new file mode 100644 index 000000000..e199677d0 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/unsignedShiftZero.js @@ -0,0 +1,8 @@ + +function f(a) { + return a >>> 0; +}; + +assertEq(f(-2147483647), 2147483649); +assertEq(f(-2147483648), 2147483648); +assertEq(f(-2147483649), 2147483647); diff --git a/js/src/jit-test/tests/jaeger/xor-sanity.js b/js/src/jit-test/tests/jaeger/xor-sanity.js new file mode 100644 index 000000000..4f41e0fce --- /dev/null +++ b/js/src/jit-test/tests/jaeger/xor-sanity.js @@ -0,0 +1 @@ +assertEq(-2^31, -31); -- cgit v1.2.3