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

Unified Diff: runtime/lib/string.cc

Issue 10874038: Make StringBase._substringUnchecked a native function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/lib/regexp_patch.dart ('k') | runtime/lib/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string.cc
===================================================================
--- runtime/lib/string.cc (revision 11257)
+++ runtime/lib/string.cc (working copy)
@@ -54,6 +54,21 @@
}
+DEFINE_NATIVE_ENTRY(StringBase_substringUnchecked, 3) {
+ GET_NATIVE_ARGUMENT(String, receiver, arguments->At(0));
+ GET_NATIVE_ARGUMENT(Smi, start_obj, arguments->At(1));
+ GET_NATIVE_ARGUMENT(Smi, end_obj, arguments->At(2));
+
+ intptr_t start = start_obj.Value();
+ intptr_t end = end_obj.Value();
+
+ const String& result = String::Handle(
+ String::SubString(receiver, start, (end - start)));
+ arguments->SetReturn(result);
+}
+
+
+
DEFINE_NATIVE_ENTRY(String_hashCode, 1) {
const String& receiver = String::CheckedHandle(arguments->At(0));
intptr_t hash_val = receiver.Hash();
« no previous file with comments | « runtime/lib/regexp_patch.dart ('k') | runtime/lib/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698