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

Unified Diff: lib/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 | « no previous file | lib/byte_array.cc » ('j') | vm/bootstrap_natives.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/array.cc
===================================================================
--- lib/array.cc (revision 11528)
+++ lib/array.cc (working copy)
@@ -29,7 +29,7 @@
}
const Array& new_array = Array::Handle(Array::New(length.Value()));
new_array.SetTypeArguments(type_arguments);
- arguments->SetReturn(new_array);
+ return new_array.raw();
}
@@ -41,8 +41,7 @@
arguments.Add(&index);
Exceptions::ThrowByType(Exceptions::kIndexOutOfRange, arguments);
}
- const Instance& obj = Instance::CheckedHandle(array.At(index.Value()));
- arguments->SetReturn(obj);
+ return array.At(index.Value());
}
@@ -56,13 +55,13 @@
Exceptions::ThrowByType(Exceptions::kIndexOutOfRange, arguments);
}
array.SetAt(index.Value(), value);
+ return Object::null();
}
DEFINE_NATIVE_ENTRY(ObjectArray_getLength, 1) {
const Array& array = Array::CheckedHandle(arguments->At(0));
- const Smi& length = Smi::Handle(Smi::New(array.Length()));
- arguments->SetReturn(length);
+ return Smi::New(array.Length());
}
@@ -79,7 +78,7 @@
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
}
if (icount == 0) {
- return;
+ return Object::null();
}
intptr_t isrc_start = src_start.Value();
intptr_t idst_start = dst_start.Value();
@@ -106,6 +105,7 @@
dest.SetAt(idst_start + i, src_obj);
}
}
+ return Object::null();
}
} // namespace dart
« no previous file with comments | « no previous file | lib/byte_array.cc » ('j') | vm/bootstrap_natives.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698