--- /dev/null
+// 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);
// (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.
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;
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());
// (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.
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);
# 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
##############################################################################
'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,
'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,
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;
--- /dev/null
+// 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();