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

Side by Side Diff: src/mksnapshot.cc

Issue 10443085: Report syntax errors in natives when building with mksnapshot. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 295 }
296 #ifdef COMPRESS_STARTUP_DATA_BZ2 296 #ifdef COMPRESS_STARTUP_DATA_BZ2
297 BZip2Decompressor natives_decompressor; 297 BZip2Decompressor natives_decompressor;
298 int bz2_result = natives_decompressor.Decompress(); 298 int bz2_result = natives_decompressor.Decompress();
299 if (bz2_result != BZ_OK) { 299 if (bz2_result != BZ_OK) {
300 fprintf(stderr, "bzip error code: %d\n", bz2_result); 300 fprintf(stderr, "bzip error code: %d\n", bz2_result);
301 exit(1); 301 exit(1);
302 } 302 }
303 #endif 303 #endif
304 i::Serializer::Enable(); 304 i::Serializer::Enable();
305 TryCatch try_catch(NULL);
305 Persistent<Context> context = v8::Context::New(); 306 Persistent<Context> context = v8::Context::New();
307 if (try_catch.HasCaught()) {
308 fprintf(stderr,
309 "\nException thrown while compiling natives - see above.\n\n");
310 exit(1);
311 }
306 ASSERT(!context.IsEmpty()); 312 ASSERT(!context.IsEmpty());
307 // Make sure all builtin scripts are cached. 313 // Make sure all builtin scripts are cached.
308 { HandleScope scope; 314 { HandleScope scope;
309 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { 315 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
310 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i); 316 i::Isolate::Current()->bootstrapper()->NativesSourceLookup(i);
311 } 317 }
312 } 318 }
313 // If we don't do this then we end up with a stray root pointing at the 319 // If we don't do this then we end up with a stray root pointing at the
314 // context even after we have disposed of the context. 320 // context even after we have disposed of the context.
315 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot"); 321 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags, "mksnapshot");
(...skipping 23 matching lines...) Expand all
339 sink.WriteSpaceUsed( 345 sink.WriteSpaceUsed(
340 partial_ser.CurrentAllocationAddress(i::NEW_SPACE), 346 partial_ser.CurrentAllocationAddress(i::NEW_SPACE),
341 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), 347 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE),
342 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), 348 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE),
343 partial_ser.CurrentAllocationAddress(i::CODE_SPACE), 349 partial_ser.CurrentAllocationAddress(i::CODE_SPACE),
344 partial_ser.CurrentAllocationAddress(i::MAP_SPACE), 350 partial_ser.CurrentAllocationAddress(i::MAP_SPACE),
345 partial_ser.CurrentAllocationAddress(i::CELL_SPACE), 351 partial_ser.CurrentAllocationAddress(i::CELL_SPACE),
346 partial_ser.CurrentAllocationAddress(i::LO_SPACE)); 352 partial_ser.CurrentAllocationAddress(i::LO_SPACE));
347 return 0; 353 return 0;
348 } 354 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698