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 18277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18288 finished = env->GetIsolate()->IdleNotification(IdlePauseInMs); | 18288 finished = env->GetIsolate()->IdleNotification(IdlePauseInMs); |
18289 } | 18289 } |
18290 intptr_t final_size = CcTest::heap()->SizeOfObjects(); | 18290 intptr_t final_size = CcTest::heap()->SizeOfObjects(); |
18291 CHECK(finished); | 18291 CHECK(finished); |
18292 CHECK_LT(final_size, initial_size + 1); | 18292 CHECK_LT(final_size, initial_size + 1); |
18293 } | 18293 } |
18294 | 18294 |
18295 | 18295 |
18296 TEST(Regress2107) { | 18296 TEST(Regress2107) { |
18297 const intptr_t MB = 1024 * 1024; | 18297 const intptr_t MB = 1024 * 1024; |
18298 const int kIdlePauseInMs = 1000; | 18298 const int kIdlePauseInMs = 10000; |
18299 LocalContext env; | 18299 LocalContext env; |
18300 v8::Isolate* isolate = env->GetIsolate(); | 18300 v8::Isolate* isolate = env->GetIsolate(); |
18301 v8::HandleScope scope(env->GetIsolate()); | 18301 v8::HandleScope scope(env->GetIsolate()); |
18302 intptr_t initial_size = CcTest::heap()->SizeOfObjects(); | 18302 intptr_t initial_size = CcTest::heap()->SizeOfObjects(); |
18303 // Send idle notification to start a round of incremental GCs. | 18303 // Send idle notification to start a round of incremental GCs. |
18304 env->GetIsolate()->IdleNotification(kIdlePauseInMs); | 18304 env->GetIsolate()->IdleNotification(kIdlePauseInMs); |
18305 // Emulate 7 page reloads. | 18305 // Emulate 7 page reloads. |
18306 for (int i = 0; i < 7; i++) { | 18306 for (int i = 0; i < 7; i++) { |
18307 { | 18307 { |
18308 v8::HandleScope inner_scope(env->GetIsolate()); | 18308 v8::HandleScope inner_scope(env->GetIsolate()); |
(...skipping 5518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23827 char chunk2[] = | 23827 char chunk2[] = |
23828 "XXr = 13;\n" | 23828 "XXr = 13;\n" |
23829 " return foob\xeb\x91\x80\xeb\x91\x80r;\n" | 23829 " return foob\xeb\x91\x80\xeb\x91\x80r;\n" |
23830 "}\n"; | 23830 "}\n"; |
23831 chunk1[strlen(chunk1) - 1] = reference[0]; | 23831 chunk1[strlen(chunk1) - 1] = reference[0]; |
23832 chunk2[0] = reference[1]; | 23832 chunk2[0] = reference[1]; |
23833 chunk2[1] = reference[2]; | 23833 chunk2[1] = reference[2]; |
23834 const char* chunks[] = {chunk1, chunk2, "foo();", NULL}; | 23834 const char* chunks[] = {chunk1, chunk2, "foo();", NULL}; |
23835 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8); | 23835 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8); |
23836 } | 23836 } |
OLD | NEW |