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

Unified Diff: runtime/vm/object.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
« no previous file with comments | « no previous file | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5030d55456a6ffea0d399cc7d3d0f8cab23a3fc3..b9489f697baaa93e6b7eec6a93325ef97de15509 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -17169,10 +17169,15 @@ void StringHasher::Add(const String& str, intptr_t begin_index, intptr_t len) {
ASSERT(begin_index >= 0);
ASSERT(len >= 0);
ASSERT((begin_index + len) <= str.Length());
+ if (len == 0) {
+ return;
+ }
if (str.IsOneByteString()) {
+ NoGCScope no_gc;
+ uint8_t* str_addr = OneByteString::CharAddr(str, begin_index);
for (intptr_t i = 0; i < len; i++) {
- NoGCScope no_gc;
- Add(*OneByteString::CharAddr(str, i + begin_index));
+ Add(*str_addr);
+ str_addr++;
}
} else {
String::CodePointIterator it(str, begin_index, len);
« no previous file with comments | « no previous file | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698