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

Unified Diff: runtime/lib/growable_array.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/error.cc ('k') | runtime/lib/integers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.cc
===================================================================
--- runtime/lib/growable_array.cc (revision 14922)
+++ runtime/lib/growable_array.cc (working copy)
@@ -14,10 +14,10 @@
DEFINE_NATIVE_ENTRY(GrowableObjectArray_allocate, 2) {
const AbstractTypeArguments& type_arguments =
- AbstractTypeArguments::CheckedHandle(arguments->At(0));
+ AbstractTypeArguments::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(type_arguments.IsNull() ||
(type_arguments.IsInstantiated() && (type_arguments.Length() == 1)));
- GET_NATIVE_ARGUMENT(Array, data, arguments->At(1));
+ GET_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1));
if ((data.Length() <= 0)) {
const Integer& index = Integer::Handle(Integer::New(data.Length()));
GrowableArray<const Object*> args;
@@ -33,8 +33,8 @@
DEFINE_NATIVE_ENTRY(GrowableObjectArray_getIndexed, 2) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Smi, index, arguments->At(1));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
if ((index.Value() < 0) || (index.Value() >= array.Length())) {
GrowableArray<const Object*> args;
args.Add(&index);
@@ -47,14 +47,14 @@
DEFINE_NATIVE_ENTRY(GrowableObjectArray_setIndexed, 3) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Smi, index, arguments->At(1));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
if ((index.Value() < 0) || (index.Value() >= array.Length())) {
GrowableArray<const Object*> args;
args.Add(&index);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
- GET_NATIVE_ARGUMENT(Instance, value, arguments->At(2));
+ GET_NATIVE_ARGUMENT(Instance, value, arguments->NativeArgAt(2));
array.SetAt(index.Value(), value);
return Object::null();
}
@@ -62,22 +62,22 @@
DEFINE_NATIVE_ENTRY(GrowableObjectArray_getLength, 1) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
return Smi::New(array.Length());
}
DEFINE_NATIVE_ENTRY(GrowableObjectArray_getCapacity, 1) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
return Smi::New(array.Capacity());
}
DEFINE_NATIVE_ENTRY(GrowableObjectArray_setLength, 2) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Smi, length, arguments->At(1));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1));
if ((length.Value() < 0) || (length.Value() > array.Capacity())) {
GrowableArray<const Object*> args;
args.Add(&length);
@@ -90,8 +90,8 @@
DEFINE_NATIVE_ENTRY(GrowableObjectArray_setData, 2) {
const GrowableObjectArray& array =
- GrowableObjectArray::CheckedHandle(arguments->At(0));
- GET_NATIVE_ARGUMENT(Array, data, arguments->At(1));
+ GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1));
ASSERT(data.Length() > 0);
array.SetData(data);
return Object::null();
« no previous file with comments | « runtime/lib/error.cc ('k') | runtime/lib/integers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698