| OLD | NEW |
| 1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 v8::HandleScope handle_scope(v8_isolate); | 290 v8::HandleScope handle_scope(v8_isolate); |
| 291 v8::Local<v8::Context>::New(v8_isolate, env)->Enter(); | 291 v8::Local<v8::Context>::New(v8_isolate, env)->Enter(); |
| 292 } | 292 } |
| 293 // Make sure all builtin scripts are cached. | 293 // Make sure all builtin scripts are cached. |
| 294 { | 294 { |
| 295 HandleScope scope(isolate); | 295 HandleScope scope(isolate); |
| 296 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { | 296 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
| 297 isolate->bootstrapper()->NativesSourceLookup(i); | 297 isolate->bootstrapper()->NativesSourceLookup(i); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 heap->CollectAllGarbage(); | 300 heap->CollectAllGarbage(Heap::kNoGCFlags); |
| 301 heap->CollectAllGarbage(); | 301 heap->CollectAllGarbage(Heap::kNoGCFlags); |
| 302 | 302 |
| 303 Object* raw_foo; | 303 Object* raw_foo; |
| 304 { | 304 { |
| 305 v8::HandleScope handle_scope(v8_isolate); | 305 v8::HandleScope handle_scope(v8_isolate); |
| 306 v8::Local<v8::String> foo = v8::String::NewFromUtf8(v8_isolate, "foo"); | 306 v8::Local<v8::String> foo = v8::String::NewFromUtf8(v8_isolate, "foo"); |
| 307 DCHECK(!foo.IsEmpty()); | 307 DCHECK(!foo.IsEmpty()); |
| 308 raw_foo = *(v8::Utils::OpenHandle(*foo)); | 308 raw_foo = *(v8::Utils::OpenHandle(*foo)); |
| 309 } | 309 } |
| 310 | 310 |
| 311 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; | 311 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 // Make sure all builtin scripts are cached. | 416 // Make sure all builtin scripts are cached. |
| 417 { | 417 { |
| 418 HandleScope scope(isolate); | 418 HandleScope scope(isolate); |
| 419 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { | 419 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
| 420 isolate->bootstrapper()->NativesSourceLookup(i); | 420 isolate->bootstrapper()->NativesSourceLookup(i); |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 // If we don't do this then we end up with a stray root pointing at the | 423 // If we don't do this then we end up with a stray root pointing at the |
| 424 // context even after we have disposed of env. | 424 // context even after we have disposed of env. |
| 425 heap->CollectAllGarbage(); | 425 heap->CollectAllGarbage(Heap::kNoGCFlags); |
| 426 | 426 |
| 427 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; | 427 int file_name_length = StrLength(FLAG_testing_serialization_file) + 10; |
| 428 Vector<char> startup_name = Vector<char>::New(file_name_length + 1); | 428 Vector<char> startup_name = Vector<char>::New(file_name_length + 1); |
| 429 SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); | 429 SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file); |
| 430 | 430 |
| 431 { | 431 { |
| 432 v8::HandleScope handle_scope(v8_isolate); | 432 v8::HandleScope handle_scope(v8_isolate); |
| 433 v8::Local<v8::Context>::New(v8_isolate, env)->Exit(); | 433 v8::Local<v8::Context>::New(v8_isolate, env)->Exit(); |
| 434 } | 434 } |
| 435 | 435 |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 isolate->Dispose(); | 1550 isolate->Dispose(); |
| 1551 } | 1551 } |
| 1552 | 1552 |
| 1553 | 1553 |
| 1554 TEST(SerializationMemoryStats) { | 1554 TEST(SerializationMemoryStats) { |
| 1555 FLAG_profile_deserialization = true; | 1555 FLAG_profile_deserialization = true; |
| 1556 FLAG_always_opt = false; | 1556 FLAG_always_opt = false; |
| 1557 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 1557 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
| 1558 delete[] blob.data; | 1558 delete[] blob.data; |
| 1559 } | 1559 } |
| OLD | NEW |