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

Unified Diff: runtime/vm/object.h

Issue 560113002: Narrow String::CharAt from int32_t to uint16_t. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
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 d7c24b4926e9b7bcff457311b1ba2a1d68bf71b1..f5bcabe12e472652f610120fad0438482f55b246 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -5524,7 +5524,7 @@ class String : public Instance {
virtual RawObject* HashCode() const { return Integer::New(Hash()); }
- int32_t CharAt(intptr_t index) const;
+ uint16_t CharAt(intptr_t index) const;
Scanner::CharAtFunc CharAtFunc() const;
@@ -5754,12 +5754,12 @@ class String : public Instance {
class OneByteString : public AllStatic {
public:
- static int32_t CharAt(const String& str, intptr_t index) {
+ static uint16_t CharAt(const String& str, intptr_t index) {
return *CharAddr(str, index);
}
- static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) {
- *CharAddr(str, index) = code_point;
+ static void SetCharAt(const String& str, intptr_t index, uint8_t code_unit) {
+ *CharAddr(str, index) = code_unit;
}
static RawOneByteString* EscapeSpecialCharacters(const String& str);
// We use the same maximum elements for all strings.
@@ -5883,7 +5883,7 @@ class OneByteString : public AllStatic {
class TwoByteString : public AllStatic {
public:
- static int32_t CharAt(const String& str, intptr_t index) {
+ static uint16_t CharAt(const String& str, intptr_t index) {
return *CharAddr(str, index);
}
@@ -5983,7 +5983,7 @@ class TwoByteString : public AllStatic {
class ExternalOneByteString : public AllStatic {
public:
- static int32_t CharAt(const String& str, intptr_t index) {
+ static uint16_t CharAt(const String& str, intptr_t index) {
return *CharAddr(str, index);
}
@@ -6060,7 +6060,7 @@ class ExternalOneByteString : public AllStatic {
class ExternalTwoByteString : public AllStatic {
public:
- static int32_t CharAt(const String& str, intptr_t index) {
+ static uint16_t CharAt(const String& str, intptr_t index) {
return *CharAddr(str, index);
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698