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

Unified Diff: src/objects-inl.h

Issue 11231: Flat string reader (Closed)
Patch Set: Created 12 years, 1 month 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
« src/objects.cc ('K') | « src/objects.cc ('k') | src/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 21308d49006106a2640f6895adffb4c7802402cb..d3de7f22993997202c1d25c765246dc2ead63f9a 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -279,6 +279,16 @@ bool StringShape::IsExternalTwoByte() {
}
+uc32 FlatStringReader::Get(int index) {
+ ASSERT(0 <= index && index <= length_);
+ if (is_ascii_) {
+ return static_cast<const byte*>(start_)[index];
+ } else {
+ return static_cast<const uc16*>(start_)[index];
+ }
+}
+
+
bool Object::IsNumber() {
return IsSmi() || IsHeapNumber();
}
« src/objects.cc ('K') | « src/objects.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698