| OLD | NEW |
| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 fprintf(stderr, "%s\n", *message_line); | 303 fprintf(stderr, "%s\n", *message_line); |
| 304 for (int i = 0; i <= message->GetEndColumn(); ++i) { | 304 for (int i = 0; i <= message->GetEndColumn(); ++i) { |
| 305 fprintf(stderr, "%c", i < message->GetStartColumn() ? ' ' : '^'); | 305 fprintf(stderr, "%c", i < message->GetStartColumn() ? ' ' : '^'); |
| 306 } | 306 } |
| 307 fprintf(stderr, "\n"); | 307 fprintf(stderr, "\n"); |
| 308 } | 308 } |
| 309 | 309 |
| 310 | 310 |
| 311 int main(int argc, char** argv) { | 311 int main(int argc, char** argv) { |
| 312 V8::InitializeICU(); | 312 V8::InitializeICU(); |
| 313 i::Isolate::SetCrashIfDefaultIsolateInitialized(); |
| 313 | 314 |
| 314 // By default, log code create information in the snapshot. | 315 // By default, log code create information in the snapshot. |
| 315 i::FLAG_log_code = true; | 316 i::FLAG_log_code = true; |
| 316 | 317 |
| 317 // Print the usage if an error occurs when parsing the command line | 318 // Print the usage if an error occurs when parsing the command line |
| 318 // flags or if the help flag is set. | 319 // flags or if the help flag is set. |
| 319 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 320 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 320 if (result > 0 || argc != 2 || i::FLAG_help) { | 321 if (result > 0 || argc != 2 || i::FLAG_help) { |
| 321 ::printf("Usage: %s [flag] ... outfile\n", argv[0]); | 322 ::printf("Usage: %s [flag] ... outfile\n", argv[0]); |
| 322 i::FlagList::PrintHelp(); | 323 i::FlagList::PrintHelp(); |
| 323 return !i::FLAG_help; | 324 return !i::FLAG_help; |
| 324 } | 325 } |
| 325 #ifdef COMPRESS_STARTUP_DATA_BZ2 | 326 #ifdef COMPRESS_STARTUP_DATA_BZ2 |
| 326 BZip2Decompressor natives_decompressor; | 327 BZip2Decompressor natives_decompressor; |
| 327 int bz2_result = natives_decompressor.Decompress(); | 328 int bz2_result = natives_decompressor.Decompress(); |
| 328 if (bz2_result != BZ_OK) { | 329 if (bz2_result != BZ_OK) { |
| 329 fprintf(stderr, "bzip error code: %d\n", bz2_result); | 330 fprintf(stderr, "bzip error code: %d\n", bz2_result); |
| 330 exit(1); | 331 exit(1); |
| 331 } | 332 } |
| 332 #endif | 333 #endif |
| 333 Isolate* isolate = Isolate::GetCurrent(); | 334 i::FLAG_logfile_per_isolate = false; |
| 335 |
| 336 Isolate* isolate = v8::Isolate::New(); |
| 337 isolate->Enter(); |
| 334 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 338 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 335 i::Serializer::Enable(internal_isolate); | 339 i::Serializer::Enable(internal_isolate); |
| 336 Persistent<Context> context; | 340 Persistent<Context> context; |
| 337 { | 341 { |
| 338 HandleScope handle_scope(isolate); | 342 HandleScope handle_scope(isolate); |
| 339 context.Reset(isolate, Context::New(isolate)); | 343 context.Reset(isolate, Context::New(isolate)); |
| 340 } | 344 } |
| 341 | 345 |
| 342 if (context.IsEmpty()) { | 346 if (context.IsEmpty()) { |
| 343 fprintf(stderr, | 347 fprintf(stderr, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 "", | 437 "", |
| 434 ser.CurrentAllocationAddress(i::NEW_SPACE), | 438 ser.CurrentAllocationAddress(i::NEW_SPACE), |
| 435 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), | 439 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), |
| 436 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), | 440 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), |
| 437 ser.CurrentAllocationAddress(i::CODE_SPACE), | 441 ser.CurrentAllocationAddress(i::CODE_SPACE), |
| 438 ser.CurrentAllocationAddress(i::MAP_SPACE), | 442 ser.CurrentAllocationAddress(i::MAP_SPACE), |
| 439 ser.CurrentAllocationAddress(i::CELL_SPACE), | 443 ser.CurrentAllocationAddress(i::CELL_SPACE), |
| 440 ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE)); | 444 ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE)); |
| 441 return 0; | 445 return 0; |
| 442 } | 446 } |
| OLD | NEW |