From cde3ed1fe31295dbb72633b3511448a321c02c34 Mon Sep 17 00:00:00 2001 From: "machenbach@chromium.org" Date: Fri, 24 Jan 2014 11:36:45 +0000 Subject: [PATCH] Speed up some mjsunit test cases and clean up test expectations for arm and mips. Many skipped test cases already run very fast. Removing the corresponding expectations. BUG= R=jkummerow@chromium.org, mvstanton@chromium.org Review URL: https://codereview.chromium.org/138503008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/mjsunit/compiler/alloc-number-debug.js | 44 +++++++++++++++++++++++++ test/mjsunit/compiler/regress-arguments.js | 18 ++++++++-- test/mjsunit/compiler/regress-rep-change.js | 7 +++- test/mjsunit/mjsunit.status | 51 +++++++---------------------- test/mjsunit/regress/regress-490.js | 3 ++ test/mjsunit/regress/regress-634-debug.js | 41 +++++++++++++++++++++++ 6 files changed, 120 insertions(+), 44 deletions(-) create mode 100644 test/mjsunit/compiler/alloc-number-debug.js create mode 100644 test/mjsunit/regress/regress-634-debug.js diff --git a/test/mjsunit/compiler/alloc-number-debug.js b/test/mjsunit/compiler/alloc-number-debug.js new file mode 100644 index 0000000..ccfcc0c --- /dev/null +++ b/test/mjsunit/compiler/alloc-number-debug.js @@ -0,0 +1,44 @@ +// Copyright 2014 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 + +// Try to get a GC because of a heap number allocation while we +// have live values (o) in a register. +function f(o) { + var x = 1.5; + var y = 2.5; + for (var i = 1; i < 3; i += 1) { + %SetAllocationTimeout(1, 0, false); + o.val = x + y + i; + %SetAllocationTimeout(-1, -1, true); + } + return o; +} + +var o = { val: 0 }; +f(o); diff --git a/test/mjsunit/compiler/regress-arguments.js b/test/mjsunit/compiler/regress-arguments.js index ebae5a0..d32b435 100644 --- a/test/mjsunit/compiler/regress-arguments.js +++ b/test/mjsunit/compiler/regress-arguments.js @@ -25,6 +25,8 @@ // (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 + // Test of arguments. // Test passing null or undefined as receiver. @@ -35,8 +37,15 @@ function h() { return f.apply(void 0, arguments); } var foo = 42; -for (var i=0; i<1000000; i++) assertEquals(42, g()); -for (var i=0; i<1000000; i++) assertEquals(42, h()); +for (var i = 0; i < 3; i++) assertEquals(42, g()); +%OptimizeFunctionOnNextCall(g); +%OptimizeFunctionOnNextCall(f); +assertEquals(42, g()); + +for (var i = 0; i < 3; i++) assertEquals(42, h()); +%OptimizeFunctionOnNextCall(h); +%OptimizeFunctionOnNextCall(f); +assertEquals(42, h()); var G1 = 21; var G2 = 22; @@ -49,4 +58,7 @@ function u() { Number.prototype.foo = 42; delete Number.prototype.foo; -for (var i=0; i<100000; i++) assertEquals(void 0, u()); +for (var i = 0; i < 3; i++) assertEquals(void 0, u()); +%OptimizeFunctionOnNextCall(u); +%OptimizeFunctionOnNextCall(f); +assertEquals(void 0, u()); diff --git a/test/mjsunit/compiler/regress-rep-change.js b/test/mjsunit/compiler/regress-rep-change.js index 9370999..c8a0983 100644 --- a/test/mjsunit/compiler/regress-rep-change.js +++ b/test/mjsunit/compiler/regress-rep-change.js @@ -25,6 +25,8 @@ // (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 + // Regression test for the case where a phi has two input operands with // the same value. @@ -35,8 +37,11 @@ function test(start) { for (var i = start; i < 10; i++) { } } -var n = 5000000; +var n = 3; for (var i = 0; i < n; ++i) { test(0); } + +%OptimizeFunctionOnNextCall(test); +test(0); diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index 2669d0f..572291a 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -104,6 +104,13 @@ # Tests verifying CHECK and ASSERT. 'verify-check-false': [FAIL, NO_VARIANTS], 'verify-assert-false': [NO_VARIANTS, ['mode == release', PASS], ['mode == debug', FAIL]], + + ############################################################################## + # Tests with different versions for release and debug. + 'compiler/alloc-number': [PASS, ['mode == debug', SKIP]], + 'compiler/alloc-number-debug': [PASS, ['mode == release', SKIP]], + 'regress/regress-634': [PASS, ['mode == debug', SKIP]], + 'regress/regress-634-debug': [PASS, ['mode == release', SKIP]], }], # ALWAYS ############################################################################## @@ -142,30 +149,12 @@ 'string-indexof-2': [PASS, TIMEOUT], 'mirror-object': [PASS, TIMEOUT], - # BUG(3251035): Timeouts in long looping crankshaft optimization - # tests. Skipping because having them timeout takes too long on the - # buildbot. + # Long running tests. Skipping because having them timeout takes too long on + # the buildbot. 'compiler/alloc-number': [SKIP], - 'compiler/array-length': [SKIP], - 'compiler/assignment-deopt': [SKIP], - 'compiler/deopt-args': [SKIP], - 'compiler/inline-compare': [SKIP], - 'compiler/inline-global-access': [SKIP], - 'compiler/optimized-function-calls': [SKIP], - 'compiler/pic': [SKIP], - 'compiler/property-calls': [SKIP], - 'compiler/recursive-deopt': [SKIP], - 'compiler/regress-4': [SKIP], - 'compiler/regress-funcaller': [SKIP], - 'compiler/regress-rep-change': [SKIP], - 'compiler/regress-arguments': [SKIP], - 'compiler/regress-funarguments': [SKIP], - 'compiler/regress-3249650': [SKIP], - 'compiler/simple-deopt': [SKIP], 'regress/regress-490': [SKIP], 'regress/regress-634': [SKIP], 'regress/regress-create-exception': [SKIP], - 'regress/regress-3218915': [SKIP], 'regress/regress-3247124': [SKIP], # Requires bigger stack size in the Genesis and if stack size is increased, @@ -211,30 +200,12 @@ 'mirror-object': [PASS, TIMEOUT], 'string-indexof-2': [PASS, TIMEOUT], - # BUG(3251035): Timeouts in long looping crankshaft optimization - # tests. Skipping because having them timeout takes too long on the - # buildbot. + # Long running tests. Skipping because having them timeout takes too long on + # the buildbot. 'compiler/alloc-number': [SKIP], - 'compiler/array-length': [SKIP], - 'compiler/assignment-deopt': [SKIP], - 'compiler/deopt-args': [SKIP], - 'compiler/inline-compare': [SKIP], - 'compiler/inline-global-access': [SKIP], - 'compiler/optimized-function-calls': [SKIP], - 'compiler/pic': [SKIP], - 'compiler/property-calls': [SKIP], - 'compiler/recursive-deopt': [SKIP], - 'compiler/regress-4': [SKIP], - 'compiler/regress-funcaller': [SKIP], - 'compiler/regress-rep-change': [SKIP], - 'compiler/regress-arguments': [SKIP], - 'compiler/regress-funarguments': [SKIP], - 'compiler/regress-3249650': [SKIP], - 'compiler/simple-deopt': [SKIP], 'regress/regress-490': [SKIP], 'regress/regress-634': [SKIP], 'regress/regress-create-exception': [SKIP], - 'regress/regress-3218915': [SKIP], 'regress/regress-3247124': [SKIP], # Requires bigger stack size in the Genesis and if stack size is increased, diff --git a/test/mjsunit/regress/regress-490.js b/test/mjsunit/regress/regress-490.js index 8dd8959..6ce89db 100644 --- a/test/mjsunit/regress/regress-490.js +++ b/test/mjsunit/regress/regress-490.js @@ -42,6 +42,9 @@ for (var i = 0; i < 10; i++) { var b = ''; for (var j = 0; j < 10; j++) { b += '$1'; + + // TODO(machenbach): Do we need all these replacements? Wouldn't corner + // cases like smallest and biggest suffice? a.replace(/^(.*)/, b); } a += a; diff --git a/test/mjsunit/regress/regress-634-debug.js b/test/mjsunit/regress/regress-634-debug.js new file mode 100644 index 0000000..17ca828 --- /dev/null +++ b/test/mjsunit/regress/regress-634-debug.js @@ -0,0 +1,41 @@ +// Copyright 2014 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 f() { + %SetAllocationTimeout(1, 0, false); + a = new Array(0); + assertEquals(0, a.length); + assertEquals(0, a.length); + %SetAllocationTimeout(-1, -1, true); +} + +f(); +f(); +%OptimizeFunctionOnNextCall(f); +f(); -- 2.7.4