Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: test/cctest/test-strings.cc

Issue 2942543002: [heap] Allow a minimum semi-space size of 512K. (Closed)
Patch Set: kb Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/unittests/heap/heap-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 string = v8::Utils::OpenHandle(v8::String::Cast(*result)); 1294 string = v8::Utils::OpenHandle(v8::String::Cast(*result));
1295 CHECK(string->IsSlicedString()); 1295 CHECK(string->IsSlicedString());
1296 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); 1296 CHECK(SlicedString::cast(*string)->parent()->IsSeqString());
1297 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); 1297 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get()));
1298 } 1298 }
1299 1299
1300 1300
1301 UNINITIALIZED_TEST(OneByteArrayJoin) { 1301 UNINITIALIZED_TEST(OneByteArrayJoin) {
1302 v8::Isolate::CreateParams create_params; 1302 v8::Isolate::CreateParams create_params;
1303 // Set heap limits. 1303 // Set heap limits.
1304 create_params.constraints.set_max_semi_space_size(1); 1304 create_params.constraints.set_max_semi_space_size_in_kb(1024);
1305 create_params.constraints.set_max_old_space_size(7); 1305 create_params.constraints.set_max_old_space_size(7);
1306 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); 1306 create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
1307 v8::Isolate* isolate = v8::Isolate::New(create_params); 1307 v8::Isolate* isolate = v8::Isolate::New(create_params);
1308 isolate->Enter(); 1308 isolate->Enter();
1309 1309
1310 { 1310 {
1311 // String s is made of 2^17 = 131072 'c' characters and a is an array 1311 // String s is made of 2^17 = 131072 'c' characters and a is an array
1312 // starting with 'bad', followed by 2^14 times the string s. That means the 1312 // starting with 'bad', followed by 2^14 times the string s. That means the
1313 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems 1313 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
1314 // summing the lengths of the strings (as Smis) overflows and wraps. 1314 // summing the lengths of the strings (as Smis) overflows and wraps.
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 CHECK_EQ(1, CompileRun("external.indexOf('', 1)") 1660 CHECK_EQ(1, CompileRun("external.indexOf('', 1)")
1661 ->Int32Value(context.local()) 1661 ->Int32Value(context.local())
1662 .FromJust()); 1662 .FromJust());
1663 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)") 1663 CHECK_EQ(-1, CompileRun("external.indexOf('a', 1)")
1664 ->Int32Value(context.local()) 1664 ->Int32Value(context.local())
1665 .FromJust()); 1665 .FromJust());
1666 CHECK_EQ(-1, CompileRun("external.indexOf('$')") 1666 CHECK_EQ(-1, CompileRun("external.indexOf('$')")
1667 ->Int32Value(context.local()) 1667 ->Int32Value(context.local())
1668 .FromJust()); 1668 .FromJust());
1669 } 1669 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/unittests/heap/heap-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698