| @@ -49,9 +49,6 @@ class RuntimeProfiler { | ||
| void Reset(); | ||
| void TearDown(); | ||
|
|
||
| void NotifyICChanged() { any_ic_changed_ = true; } | ||
|
|
||
| // Rate limiting support. | ||
| @@ -463,8 +463,6 @@ namespace internal { | ||
| F(HasExternalDoubleElements, 1, 1) \ | ||
| F(HasFastProperties, 1, 1) \ | ||
| F(TransitionElementsKind, 2, 1) \ | ||
| F(HaveSameMap, 2, 1) | ||
|
|
||
|
|
||
| @@ -1610,55 +1610,6 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { | ||
| } | ||
|
|
||
|
|
||
| #undef __ | ||
|
|
||
|
|
||
| @@ -0,0 +1,76 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| // Flags: --allow-natives-syntax | ||
|
|
||
| function dead1(a, b) { | ||
| var x = "a" + "b"; | ||
| return a; // x, "a", and "b" are dead code | ||
| } | ||
|
|
||
| function dead2(a, b) { | ||
| var x = "0" + a; | ||
| var y = "0" + b; | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function dead3(a, b) { | ||
| a = a ? "1" : "0"; | ||
| b = b ? "1" : "0"; | ||
| var x = a + "0"; | ||
| var y = b + "0"; | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function run() { | ||
| assertEquals(33, dead1(33, 32)); | ||
| assertEquals(33, dead2(33, 32)); | ||
| assertEquals("1", dead3(33, 32)); | ||
|
|
||
| assertEquals(31, dead1(31, 30)); | ||
| assertEquals(31, dead2(31, 30)); | ||
| assertEquals("1", dead3(31, 32)); | ||
|
|
||
| assertEquals(0, dead1(0, 30)); | ||
| assertEquals(0, dead2(0, 30)); | ||
| assertEquals("0", dead3(0, 32)); | ||
|
|
||
| assertEquals(true, dead1(true, 0)); | ||
| assertEquals(true, dead2(true, 0)); | ||
| assertEquals("1", dead3(true, 0)); | ||
|
|
||
| assertEquals("true", dead1("true", 0)); | ||
| assertEquals("true", dead2("true", 0)); | ||
| assertEquals("1", dead3("true", 0)); | ||
| } | ||
|
|
||
| run(); | ||
| run(); | ||
| %OptimizeFunctionOnNextCall(dead1); | ||
| %OptimizeFunctionOnNextCall(dead2); | ||
| %OptimizeFunctionOnNextCall(dead3); | ||
| run(); |
| @@ -0,0 +1,65 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| function dead1(a, b) { | ||
| var x = "a" + "b"; | ||
| return a; // x, "a", and "b" are dead code | ||
| } | ||
|
|
||
| function dead2(a, b) { | ||
| var x = a + "0"; | ||
| var y = b + "0"; | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function dead3(a, b) { | ||
| a = a ? "1" : "0"; | ||
| b = b ? "1" : "0"; | ||
| var x = a + "0"; | ||
| var y = b + "0"; | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| assertEquals(33, dead1(33, 32)); | ||
| assertEquals(33, dead2(33, 32)); | ||
| assertEquals("1", dead3(33, 32)); | ||
|
|
||
| assertEquals(31, dead1(31, 30)); | ||
| assertEquals(31, dead2(31, 30)); | ||
| assertEquals("1", dead3(31, 32)); | ||
|
|
||
| assertEquals(0, dead1(0, 30)); | ||
| assertEquals(0, dead2(0, 30)); | ||
| assertEquals("0", dead3(0, 32)); | ||
|
|
||
| assertEquals(true, dead1(true, 0)); | ||
| assertEquals(true, dead2(true, 0)); | ||
| assertEquals("1", dead3(true, 0)); | ||
|
|
||
| assertEquals("true", dead1("true", 0)); | ||
| assertEquals("true", dead2("true", 0)); | ||
| assertEquals("1", dead3("true", 0)); |
| @@ -0,0 +1,81 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| // Flags: --allow-natives-syntax | ||
|
|
||
| var S1 = "string1"; | ||
| var S2 = "@@string2"; | ||
|
|
||
| function dead1(a, b) { | ||
| var x = %StringCharCodeAt(a, 4); | ||
| return a; // x is dead code | ||
| } | ||
|
|
||
| function dead2(a, b) { | ||
| var x = %StringCharCodeAt(a, 3); | ||
| var y = %StringCharCodeAt(b, 1); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function dead3(a, b) { | ||
| a = a ? "11" : "12"; | ||
| b = b ? "13" : "14"; | ||
| var x = %StringCharCodeAt(a, 2); | ||
| var y = %StringCharCodeAt(b, 0); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function test() { | ||
| var S3 = S1 + S2; | ||
|
|
||
| assertEquals(S1, dead1(S1, S2)); | ||
| assertEquals(S1, dead2(S1, S2)); | ||
| assertEquals("11", dead3(S1, S2)); | ||
|
|
||
| assertEquals(S2, dead1(S2, 677)); | ||
| assertEquals(S2, dead2(S2, S3)); | ||
| assertEquals("11", dead3(S2, S3)); | ||
|
|
||
| assertEquals(S3, dead1(S3, 399)); | ||
| assertEquals(S3, dead2(S3, "false")); | ||
| assertEquals("12", dead3(0, 32)); | ||
|
|
||
| assertEquals(S3, dead1(S3, 0)); | ||
| assertEquals(S3, dead2(S3, S1)); | ||
| assertEquals("11", dead3(S3, 0)); | ||
|
|
||
| assertEquals("true", dead1("true", 0)); | ||
| assertEquals("true", dead2("true", S3)); | ||
| assertEquals("11", dead3("true", 0)); | ||
| } | ||
|
|
||
| test(); | ||
| test(); | ||
| %OptimizeFunctionOnNextCall(dead1); | ||
| %OptimizeFunctionOnNextCall(dead2); | ||
| %OptimizeFunctionOnNextCall(dead3); | ||
| test(); |
| @@ -0,0 +1,81 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| // Flags: --allow-natives-syntax | ||
|
|
||
| var S1 = "string1"; | ||
| var S2 = "@@string2"; | ||
|
|
||
| function dead1(a, b) { | ||
| var x = %_StringCharCodeAt(a, 4); | ||
| return a; // x is dead code | ||
| } | ||
|
|
||
| function dead2(a, b) { | ||
| var x = %_StringCharCodeAt(a, 3); | ||
| var y = %_StringCharCodeAt(b, 1); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function dead3(a, b) { | ||
| a = a ? "11" : "12"; | ||
| b = b ? "13" : "14"; | ||
| var x = %_StringCharCodeAt(a, 2); | ||
| var y = %_StringCharCodeAt(b, 0); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function test() { | ||
| var S3 = S1 + S2; | ||
|
|
||
| assertEquals(S1, dead1(S1, S2)); | ||
| assertEquals(S1, dead2(S1, S2)); | ||
| assertEquals("11", dead3(S1, S2)); | ||
|
|
||
| assertEquals(S2, dead1(S2, 677)); | ||
| assertEquals(S2, dead2(S2, S3)); | ||
| assertEquals("11", dead3(S2, S3)); | ||
|
|
||
| assertEquals(S3, dead1(S3, 399)); | ||
| assertEquals(S3, dead2(S3, "false")); | ||
| assertEquals("12", dead3(0, 32)); | ||
|
|
||
| assertEquals(S3, dead1(S3, 0)); | ||
| assertEquals(S3, dead2(S3, S1)); | ||
| assertEquals("11", dead3(S3, 0)); | ||
|
|
||
| assertEquals("true", dead1("true", 0)); | ||
| assertEquals("true", dead2("true", S3)); | ||
| assertEquals("11", dead3("true", 0)); | ||
| } | ||
|
|
||
| test(); | ||
| test(); | ||
| %OptimizeFunctionOnNextCall(dead1); | ||
| %OptimizeFunctionOnNextCall(dead2); | ||
| %OptimizeFunctionOnNextCall(dead3); | ||
| test(); |
| @@ -0,0 +1,76 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| // Flags: --allow-natives-syntax | ||
|
|
||
| function dead1(a, b) { | ||
| var x = %_StringCharFromCode(a); | ||
| return a; // x is dead code | ||
| } | ||
|
|
||
| function dead2(a, b) { | ||
| var x = %_StringCharFromCode(a); | ||
| var y = %_StringCharFromCode(b); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function dead3(a, b) { | ||
| a = a ? 11 : 12; | ||
| b = b ? 13 : 14; | ||
| var x = %_StringCharFromCode(a); | ||
| var y = %_StringCharFromCode(b); | ||
| return a; // x and y are both dead | ||
| } | ||
|
|
||
| function test() { | ||
| assertEquals(33, dead1(33, 32)); | ||
| assertEquals(33, dead2(33, 32)); | ||
| assertEquals(11, dead3(33, 32)); | ||
|
|
||
| assertEquals(31, dead1(31, 30)); | ||
| assertEquals(31, dead2(31, 30)); | ||
| assertEquals(11, dead3(31, 32)); | ||
|
|
||
| assertEquals(0, dead1(0, 30)); | ||
| assertEquals(0, dead2(0, 30)); | ||
| assertEquals(12, dead3(0, 32)); | ||
|
|
||
| assertEquals(true, dead1(true, 0)); | ||
| assertEquals(true, dead2(true, 0)); | ||
| assertEquals(11, dead3(true, 0)); | ||
|
|
||
| assertEquals("true", dead1("true", 0)); | ||
| assertEquals("true", dead2("true", 0)); | ||
| assertEquals(11, dead3("true", 0)); | ||
| } | ||
|
|
||
| test(); | ||
| test(); | ||
| %OptimizeFunctionOnNextCall(dead1); | ||
| %OptimizeFunctionOnNextCall(dead2); | ||
| %OptimizeFunctionOnNextCall(dead3); | ||
| test(); |
| @@ -253,8 +253,3 @@ array-feedback: SKIP | ||
|
|
||
| # Deopt every n garbage collections collides with the deopt every n times flag. | ||
| regress/regress-2653: SKIP | ||
| @@ -0,0 +1,49 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions are | ||
| // met: | ||
| // | ||
| // * Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // * Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // * Neither the name of Google Inc. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| function testPrepareStackTrace(closure) { | ||
| var error = undefined; | ||
| try { | ||
| closure(); | ||
| assertUnreachable(); | ||
| } catch (e) { | ||
| error = e; | ||
| } | ||
|
|
||
| // We expect custom formatting to be lazy. Setting the custom | ||
| // function right before calling error.stack should be fine. | ||
| Error.prepareStackTrace = function(e, frames) { | ||
| return "bar"; | ||
| } | ||
|
|
||
| assertEquals("bar", error.stack); | ||
| Error.prepareStackTrace = undefined; | ||
| } | ||
|
|
||
| testPrepareStackTrace(function() { throw new Error("foo"); }); | ||
| testPrepareStackTrace(function f() { f(); }); | ||
|
|
| @@ -0,0 +1,36 @@ | ||
| # Copyright 2013 the V8 project authors. All rights reserved. | ||
| # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
| # are met: | ||
| # 1. Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # 2. Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
| # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| This test how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow. | ||
|
|
||
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
|
||
|
|
||
| FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. | ||
| FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. | ||
| FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. | ||
| FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. | ||
| PASS successfullyParsed is true | ||
|
|
||
| TEST COMPLETE | ||
|
|
| @@ -0,0 +1,78 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
| // | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions | ||
| // are met: | ||
| // 1. Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // 2. Redistributions in binary form must reproduce the above copyright | ||
| // notice, this list of conditions and the following disclaimer in the | ||
| // documentation and/or other materials provided with the distribution. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
| // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| // DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| description("This test how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow."); | ||
|
|
||
| function simpleRecursion(depth) { | ||
| if (depth) | ||
| simpleRecursion(depth - 1); | ||
| } | ||
|
|
||
| try { | ||
| simpleRecursion(17472); | ||
| } catch (ex) { | ||
| debug("FAIL: " + ex); | ||
| } | ||
|
|
||
| try { | ||
| simpleRecursion(10000000); | ||
| } catch (ex) { | ||
| var msg = String(eval(ex)); | ||
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); | ||
| } | ||
|
|
||
| try { | ||
| simpleRecursion(1000000000); | ||
| } catch (ex) { | ||
| var msg = String(eval(ex)); | ||
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); | ||
| } | ||
|
|
||
| var tooFewArgsDepth = 0; | ||
|
|
||
| function tooFewArgsRecursion(a) { | ||
| if (tooFewArgsDepth) { | ||
| tooFewArgsDepth--; | ||
| tooFewArgsRecursion(); | ||
| } | ||
| } | ||
|
|
||
| try { | ||
| tooFewArgsDepth = 10000000; | ||
| tooFewArgsRecursion(); | ||
| } catch (ex) { | ||
| var msg = String(eval(ex)); | ||
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); | ||
| } | ||
|
|
||
| function tooManyArgsRecursion(depth) { | ||
| if (depth) | ||
| tooManyArgsRecursion(depth - 1, 1); | ||
| } | ||
|
|
||
| try { | ||
| tooManyArgsRecursion(10000000, 1); | ||
| } catch (ex) { | ||
| var msg = String(eval(ex)); | ||
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); | ||
| } |
| @@ -0,0 +1,83 @@ | ||
| # Copyright 2013 the V8 project authors. All rights reserved. | ||
| # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
| # are met: | ||
| # 1. Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # 2. Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
| # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| This test checks toString() round-trip decompilation for binary and unary operators. | ||
|
|
||
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
|
||
|
|
||
| PASS decompiledFunction is 'function () { x + + y;}' | ||
| PASS decompiledFunction is 'function () { x + - y;}' | ||
| PASS decompiledFunction is 'function () { x - + y;}' | ||
| PASS decompiledFunction is 'function () { x - - y;}' | ||
| PASS decompiledFunction is 'function () { x * + y;}' | ||
| PASS decompiledFunction is 'function () { x * - y;}' | ||
| PASS decompiledFunction is 'function () { x / + y;}' | ||
| PASS decompiledFunction is 'function () { x / - y;}' | ||
| PASS decompiledFunction is 'function () { x % + y;}' | ||
| PASS decompiledFunction is 'function () { x % - y;}' | ||
| PASS decompiledFunction is 'function () { x++ + y;}' | ||
| PASS decompiledFunction is 'function () { x++ - y;}' | ||
| PASS decompiledFunction is 'function () { x++ * y;}' | ||
| PASS decompiledFunction is 'function () { x++ / y;}' | ||
| PASS decompiledFunction is 'function () { x-- + y;}' | ||
| PASS decompiledFunction is 'function () { x-- - y;}' | ||
| PASS decompiledFunction is 'function () { x-- * y;}' | ||
| PASS decompiledFunction is 'function () { x-- / y;}' | ||
| PASS decompiledFunction is 'function () { x + ++y;}' | ||
| PASS decompiledFunction is 'function () { x - ++y;}' | ||
| PASS decompiledFunction is 'function () { x * ++y;}' | ||
| PASS decompiledFunction is 'function () { x / ++y;}' | ||
| PASS decompiledFunction is 'function () { x + --y;}' | ||
| PASS decompiledFunction is 'function () { x - --y;}' | ||
| PASS decompiledFunction is 'function () { x * --y;}' | ||
| PASS decompiledFunction is 'function () { x / --y;}' | ||
| PASS decompiledFunction is 'function () { x++ + ++y;}' | ||
| PASS decompiledFunction is 'function () { x++ - ++y;}' | ||
| PASS decompiledFunction is 'function () { x++ * ++y;}' | ||
| PASS decompiledFunction is 'function () { x++ / ++y;}' | ||
| PASS decompiledFunction is 'function () { x-- + ++y;}' | ||
| PASS decompiledFunction is 'function () { x-- - ++y;}' | ||
| PASS decompiledFunction is 'function () { x-- * ++y;}' | ||
| PASS decompiledFunction is 'function () { x-- / ++y;}' | ||
| PASS decompiledFunction is 'function () { x++ + --y;}' | ||
| PASS decompiledFunction is 'function () { x++ - --y;}' | ||
| PASS decompiledFunction is 'function () { x++ * --y;}' | ||
| PASS decompiledFunction is 'function () { x++ / --y;}' | ||
| PASS decompiledFunction is 'function () { x-- + --y;}' | ||
| PASS decompiledFunction is 'function () { x-- - --y;}' | ||
| PASS decompiledFunction is 'function () { x-- * --y;}' | ||
| PASS decompiledFunction is 'function () { x-- / --y;}' | ||
| PASS decompiledFunction is 'function () { + + x;}' | ||
| PASS decompiledFunction is 'function () { + - x;}' | ||
| PASS decompiledFunction is 'function () { - + x;}' | ||
| PASS decompiledFunction is 'function () { - - x;}' | ||
| PASS decompiledFunction is 'function () { 1;}' | ||
| PASS decompiledFunction is 'function () { -1;}' | ||
| PASS decompiledFunction is 'function () { - -1;}' | ||
| PASS decompiledFunction is 'function () { - - 0;}' | ||
| PASS decompiledFunction is 'function () { - - NaN;}' | ||
| PASS successfullyParsed is true | ||
|
|
||
| TEST COMPLETE | ||
|
|
| @@ -0,0 +1,83 @@ | ||
| // Copyright 2013 the V8 project authors. All rights reserved. | ||
| // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
| // | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions | ||
| // are met: | ||
| // 1. Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // 2. Redistributions in binary form must reproduce the above copyright | ||
| // notice, this list of conditions and the following disclaimer in the | ||
| // documentation and/or other materials provided with the distribution. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
| // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| // DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| description("This test checks toString() round-trip decompilation for binary and unary operators."); | ||
|
|
||
| var tests = [ | ||
| "x + + y", | ||
| "x + - y", | ||
| "x - + y", | ||
| "x - - y", | ||
| "x * + y", | ||
| "x * - y", | ||
| "x / + y", | ||
| "x / - y", | ||
| "x % + y", | ||
| "x % - y", | ||
| "x++ + y", | ||
| "x++ - y", | ||
| "x++ * y", | ||
| "x++ / y", | ||
| "x-- + y", | ||
| "x-- - y", | ||
| "x-- * y", | ||
| "x-- / y", | ||
| "x + ++y", | ||
| "x - ++y", | ||
| "x * ++y", | ||
| "x / ++y", | ||
| "x + --y", | ||
| "x - --y", | ||
| "x * --y", | ||
| "x / --y", | ||
| "x++ + ++y", | ||
| "x++ - ++y", | ||
| "x++ * ++y", | ||
| "x++ / ++y", | ||
| "x-- + ++y", | ||
| "x-- - ++y", | ||
| "x-- * ++y", | ||
| "x-- / ++y", | ||
| "x++ + --y", | ||
| "x++ - --y", | ||
| "x++ * --y", | ||
| "x++ / --y", | ||
| "x-- + --y", | ||
| "x-- - --y", | ||
| "x-- * --y", | ||
| "x-- / --y", | ||
| "+ + x", | ||
| "+ - x", | ||
| "- + x", | ||
| "- - x", | ||
| "1", | ||
| "-1", | ||
| "- -1", | ||
| "- - 0", | ||
| "- - NaN" | ||
| ]; | ||
|
|
||
| for (test in tests) { | ||
| var decompiledFunction = eval("(function () { " + tests[test] + ";})").toString().replace(/\n/g, ""); | ||
| shouldBe("decompiledFunction", "'function () { " + tests[test] + ";}'"); | ||
| } |
| @@ -0,0 +1,114 @@ | ||
| # Copyright 2013 the V8 project authors. All rights reserved. | ||
| # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
| # are met: | ||
| # 1. Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # 2. Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
| # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
| # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| KDE JS Test | ||
|
|
||
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
|
||
|
|
||
| PASS Array().length is 0 | ||
| PASS (new Array()).length is 0 | ||
| PASS (new Array(3)).length is 3 | ||
| PASS (new Array(11, 22)).length is 2 | ||
| PASS (new Array(11, 22))[0] is 11 | ||
| PASS Array(11, 22)[1] is 22 | ||
| PASS (new Array(11, 22))[3] is undefined. | ||
| PASS String(new Array(11, 22)) is '11,22' | ||
| PASS var a = []; a[0] = 33; a[0] is 33 | ||
| PASS var a = []; a[0] = 33; a.length is 1 | ||
| PASS var a = [11, 22]; a.length = 1; String(a); is '11' | ||
| PASS var a = [11, 22]; a.length = 1; a.length; is 1 | ||
| PASS caught; is true | ||
| PASS ename is 'RangeError' | ||
| PASS caught; is true | ||
| PASS ename is 'RangeError' | ||
| PASS var a = [11, 22]; a.length = 1; a[1]; is undefined. | ||
| PASS Array().toString() is '' | ||
| PASS Array(3).toString() is ',,' | ||
| PASS Array(11, 22).toString() is '11,22' | ||
| PASS String(Array(11, 22).concat(33)) is '11,22,33' | ||
| PASS String(Array(2).concat(33, 44)) is ',,33,44' | ||
| PASS String(Array(2).concat(Array(2))) is ',,,' | ||
| PASS String(Array(11,22).concat(Array(33,44))) is '11,22,33,44' | ||
| PASS String(Array(1,2).concat(3,Array(4,5))) is '1,2,3,4,5' | ||
| PASS var a = new Array(1,2,3); delete a[1]; String(a.concat(4)) is '1,,3,4' | ||
| PASS [1,2,3,4].slice(1, 3).toString() is '2,3' | ||
| PASS [1,2,3,4].slice(-3, -1).toString() is '2,3' | ||
| PASS [1,2].slice(-9, 0).length is 0 | ||
| PASS [1,2].slice(1).toString() is '2' | ||
| PASS [1,2].slice().toString() is '1,2' | ||
| PASS (new Array('a')).length is 1 | ||
| PASS (new Array('a'))[0] is 'a' | ||
| PASS (new Array('a'))[1] is undefined. | ||
| PASS Array('a').length is 1 | ||
| PASS Array('a')[0] is 'a' | ||
| PASS String(Array()) is '' | ||
| PASS String(Array('a','b')) is 'a,b' | ||
| PASS [].length is 0 | ||
| PASS ['a'].length is 1 | ||
| PASS ['a'][0] is 'a' | ||
| PASS ['a',,'c'][2] is 'c' | ||
| PASS ['a',undefined,'c'][1] is undefined | ||
| PASS ['a',,'c'][1] is undefined | ||
| PASS 1 in ['a',,'c'] is false | ||
| PASS 1 in ['a',undefined,'c'] is true | ||
| PASS 1 in arrayWithDeletion is false | ||
| PASS forInSum([]) is '' | ||
| PASS forInSum(Array()) is '' | ||
| PASS forInSum(Array('a')) is 'a' | ||
| PASS forInSum([,undefined,'x','aa']) is 'undefinedxaa' | ||
| PASS forInSum(a0) is '' | ||
| PASS forInSum(a1) is 'a' | ||
| PASS String([].sort()) is '' | ||
| PASS String([3,1,'2'].sort()) is '1,2,3' | ||
| PASS String([,'x','aa'].sort()) is 'aa,x,' | ||
| PASS String([,undefined,'x','aa'].sort()) is 'aa,x,,' | ||
| PASS 2 in [,undefined,'x','aa'].sort() is true | ||
| PASS 3 in [,undefined,'x','aa'].sort() is false | ||
| PASS var a = ['aa', 'b', 'cccc', 'ddd']; String(a.sort(comp)) is 'b,aa,ddd,cccc' | ||
| PASS [0, Infinity].sort(function(a, b) { return a - b }).toString() is '0,Infinity' | ||
| PASS [].unshift('a') is 1 | ||
| PASS ['c'].unshift('a', 'b') is 3 | ||
| PASS var a = []; a.unshift('a'); String(a) is 'a' | ||
| PASS var a = ['c']; a.unshift('a', 'b'); String(a) is 'a,b,c' | ||
| PASS String(['a', 'b', 'c'].splice(1, 2, 'x', 'y')) is 'b,c' | ||
| PASS arr.length is 40 | ||
| PASS arr[maxint] is "test" | ||
| PASS arr.length is 40 | ||
| PASS arr[maxint] is undefined | ||
| PASS arr.length is maxint | ||
| PASS arr[maxint-1] is "test2" | ||
| PASS arr.length is 40 | ||
| PASS arr[55.5] is "test" | ||
| PASS arr[65.11111111111111111111111111111] is "test" | ||
| PASS arr.length is 40 | ||
| PASS arr[55.5] is undefined | ||
| PASS arr[65.11111111111111111111111111111] is undefined | ||
| PASS propnames.length is 3 | ||
| PASS propnames[0] is '0' | ||
| PASS propnames[1] is '1' | ||
| PASS propnames[2] is '2' | ||
| PASS successfullyParsed is true | ||
|
|
||
| TEST COMPLETE | ||
|
|