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

Unified Diff: runtime/vm/object.h

Issue 2952193002: VM: Speed up output of UTF8 for 1-byte strings.
Patch Set: Fix asserts Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/unicode.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 9d5b4d9e2eaafd9542d20e3c6b44d3414870b892..1796f940f6e1184a653cd711b1e19cc0a7dba1fd 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -7244,7 +7244,7 @@ class OneByteString : public AllStatic {
}
static uint8_t* CharAddr(const String& str, intptr_t index) {
- ASSERT((index >= 0) && (index < str.Length()));
+ ASSERT(index == 0 || ((index >= 0) && (index < str.Length())));
ASSERT(str.IsOneByteString());
return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[index];
}
@@ -7261,6 +7261,7 @@ class OneByteString : public AllStatic {
friend class ExternalOneByteString;
friend class SnapshotReader;
friend class StringHasher;
+ friend class Utf8;
};
@@ -7430,7 +7431,7 @@ class ExternalOneByteString : public AllStatic {
}
static const uint8_t* CharAddr(const String& str, intptr_t index) {
- ASSERT((index >= 0) && (index < str.Length()));
+ ASSERT(index == 0 || ((index >= 0) && (index < str.Length())));
ASSERT(str.IsExternalOneByteString());
return &(raw_ptr(str)->external_data_->data()[index]);
}
@@ -7462,6 +7463,7 @@ class ExternalOneByteString : public AllStatic {
friend class String;
friend class SnapshotReader;
friend class Symbols;
+ friend class Utf8;
};
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/unicode.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698