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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 321 } |
322 #ifdef COMPRESS_STARTUP_DATA_BZ2 | 322 #ifdef COMPRESS_STARTUP_DATA_BZ2 |
323 BZip2Decompressor natives_decompressor; | 323 BZip2Decompressor natives_decompressor; |
324 int bz2_result = natives_decompressor.Decompress(); | 324 int bz2_result = natives_decompressor.Decompress(); |
325 if (bz2_result != BZ_OK) { | 325 if (bz2_result != BZ_OK) { |
326 fprintf(stderr, "bzip error code: %d\n", bz2_result); | 326 fprintf(stderr, "bzip error code: %d\n", bz2_result); |
327 exit(1); | 327 exit(1); |
328 } | 328 } |
329 #endif | 329 #endif |
330 i::Serializer::Enable(); | 330 i::Serializer::Enable(); |
331 Isolate* isolate = Isolate::GetCurrent(); | 331 Persistent<Context> context = v8::Context::New(); |
332 Persistent<Context> context; | |
333 { | |
334 HandleScope handle_scope(isolate); | |
335 context.Reset(isolate, Context::New(isolate)); | |
336 } | |
337 | |
338 if (context.IsEmpty()) { | 332 if (context.IsEmpty()) { |
339 fprintf(stderr, | 333 fprintf(stderr, |
340 "\nException thrown while compiling natives - see above.\n\n"); | 334 "\nException thrown while compiling natives - see above.\n\n"); |
341 exit(1); | 335 exit(1); |
342 } | 336 } |
| 337 Isolate* isolate = context->GetIsolate(); |
343 if (i::FLAG_extra_code != NULL) { | 338 if (i::FLAG_extra_code != NULL) { |
344 context->Enter(); | 339 context->Enter(); |
345 // Capture 100 frames if anything happens. | 340 // Capture 100 frames if anything happens. |
346 V8::SetCaptureStackTraceForUncaughtExceptions(true, 100); | 341 V8::SetCaptureStackTraceForUncaughtExceptions(true, 100); |
347 HandleScope scope(isolate); | 342 HandleScope scope(isolate); |
348 const char* name = i::FLAG_extra_code; | 343 const char* name = i::FLAG_extra_code; |
349 FILE* file = i::OS::FOpen(name, "rb"); | 344 FILE* file = i::OS::FOpen(name, "rb"); |
350 if (file == NULL) { | 345 if (file == NULL) { |
351 fprintf(stderr, "Failed to open '%s': errno %d\n", name, errno); | 346 fprintf(stderr, "Failed to open '%s': errno %d\n", name, errno); |
352 exit(1); | 347 exit(1); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 sink.WriteSpaceUsed( | 421 sink.WriteSpaceUsed( |
427 "", | 422 "", |
428 ser.CurrentAllocationAddress(i::NEW_SPACE), | 423 ser.CurrentAllocationAddress(i::NEW_SPACE), |
429 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), | 424 ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), |
430 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), | 425 ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), |
431 ser.CurrentAllocationAddress(i::CODE_SPACE), | 426 ser.CurrentAllocationAddress(i::CODE_SPACE), |
432 ser.CurrentAllocationAddress(i::MAP_SPACE), | 427 ser.CurrentAllocationAddress(i::MAP_SPACE), |
433 ser.CurrentAllocationAddress(i::CELL_SPACE)); | 428 ser.CurrentAllocationAddress(i::CELL_SPACE)); |
434 return 0; | 429 return 0; |
435 } | 430 } |
OLD | NEW |