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

Unified Diff: runtime/lib/string_patch.dart

Issue 1961393002: VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comment Created 4 years, 7 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/aot_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index f7aa83c5522b3d31143e1f73e4e3ecb0225d9f29..435224516636f1bc51b04bcda0824ede8c8b8b2f 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -230,7 +230,7 @@ abstract class _StringBase {
String operator [](int index) native "String_charAt";
- int codeUnitAt(int index) native "String_codeUnitAt";
+ int codeUnitAt(int index); // Implemented in the subclasses.
int get length native "String_getLength";
@@ -937,6 +937,8 @@ class _OneByteString extends _StringBase implements String {
int get hashCode native "String_getHashCode";
+ int codeUnitAt(int index) native "String_codeUnitAt";
+
bool _isWhitespace(int codeUnit) {
return _StringBase._isOneByteWhitespace(codeUnit);
}
@@ -1240,6 +1242,8 @@ class _TwoByteString extends _StringBase implements String {
return _StringBase._isTwoByteWhitespace(codeUnit);
}
+ int codeUnitAt(int index) native "String_codeUnitAt";
+
bool operator ==(Object other) {
return super == other;
}
@@ -1256,6 +1260,8 @@ class _ExternalOneByteString extends _StringBase implements String {
return _StringBase._isOneByteWhitespace(codeUnit);
}
+ int codeUnitAt(int index) native "String_codeUnitAt";
+
bool operator ==(Object other) {
return super == other;
}
@@ -1274,6 +1280,8 @@ class _ExternalTwoByteString extends _StringBase implements String {
return _StringBase._isTwoByteWhitespace(codeUnit);
}
+ int codeUnitAt(int index) native "String_codeUnitAt";
+
bool operator ==(Object other) {
return super == other;
}
« no previous file with comments | « no previous file | runtime/vm/aot_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698