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

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

Issue 745023002: - Properly canonicalize enum values. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « runtime/vm/class_finalizer.cc ('k') | tests/language/enum_const_test.dart » ('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 (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/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 offset += kWordSize; 974 offset += kWordSize;
975 } 975 }
976 if (kind_ == Snapshot::kFull) { 976 if (kind_ == Snapshot::kFull) {
977 // We create an uninitialized object in the case of full snapshots, so 977 // We create an uninitialized object in the case of full snapshots, so
978 // we need to initialize any remaining padding area with the Null object. 978 // we need to initialize any remaining padding area with the Null object.
979 while (offset < instance_size) { 979 while (offset < instance_size) {
980 result->SetFieldAtOffset(offset, Object::null_object()); 980 result->SetFieldAtOffset(offset, Object::null_object());
981 offset += kWordSize; 981 offset += kWordSize;
982 } 982 }
983 result->SetCreatedFromSnapshot(); 983 result->SetCreatedFromSnapshot();
984 } else if (result->IsCanonical()) { 984 } else if (RawObject::IsCanonical(tags)) {
985 *result = result->CheckAndCanonicalize(NULL); 985 *result = result->CheckAndCanonicalize(NULL);
986 ASSERT(!result->IsNull()); 986 ASSERT(!result->IsNull());
987 } 987 }
988 return result->raw(); 988 return result->raw();
989 } 989 }
990 ASSERT((class_header & kSmiTagMask) != kSmiTag); 990 ASSERT((class_header & kSmiTagMask) != kSmiTag);
991 intptr_t class_id = LookupInternalClass(class_header); 991 intptr_t class_id = LookupInternalClass(class_header);
992 switch (class_id) { 992 switch (class_id) {
993 #define SNAPSHOT_READ(clazz) \ 993 #define SNAPSHOT_READ(clazz) \
994 case clazz::kClassId: { \ 994 case clazz::kClassId: { \
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 NoGCScope no_gc; 1761 NoGCScope no_gc;
1762 WriteObject(obj.raw()); 1762 WriteObject(obj.raw());
1763 UnmarkAll(); 1763 UnmarkAll();
1764 } else { 1764 } else {
1765 ThrowException(exception_type(), exception_msg()); 1765 ThrowException(exception_type(), exception_msg());
1766 } 1766 }
1767 } 1767 }
1768 1768
1769 1769
1770 } // namespace dart 1770 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/enum_const_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698