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

Side by Side Diff: src/mksnapshot.cc

Issue 141363005: A64: Synchronize with r15204. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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/mips/stub-cache-mips.cc ('k') | src/objects.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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 fclose(fp_); 165 fclose(fp_);
166 } 166 }
167 167
168 void WriteSpaceUsed( 168 void WriteSpaceUsed(
169 const char* prefix, 169 const char* prefix,
170 int new_space_used, 170 int new_space_used,
171 int pointer_space_used, 171 int pointer_space_used,
172 int data_space_used, 172 int data_space_used,
173 int code_space_used, 173 int code_space_used,
174 int map_space_used, 174 int map_space_used,
175 int cell_space_used) { 175 int cell_space_used,
176 int property_cell_space_used) {
176 fprintf(fp_, 177 fprintf(fp_,
177 "const int Snapshot::%snew_space_used_ = %d;\n", 178 "const int Snapshot::%snew_space_used_ = %d;\n",
178 prefix, 179 prefix,
179 new_space_used); 180 new_space_used);
180 fprintf(fp_, 181 fprintf(fp_,
181 "const int Snapshot::%spointer_space_used_ = %d;\n", 182 "const int Snapshot::%spointer_space_used_ = %d;\n",
182 prefix, 183 prefix,
183 pointer_space_used); 184 pointer_space_used);
184 fprintf(fp_, 185 fprintf(fp_,
185 "const int Snapshot::%sdata_space_used_ = %d;\n", 186 "const int Snapshot::%sdata_space_used_ = %d;\n",
186 prefix, 187 prefix,
187 data_space_used); 188 data_space_used);
188 fprintf(fp_, 189 fprintf(fp_,
189 "const int Snapshot::%scode_space_used_ = %d;\n", 190 "const int Snapshot::%scode_space_used_ = %d;\n",
190 prefix, 191 prefix,
191 code_space_used); 192 code_space_used);
192 fprintf(fp_, 193 fprintf(fp_,
193 "const int Snapshot::%smap_space_used_ = %d;\n", 194 "const int Snapshot::%smap_space_used_ = %d;\n",
194 prefix, 195 prefix,
195 map_space_used); 196 map_space_used);
196 fprintf(fp_, 197 fprintf(fp_,
197 "const int Snapshot::%scell_space_used_ = %d;\n", 198 "const int Snapshot::%scell_space_used_ = %d;\n",
198 prefix, 199 prefix,
199 cell_space_used); 200 cell_space_used);
201 fprintf(fp_,
202 "const int Snapshot::%sproperty_cell_space_used_ = %d;\n",
203 prefix,
204 property_cell_space_used);
200 } 205 }
201 206
202 void WritePartialSnapshot() { 207 void WritePartialSnapshot() {
203 int length = partial_sink_.Position(); 208 int length = partial_sink_.Position();
204 fprintf(fp_, "};\n\n"); 209 fprintf(fp_, "};\n\n");
205 fprintf(fp_, "const int Snapshot::context_size_ = %d;\n", length); 210 fprintf(fp_, "const int Snapshot::context_size_ = %d;\n", length);
206 #ifdef COMPRESS_STARTUP_DATA_BZ2 211 #ifdef COMPRESS_STARTUP_DATA_BZ2
207 fprintf(fp_, 212 fprintf(fp_,
208 "const int Snapshot::context_raw_size_ = %d;\n", 213 "const int Snapshot::context_raw_size_ = %d;\n",
209 partial_sink_.raw_size()); 214 partial_sink_.raw_size());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 385 }
381 // Make sure all builtin scripts are cached. 386 // Make sure all builtin scripts are cached.
382 { HandleScope scope(isolate); 387 { HandleScope scope(isolate);
383 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { 388 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
384 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i); 389 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i);
385 } 390 }
386 } 391 }
387 // If we don't do this then we end up with a stray root pointing at the 392 // If we don't do this then we end up with a stray root pointing at the
388 // context even after we have disposed of the context. 393 // context even after we have disposed of the context.
389 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot"); 394 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot");
390 i::Object* raw_context = *(v8::Utils::OpenHandle(*context)); 395 i::Object* raw_context = *v8::Utils::OpenPersistent(context);
391 context.Dispose(isolate); 396 context.Dispose(isolate);
392 CppByteSink sink(argv[1]); 397 CppByteSink sink(argv[1]);
393 // This results in a somewhat smaller snapshot, probably because it gets rid 398 // This results in a somewhat smaller snapshot, probably because it gets rid
394 // of some things that are cached between garbage collections. 399 // of some things that are cached between garbage collections.
395 i::StartupSerializer ser(&sink); 400 i::StartupSerializer ser(&sink);
396 ser.SerializeStrongReferences(); 401 ser.SerializeStrongReferences();
397 402
398 i::PartialSerializer partial_ser(&ser, sink.partial_sink()); 403 i::PartialSerializer partial_ser(&ser, sink.partial_sink());
399 partial_ser.Serialize(&raw_context); 404 partial_ser.Serialize(&raw_context);
400 405
401 ser.SerializeWeakReferences(); 406 ser.SerializeWeakReferences();
402 407
403 #ifdef COMPRESS_STARTUP_DATA_BZ2 408 #ifdef COMPRESS_STARTUP_DATA_BZ2
404 BZip2Compressor compressor; 409 BZip2Compressor compressor;
405 if (!sink.Compress(&compressor)) 410 if (!sink.Compress(&compressor))
406 return 1; 411 return 1;
407 if (!sink.partial_sink()->Compress(&compressor)) 412 if (!sink.partial_sink()->Compress(&compressor))
408 return 1; 413 return 1;
409 #endif 414 #endif
410 sink.WriteSnapshot(); 415 sink.WriteSnapshot();
411 sink.WritePartialSnapshot(); 416 sink.WritePartialSnapshot();
412 417
413 sink.WriteSpaceUsed( 418 sink.WriteSpaceUsed(
414 "context_", 419 "context_",
415 partial_ser.CurrentAllocationAddress(i::NEW_SPACE), 420 partial_ser.CurrentAllocationAddress(i::NEW_SPACE),
416 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), 421 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE),
417 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), 422 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE),
418 partial_ser.CurrentAllocationAddress(i::CODE_SPACE), 423 partial_ser.CurrentAllocationAddress(i::CODE_SPACE),
419 partial_ser.CurrentAllocationAddress(i::MAP_SPACE), 424 partial_ser.CurrentAllocationAddress(i::MAP_SPACE),
420 partial_ser.CurrentAllocationAddress(i::CELL_SPACE)); 425 partial_ser.CurrentAllocationAddress(i::CELL_SPACE),
426 partial_ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE));
421 sink.WriteSpaceUsed( 427 sink.WriteSpaceUsed(
422 "", 428 "",
423 ser.CurrentAllocationAddress(i::NEW_SPACE), 429 ser.CurrentAllocationAddress(i::NEW_SPACE),
424 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), 430 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE),
425 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), 431 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE),
426 ser.CurrentAllocationAddress(i::CODE_SPACE), 432 ser.CurrentAllocationAddress(i::CODE_SPACE),
427 ser.CurrentAllocationAddress(i::MAP_SPACE), 433 ser.CurrentAllocationAddress(i::MAP_SPACE),
428 ser.CurrentAllocationAddress(i::CELL_SPACE)); 434 ser.CurrentAllocationAddress(i::CELL_SPACE),
435 ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE));
429 return 0; 436 return 0;
430 } 437 }
OLDNEW
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698