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

Side by Side Diff: src/mksnapshot.cc

Issue 12033011: Add Isolate parameter to Persistent class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added explicit Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/handles.cc ('k') | src/profile-generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // Make sure all builtin scripts are cached. 377 // Make sure all builtin scripts are cached.
378 { HandleScope scope; 378 { HandleScope scope;
379 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { 379 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
380 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i); 380 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i);
381 } 381 }
382 } 382 }
383 // If we don't do this then we end up with a stray root pointing at the 383 // If we don't do this then we end up with a stray root pointing at the
384 // context even after we have disposed of the context. 384 // context even after we have disposed of the context.
385 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot"); 385 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot");
386 i::Object* raw_context = *(v8::Utils::OpenHandle(*context)); 386 i::Object* raw_context = *(v8::Utils::OpenHandle(*context));
387 context.Dispose(); 387 context.Dispose(context->GetIsolate());
388 CppByteSink sink(argv[1]); 388 CppByteSink sink(argv[1]);
389 // This results in a somewhat smaller snapshot, probably because it gets rid 389 // This results in a somewhat smaller snapshot, probably because it gets rid
390 // of some things that are cached between garbage collections. 390 // of some things that are cached between garbage collections.
391 i::StartupSerializer ser(&sink); 391 i::StartupSerializer ser(&sink);
392 ser.SerializeStrongReferences(); 392 ser.SerializeStrongReferences();
393 393
394 i::PartialSerializer partial_ser(&ser, sink.partial_sink()); 394 i::PartialSerializer partial_ser(&ser, sink.partial_sink());
395 partial_ser.Serialize(&raw_context); 395 partial_ser.Serialize(&raw_context);
396 396
397 ser.SerializeWeakReferences(); 397 ser.SerializeWeakReferences();
(...skipping 19 matching lines...) Expand all
417 sink.WriteSpaceUsed( 417 sink.WriteSpaceUsed(
418 "", 418 "",
419 ser.CurrentAllocationAddress(i::NEW_SPACE), 419 ser.CurrentAllocationAddress(i::NEW_SPACE),
420 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), 420 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE),
421 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), 421 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE),
422 ser.CurrentAllocationAddress(i::CODE_SPACE), 422 ser.CurrentAllocationAddress(i::CODE_SPACE),
423 ser.CurrentAllocationAddress(i::MAP_SPACE), 423 ser.CurrentAllocationAddress(i::MAP_SPACE),
424 ser.CurrentAllocationAddress(i::CELL_SPACE)); 424 ser.CurrentAllocationAddress(i::CELL_SPACE));
425 return 0; 425 return 0;
426 } 426 }
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698