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

Unified Diff: runtime/lib/growable_array.cc

Issue 18292003: Inline native setters for length and data in the optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.cc
===================================================================
--- runtime/lib/growable_array.cc (revision 24793)
+++ runtime/lib/growable_array.cc (working copy)
@@ -76,11 +76,7 @@
const GrowableObjectArray& array =
GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1));
- if ((length.Value() < 0) || (length.Value() > array.Capacity())) {
- const Array& args = Array::Handle(Array::New(1));
- args.SetAt(0, length);
- Exceptions::ThrowByType(Exceptions::kRange, args);
- }
+ ASSERT((length.Value() >= 0) && (length.Value() <= array.Capacity()));
array.SetLength(length.Value());
return Object::null();
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698