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

Unified Diff: test/cctest/test-strings.cc

Issue 559993005: Move configuration of ResourceConstraints to Isolate construction (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index d384e3001a7ae3653d5506a4ef0f985aec6eaf32..ef13c4dadf682f6e178dce71c9e70009d703a7e9 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -1209,28 +1209,34 @@ TEST(SliceFromSlice) {
}
-TEST(OneByteArrayJoin) {
+UNINITIALIZED_TEST(OneByteArrayJoin) {
+ v8::Isolate::CreateParams create_params;
// Set heap limits.
- v8::ResourceConstraints constraints;
- constraints.set_max_semi_space_size(1);
- constraints.set_max_old_space_size(4);
- v8::SetResourceConstraints(CcTest::isolate(), &constraints);
-
- // String s is made of 2^17 = 131072 'c' characters and a is an array
- // starting with 'bad', followed by 2^14 times the string s. That means the
- // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
- // summing the lengths of the strings (as Smis) overflows and wraps.
- LocalContext context;
- v8::HandleScope scope(CcTest::isolate());
- v8::TryCatch try_catch;
- CHECK(CompileRun(
- "var two_14 = Math.pow(2, 14);"
- "var two_17 = Math.pow(2, 17);"
- "var s = Array(two_17 + 1).join('c');"
- "var a = ['bad'];"
- "for (var i = 1; i <= two_14; i++) a.push(s);"
- "a.join("");").IsEmpty());
- CHECK(try_catch.HasCaught());
+ create_params.constraints.set_max_semi_space_size(1);
+ create_params.constraints.set_max_old_space_size(4);
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
+ isolate->Enter();
+
+ {
+ // String s is made of 2^17 = 131072 'c' characters and a is an array
+ // starting with 'bad', followed by 2^14 times the string s. That means the
+ // total length of the concatenated strings is 2^31 + 3. So on 32bit systems
+ // summing the lengths of the strings (as Smis) overflows and wraps.
+ LocalContext context(isolate);
+ v8::HandleScope scope(isolate);
+ v8::TryCatch try_catch;
+ CHECK(CompileRun(
+ "var two_14 = Math.pow(2, 14);"
+ "var two_17 = Math.pow(2, 17);"
+ "var s = Array(two_17 + 1).join('c');"
+ "var a = ['bad'];"
+ "for (var i = 1; i <= two_14; i++) a.push(s);"
+ "a.join("
+ ");").IsEmpty());
+ CHECK(try_catch.HasCaught());
+ }
+ isolate->Exit();
+ isolate->Dispose();
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698