Commit afd8e5a3 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Speed up long-running test cases.

R=ishell@chromium.org

Review URL: https://codereview.chromium.org/85163003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4716b292
......@@ -7514,9 +7514,9 @@ static void TestDebugBreakInLoop(const char* loop_head,
for (int i = 0; loop_bodies[i] != NULL; i++) {
// Perform a lazy deoptimization after various numbers of breaks
// have been hit.
for (int j = 0; j < 11; j++) {
for (int j = 0; j < 7; j++) {
break_point_hit_count_deoptimize = j;
if (j == 10) {
if (j == 6) {
break_point_hit_count_deoptimize = kBreaksPerTest;
}
......
......@@ -1936,8 +1936,8 @@ TEST(ManyLocalsInSharedContext) {
CHECK_EQ(v8::internal::Context::MIN_CONTEXT_SLOTS + num_objects - 1,
context_object->GetChildrenCount());
// Check all the objects have got their names.
// ... well check just every 8th because otherwise it's too slow in debug.
for (int i = 0; i < num_objects - 1; i += 8) {
// ... well check just every 15th because otherwise it's too slow in debug.
for (int i = 0; i < num_objects - 1; i += 15) {
i::EmbeddedVector<char, 100> var_name;
i::OS::SNPrintF(var_name, "f_%d", i);
const v8::HeapGraphNode* f_object = GetProperty(
......
......@@ -25,7 +25,7 @@
// (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: --max-new-space-size=256 --allow-natives-syntax
// Flags: --max-new-space-size=128 --allow-natives-syntax
// Test inlining of Math.floor when assigned to a global.
var flo = Math.floor;
......@@ -140,8 +140,9 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 50; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
......@@ -158,4 +159,4 @@ assertEquals(-0, floorsum(1, -0));
%OptimizeFunctionOnNextCall(floorsum);
// The optimized function will deopt. Run it with enough iterations to try
// to optimize via OSR (triggering the bug).
assertEquals(-0, floorsum(100000, -0));
assertEquals(-0, floorsum(50000, -0));
......@@ -25,7 +25,7 @@
// (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: --max-new-space-size=256 --allow-natives-syntax
// Flags: --max-new-space-size=128 --allow-natives-syntax
// Test inlining of Math.floor when assigned to a local.
var test_id = 0;
......@@ -140,8 +140,9 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 50; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
......
......@@ -34,7 +34,7 @@ function f(p) {
return y+x;
}
for (var i=0; i<10000000; i++) f(42);
for (var i=0; i<100000; i++) f(42);
var result = f("foo");
assertEquals("0foo6", result);
......@@ -37,18 +37,18 @@ var state;
function f() {
var a = 1978;
for (state[2] = 0; state[2] < 5; state[2]++) {
for (state[2] = 0; state[2] < 3; state[2]++) {
void String(a);
}
}
function g() {
for (state[1] = 0; state[1] < 5; state[1]++) {
for (state[1] = 0; state[1] < 3; state[1]++) {
f();
}
}
function h() {
state = [-1, -1, -1];
for (state[0] = 0; state[0] < 5; state[0]++) {
for (state[0] = 0; state[0] < 3; state[0]++) {
g();
}
}
......@@ -123,10 +123,10 @@ TestCase(0, 5, "0,0,1");
TestCase(0, 8, "0,0,3");
// Stepping in the frame #1.
TestCase(1, 0, "0,0,5");
TestCase(1, 3, "0,1,5");
TestCase(1, 8, "0,4,5");
TestCase(1, 0, "0,0,3");
TestCase(1, 3, "0,1,3");
TestCase(1, 7, "0,3,3");
// Stepping in the frame #2.
TestCase(2, 3, "1,5,5");
TestCase(2, 8, "4,5,5");
TestCase(2, 3, "1,3,3");
TestCase(2, 7, "3,3,3");
......@@ -317,7 +317,7 @@ function TestCachedKeyAfterScavenge() {
var a = {};
a[key] = "abc";
for (var i = 0; i < 1000000; i++) {
for (var i = 0; i < 100000; i++) {
a[key] += "a"; // Allocations cause a scavenge.
}
}
......
......@@ -345,7 +345,7 @@ function TestCachedKeyAfterScavenge() {
var a = {};
a[key] = "abc";
for (var i = 0; i < 1000000; i++) {
for (var i = 0; i < 100000; i++) {
a[key] += "a"; // Allocations cause a scavenge.
}
}
......
......@@ -40,12 +40,13 @@ function TestStringify(expected, input) {
var array_1 = [];
var array_2 = [];
array_1[100000] = 1;
array_2[100000] = function() { return 1; };
var nulls = "";
for (var i = 0; i < 100000; i++) {
nulls += 'null,';
array_1[1<<17] = 1;
array_2[1<<17] = function() { return 1; };
var nulls = "null,";
for (var i = 0; i < 17; i++) {
nulls += nulls;
}
expected_1 = '[' + nulls + '1]';
expected_2 = '[' + nulls + 'null]';
TestStringify(expected_1, array_1);
......
......@@ -34,9 +34,9 @@ function function_with_n_locals(n) {
test_suffix = " suffix";
var src = "test_prefix + (function () {"
for (var i = 1; i <= n; i++) {
src += "var x" + i + ";";
src += "; var x" + i;
}
src += "return " + n + ";})() + test_suffix";
src += "; return " + n + ";})() + test_suffix";
return eval(src);
}
......
......@@ -25,7 +25,7 @@
// (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: --max-new-space-size=256 --allow-natives-syntax
// Flags: --max-new-space-size=128 --allow-natives-syntax
var test_id = 0;
......@@ -83,6 +83,7 @@ function test() {
// Test in a loop to cover the custom IC and GC-related issues.
for (var i = 0; i < 100; i++) {
for (var i = 0; i < 10; i++) {
test();
new Array(i * 10000);
}
......@@ -25,7 +25,7 @@
// (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: --expose-debug-as debug --nostack-trace-on-abort
// Flags: --expose-debug-as debug --nostack-trace-on-abort --stack-size=100
function f() {
var i = 0;
......
......@@ -26,9 +26,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var a = [];
var new_space_string = "";
for (var i = 0; i < 128; i++) {
new_space_string += String.fromCharCode((Math.random() * 26 + 65) | 0);
var new_space_string = "a";
for (var i = 0; i < 8; i++) {
new_space_string += new_space_string;
}
for (var i = 0; i < 10000; i++) a.push(new_space_string);
......@@ -40,12 +40,12 @@ json2 = JSON.stringify(a);
assertTrue(json1 == json2, "GC caused JSON.stringify to fail.");
// Check that the slow path of JSON.stringify works correctly wrt GC.
for (var i = 0; i < 100000; i++) {
for (var i = 0; i < 10000; i++) {
var s = i.toString();
assertEquals('"' + s + '"', JSON.stringify(s, null, 0));
}
for (var i = 0; i < 100000; i++) {
for (var i = 0; i < 10000; i++) {
var s = i.toString() + "\u2603";
assertEquals('"' + s + '"', JSON.stringify(s, null, 0));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment