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

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

Issue 932823002: Limit size of first page based on serialized data. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove printf debugging Created 5 years, 10 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-serialize.cc ('k') | no next file » | 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 CHECK(string->IsSlicedString()); 1202 CHECK(string->IsSlicedString());
1203 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); 1203 CHECK(SlicedString::cast(*string)->parent()->IsSeqString());
1204 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); 1204 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get()));
1205 } 1205 }
1206 1206
1207 1207
1208 UNINITIALIZED_TEST(OneByteArrayJoin) { 1208 UNINITIALIZED_TEST(OneByteArrayJoin) {
1209 v8::Isolate::CreateParams create_params; 1209 v8::Isolate::CreateParams create_params;
1210 // Set heap limits. 1210 // Set heap limits.
1211 create_params.constraints.set_max_semi_space_size(1); 1211 create_params.constraints.set_max_semi_space_size(1);
1212 create_params.constraints.set_max_old_space_size(4); 1212 create_params.constraints.set_max_old_space_size(5);
1213 v8::Isolate* isolate = v8::Isolate::New(create_params); 1213 v8::Isolate* isolate = v8::Isolate::New(create_params);
1214 isolate->Enter(); 1214 isolate->Enter();
1215 1215
1216 { 1216 {
1217 // String s is made of 2^17 = 131072 'c' characters and a is an array 1217 // String s is made of 2^17 = 131072 'c' characters and a is an array
1218 // starting with 'bad', followed by 2^14 times the string s. That means the 1218 // starting with 'bad', followed by 2^14 times the string s. That means the
1219 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems 1219 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
1220 // summing the lengths of the strings (as Smis) overflows and wraps. 1220 // summing the lengths of the strings (as Smis) overflows and wraps.
1221 LocalContext context(isolate); 1221 LocalContext context(isolate);
1222 v8::HandleScope scope(isolate); 1222 v8::HandleScope scope(isolate);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1452 CHECK(isolate->has_pending_exception()); \ 1452 CHECK(isolate->has_pending_exception()); \
1453 isolate->clear_pending_exception(); \ 1453 isolate->clear_pending_exception(); \
1454 dummy.Dispose(); \ 1454 dummy.Dispose(); \
1455 } 1455 }
1456 1456
1457 INVALID_STRING_TEST(NewStringFromAscii, char) 1457 INVALID_STRING_TEST(NewStringFromAscii, char)
1458 INVALID_STRING_TEST(NewStringFromUtf8, char) 1458 INVALID_STRING_TEST(NewStringFromUtf8, char)
1459 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) 1459 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
1460 1460
1461 #undef INVALID_STRING_TEST 1461 #undef INVALID_STRING_TEST
OLDNEW
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698