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

Unified Diff: vm/object.cc

Issue 11443024: Restructure Add and SetAt to not create a Handle. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | « vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 15744)
+++ vm/object.cc (working copy)
@@ -11171,33 +11171,25 @@
void GrowableObjectArray::Add(const Object& value, Heap::Space space) const {
- Add(Isolate::Current(), value, space);
-}
-
-
-void GrowableObjectArray::Add(Isolate* isolate,
- const Object& value,
- Heap::Space space) const {
ASSERT(!IsNull());
- Array& contents = Array::Handle(isolate, data());
if (Length() == Capacity()) {
// TODO(Issue 2500): Need a better growth strategy.
intptr_t new_capacity = (Capacity() == 0) ? 4 : Capacity() * 2;
if (new_capacity <= Capacity()) {
// Use the preallocated out of memory exception to avoid calling
// into dart code or allocating any code.
+ Isolate* isolate = Isolate::Current();
const Instance& exception =
Instance::Handle(isolate->object_store()->out_of_memory());
Exceptions::Throw(exception);
UNREACHABLE();
}
Grow(new_capacity, space);
- contents = data();
}
ASSERT(Length() < Capacity());
intptr_t index = Length();
SetLength(index + 1);
- contents.SetAt(index, value);
+ SetAt(index, value);
}
« no previous file with comments | « vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698