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

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

Issue 14820028: Delay Class parsing until the class is actually used. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 (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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 Class& cls = Class::ZoneHandle(isolate(), Class::null()); 202 Class& cls = Class::ZoneHandle(isolate(), Class::null());
203 cls = LookupInternalClass(class_header); 203 cls = LookupInternalClass(class_header);
204 AddBackRef(object_id, &cls, kIsDeserialized); 204 AddBackRef(object_id, &cls, kIsDeserialized);
205 if (cls.IsNull()) { 205 if (cls.IsNull()) {
206 // Read the library/class information and lookup the class. 206 // Read the library/class information and lookup the class.
207 str_ ^= ReadObjectImpl(class_header); 207 str_ ^= ReadObjectImpl(class_header);
208 library_ = Library::LookupLibrary(str_); 208 library_ = Library::LookupLibrary(str_);
209 ASSERT(!library_.IsNull()); 209 ASSERT(!library_.IsNull());
210 str_ ^= ReadObjectImpl(); 210 str_ ^= ReadObjectImpl();
211 cls = library_.LookupClass(str_); 211 cls = library_.LookupClass(str_);
212 cls.EnsureIsParsed(isolate());
hausner 2013/05/21 20:07:30 Does this mean you parse all classes that are in a
siva 2013/05/23 00:54:31 No this code is only used in isolate messages. Whe
212 } 213 }
213 ASSERT(!cls.IsNull()); 214 ASSERT(!cls.IsNull());
214 return cls.raw(); 215 return cls.raw();
215 } 216 }
216 217
217 218
218 RawObject* SnapshotReader::ReadObjectImpl() { 219 RawObject* SnapshotReader::ReadObjectImpl() {
219 int64_t value = Read<int64_t>(); 220 int64_t value = Read<int64_t>();
220 if ((value & kSmiTagMask) == kSmiTag) { 221 if ((value & kSmiTagMask) == kSmiTag) {
221 return NewInteger(value); 222 return NewInteger(value);
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 UnmarkAll(); 1463 UnmarkAll();
1463 isolate->set_long_jump_base(base); 1464 isolate->set_long_jump_base(base);
1464 } else { 1465 } else {
1465 isolate->set_long_jump_base(base); 1466 isolate->set_long_jump_base(base);
1466 ThrowException(exception_type(), exception_msg()); 1467 ThrowException(exception_type(), exception_msg());
1467 } 1468 }
1468 } 1469 }
1469 1470
1470 1471
1471 } // namespace dart 1472 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698