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

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

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « runtime/vm/resolver_test.cc ('k') | tests/language/library_ambiguous_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/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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 !IsSingletonClassId(GetVMIsolateObjectId(class_header))); 205 !IsSingletonClassId(GetVMIsolateObjectId(class_header)));
206 ASSERT((SerializedHeaderTag::decode(class_header) != kObjectId) || 206 ASSERT((SerializedHeaderTag::decode(class_header) != kObjectId) ||
207 !IsObjectStoreClassId(SerializedHeaderData::decode(class_header))); 207 !IsObjectStoreClassId(SerializedHeaderData::decode(class_header)));
208 Class& cls = Class::ZoneHandle(isolate(), Class::null()); 208 Class& cls = Class::ZoneHandle(isolate(), Class::null());
209 AddBackRef(object_id, &cls, kIsDeserialized); 209 AddBackRef(object_id, &cls, kIsDeserialized);
210 // Read the library/class information and lookup the class. 210 // Read the library/class information and lookup the class.
211 str_ ^= ReadObjectImpl(class_header); 211 str_ ^= ReadObjectImpl(class_header);
212 library_ = Library::LookupLibrary(str_); 212 library_ = Library::LookupLibrary(str_);
213 ASSERT(!library_.IsNull()); 213 ASSERT(!library_.IsNull());
214 str_ ^= ReadObjectImpl(); 214 str_ ^= ReadObjectImpl();
215 cls = library_.LookupClass(str_); 215 cls = library_.LookupClass(str_, NULL); // No ambiguity error expected.
216 cls.EnsureIsFinalized(isolate()); 216 cls.EnsureIsFinalized(isolate());
217 ASSERT(!cls.IsNull()); 217 ASSERT(!cls.IsNull());
218 return cls.raw(); 218 return cls.raw();
219 } 219 }
220 220
221 221
222 RawObject* SnapshotReader::ReadObjectImpl() { 222 RawObject* SnapshotReader::ReadObjectImpl() {
223 int64_t value = Read<int64_t>(); 223 int64_t value = Read<int64_t>();
224 if ((value & kSmiTagMask) == kSmiTag) { 224 if ((value & kSmiTagMask) == kSmiTag) {
225 return NewInteger(value); 225 return NewInteger(value);
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 UnmarkAll(); 1473 UnmarkAll();
1474 isolate->set_long_jump_base(base); 1474 isolate->set_long_jump_base(base);
1475 } else { 1475 } else {
1476 isolate->set_long_jump_base(base); 1476 isolate->set_long_jump_base(base);
1477 ThrowException(exception_type(), exception_msg()); 1477 ThrowException(exception_type(), exception_msg());
1478 } 1478 }
1479 } 1479 }
1480 1480
1481 1481
1482 } // namespace dart 1482 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/resolver_test.cc ('k') | tests/language/library_ambiguous_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698