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

Unified Diff: runtime/lib/string.cc

Issue 11293290: Fix native argument handling (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/lib/regexp.cc ('k') | runtime/lib/weak_property.cc » ('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 14922)
+++ runtime/lib/string.cc (working copy)
@@ -12,7 +12,7 @@
namespace dart {
DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) {
- GET_NATIVE_ARGUMENT(Array, a, arguments->At(0));
+ GET_NATIVE_ARGUMENT(Array, a, arguments->NativeArgAt(0));
// TODO(srdjan): Check that parameterized type is an int.
Zone* zone = isolate->current_zone();
intptr_t array_len = a.Length();
@@ -51,9 +51,9 @@
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));
+ GET_NATIVE_ARGUMENT(String, receiver, arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Smi, start_obj, arguments->NativeArgAt(1));
+ GET_NATIVE_ARGUMENT(Smi, end_obj, arguments->NativeArgAt(2));
intptr_t start = start_obj.Value();
intptr_t end = end_obj.Value();
@@ -62,7 +62,7 @@
DEFINE_NATIVE_ENTRY(String_getHashCode, 1) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
intptr_t hash_val = receiver.Hash();
ASSERT(hash_val > 0);
ASSERT(Smi::IsValid(hash_val));
@@ -71,7 +71,7 @@
DEFINE_NATIVE_ENTRY(String_getLength, 1) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
return Smi::New(receiver.Length());
}
@@ -98,16 +98,17 @@
DEFINE_NATIVE_ENTRY(String_charAt, 2) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Integer, index, arguments->At(1));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
uint32_t value = StringValueAt(receiver, index);
ASSERT(value <= 0x10FFFF);
return Symbols::New(&value, 1);
}
DEFINE_NATIVE_ENTRY(String_charCodeAt, 2) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Integer, index, arguments->At(1));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
+
int32_t value = StringValueAt(receiver, index);
ASSERT(value >= 0);
ASSERT(value <= 0x10FFFF);
@@ -116,28 +117,28 @@
DEFINE_NATIVE_ENTRY(String_concat, 2) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(String, b, arguments->At(1));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(String, b, arguments->NativeArgAt(1));
return String::Concat(receiver, b);
}
DEFINE_NATIVE_ENTRY(String_toLowerCase, 1) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!receiver.IsNull());
return String::ToLowerCase(receiver);
}
DEFINE_NATIVE_ENTRY(String_toUpperCase, 1) {
- const String& receiver = String::CheckedHandle(arguments->At(0));
+ const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!receiver.IsNull());
return String::ToUpperCase(receiver);
}
DEFINE_NATIVE_ENTRY(Strings_concatAll, 1) {
- GET_NATIVE_ARGUMENT(Array, strings, arguments->At(0));
+ GET_NATIVE_ARGUMENT(Array, strings, arguments->NativeArgAt(0));
ASSERT(!strings.IsNull());
// Check that the array contains strings.
Instance& elem = Instance::Handle();
« no previous file with comments | « runtime/lib/regexp.cc ('k') | runtime/lib/weak_property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698