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

Side by Side Diff: runtime/vm/snapshot.cc

Issue 516303006: Minor changes to avoid handle creation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 498
499 const char* version = reinterpret_cast<const char*>(CurrentBufferAddress()); 499 const char* version = reinterpret_cast<const char*>(CurrentBufferAddress());
500 ASSERT(version != NULL); 500 ASSERT(version != NULL);
501 if (strncmp(version, expected_version, version_len)) { 501 if (strncmp(version, expected_version, version_len)) {
502 const intptr_t kMessageBufferSize = 256; 502 const intptr_t kMessageBufferSize = 256;
503 char message_buffer[kMessageBufferSize]; 503 char message_buffer[kMessageBufferSize];
504 char* actual_version = OS::StrNDup(version, version_len); 504 char* actual_version = OS::StrNDup(version, version_len);
505 OS::SNPrint(message_buffer, 505 OS::SNPrint(message_buffer,
506 kMessageBufferSize, 506 kMessageBufferSize,
507 "Wrong full snapshot version, expected '%s' found '%s'", 507 "Wrong %s snapshot version, expected '%s' found '%s'",
508 (kind_ == Snapshot::kFull) ? "full" : "script",
508 Version::SnapshotString(), 509 Version::SnapshotString(),
509 actual_version); 510 actual_version);
510 free(actual_version); 511 free(actual_version);
511 const String& msg = String::Handle(String::New(message_buffer)); 512 const String& msg = String::Handle(String::New(message_buffer));
512 return ApiError::New(msg); 513 return ApiError::New(msg);
513 } 514 }
514 Advance(version_len); 515 Advance(version_len);
515 return ApiError::null(); 516 return ApiError::null();
516 } 517 }
517 518
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 NoGCScope no_gc; 1774 NoGCScope no_gc;
1774 WriteObject(obj.raw()); 1775 WriteObject(obj.raw());
1775 UnmarkAll(); 1776 UnmarkAll();
1776 } else { 1777 } else {
1777 ThrowException(exception_type(), exception_msg()); 1778 ThrowException(exception_type(), exception_msg());
1778 } 1779 }
1779 } 1780 }
1780 1781
1781 1782
1782 } // namespace dart 1783 } // namespace dart
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698