OLD | NEW |
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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 string = v8::Utils::OpenHandle(v8::String::Cast(*result)); | 1232 string = v8::Utils::OpenHandle(v8::String::Cast(*result)); |
1233 CHECK(string->IsSlicedString()); | 1233 CHECK(string->IsSlicedString()); |
1234 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); | 1234 CHECK(SlicedString::cast(*string)->parent()->IsSeqString()); |
1235 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); | 1235 CHECK_EQ(0, strcmp("cdefghijklmnopqrstuvwx", string->ToCString().get())); |
1236 } | 1236 } |
1237 | 1237 |
1238 | 1238 |
1239 UNINITIALIZED_TEST(OneByteArrayJoin) { | 1239 UNINITIALIZED_TEST(OneByteArrayJoin) { |
1240 v8::Isolate::CreateParams create_params; | 1240 v8::Isolate::CreateParams create_params; |
1241 // Set heap limits. | 1241 // Set heap limits. |
1242 create_params.constraints.set_max_semi_space_size(1 * Page::kPageSize / MB); | 1242 create_params.constraints.set_max_semi_space_size(1); |
1243 create_params.constraints.set_max_old_space_size(6 * Page::kPageSize / MB); | 1243 create_params.constraints.set_max_old_space_size(6); |
1244 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); | 1244 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
1245 v8::Isolate* isolate = v8::Isolate::New(create_params); | 1245 v8::Isolate* isolate = v8::Isolate::New(create_params); |
1246 isolate->Enter(); | 1246 isolate->Enter(); |
1247 | 1247 |
1248 { | 1248 { |
1249 // String s is made of 2^17 = 131072 'c' characters and a is an array | 1249 // String s is made of 2^17 = 131072 'c' characters and a is an array |
1250 // starting with 'bad', followed by 2^14 times the string s. That means the | 1250 // starting with 'bad', followed by 2^14 times the string s. That means the |
1251 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems | 1251 // total length of the concatenated strings is 2^31 + 3. So on 32bit systems |
1252 // summing the lengths of the strings (as Smis) overflows and wraps. | 1252 // summing the lengths of the strings (as Smis) overflows and wraps. |
1253 LocalContext context(isolate); | 1253 LocalContext context(isolate); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 } | 1524 } |
1525 { | 1525 { |
1526 HandleScope scope(isolate); | 1526 HandleScope scope(isolate); |
1527 v8::Local<v8::Value> result = CompileRun( | 1527 v8::Local<v8::Value> result = CompileRun( |
1528 "String.fromCharCode(432, 432, 432, 432, 432, " | 1528 "String.fromCharCode(432, 432, 432, 432, 432, " |
1529 "432, 432, 432, 432, 432, 432, 432, 432, 432, " | 1529 "432, 432, 432, 432, 432, 432, 432, 432, 432, " |
1530 "432, 432, 432, 432, 432, 432, 432, 432, 432)"); | 1530 "432, 432, 432, 432, 432, 432, 432, 432, 432)"); |
1531 CHECK(v8::Utils::OpenHandle(*result)->IsSeqTwoByteString()); | 1531 CHECK(v8::Utils::OpenHandle(*result)->IsSeqTwoByteString()); |
1532 } | 1532 } |
1533 } | 1533 } |
OLD | NEW |