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

Unified Diff: lib/growable_array.cc

Issue 10874072: Use the return value of vm native methods to set the return value, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 | « lib/error.cc ('k') | lib/integers.cc » ('j') | vm/bootstrap_natives.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/growable_array.cc
===================================================================
--- lib/growable_array.cc (revision 11528)
+++ lib/growable_array.cc (working copy)
@@ -27,7 +27,7 @@
const GrowableObjectArray& new_array =
GrowableObjectArray::Handle(GrowableObjectArray::New(data));
new_array.SetTypeArguments(type_arguments);
- arguments->SetReturn(new_array);
+ return new_array.raw();
}
@@ -41,7 +41,7 @@
Exceptions::ThrowByType(Exceptions::kIndexOutOfRange, args);
}
const Instance& obj = Instance::CheckedHandle(array.At(index.Value()));
- arguments->SetReturn(obj);
+ return obj.raw();
}
@@ -56,22 +56,21 @@
}
GET_NATIVE_ARGUMENT(Instance, value, arguments->At(2));
array.SetAt(index.Value(), value);
+ return Object::null();
}
DEFINE_NATIVE_ENTRY(GrowableObjectArray_getLength, 1) {
const GrowableObjectArray& array =
GrowableObjectArray::CheckedHandle(arguments->At(0));
- const Smi& length = Smi::Handle(isolate, Smi::New(array.Length()));
- arguments->SetReturn(length);
+ return Smi::New(array.Length());
}
DEFINE_NATIVE_ENTRY(GrowableObjectArray_getCapacity, 1) {
const GrowableObjectArray& array =
GrowableObjectArray::CheckedHandle(arguments->At(0));
- const Smi& capacity = Smi::Handle(isolate, Smi::New(array.Capacity()));
- arguments->SetReturn(capacity);
+ return Smi::New(array.Capacity());
}
@@ -85,6 +84,7 @@
Exceptions::ThrowByType(Exceptions::kIndexOutOfRange, args);
}
array.SetLength(length.Value());
+ return Object::null();
}
@@ -94,6 +94,7 @@
GET_NATIVE_ARGUMENT(Array, data, arguments->At(1));
ASSERT(data.Length() > 0);
array.SetData(data);
+ return Object::null();
}
} // namespace dart
« no previous file with comments | « lib/error.cc ('k') | lib/integers.cc » ('j') | vm/bootstrap_natives.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698