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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 884793002: Reduce isolate startup time in debug mode by 20 millis (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/raw_object.h ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 3bf9794f2cbaf7448335d2e7a7dc5f99cfb2b182..cb7cc35134b9a1e19b6e15e540a7552a2f6bf326 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -1903,9 +1903,14 @@ void String::ReadFromImpl(SnapshotReader* reader,
*str_obj = StringType::New(len, HEAP_SPACE(kind));
str_obj->set_tags(tags);
str_obj->SetHash(0); // Will get computed when needed.
+ if (len == 0) {
+ return;
+ }
NoGCScope no_gc;
+ CharacterType* str_addr = StringType::CharAddr(*str_obj, 0);
for (intptr_t i = 0; i < len; i++) {
- *StringType::CharAddr(*str_obj, i) = reader->Read<CharacterType>();
+ *str_addr = reader->Read<CharacterType>();
+ str_addr++;
}
}
}
« runtime/vm/raw_object.h ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698