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

Unified Diff: runtime/vm/object.cc

Issue 13070003: Do not use object pool for VM heap objects on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 20482)
+++ runtime/vm/object.cc (working copy)
@@ -7702,13 +7702,6 @@
// Allocate the code object.
Code& code = Code::ZoneHandle(Code::New(pointer_offsets.length()));
-
- // Clone the object pool in the old space, if necessary.
- Array& object_pool = Array::Handle(
- Array::MakeArray(assembler->object_pool()));
- if (!object_pool.IsOld()) {
- object_pool ^= Object::Clone(object_pool, Heap::kOld);
- }
{
NoGCScope no_gc;
@@ -7727,7 +7720,15 @@
code.set_instructions(instrs.raw());
// Set object pool in Instructions object.
- instrs.set_object_pool(object_pool.raw());
+ const GrowableObjectArray& object_pool = assembler->object_pool();
+ if (object_pool.IsNull()) {
+ instrs.set_object_pool(Object::empty_array().raw());
+ } else {
+ // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here
+ // with Heap::kOld and change the ARM and MIPS assemblers to work with a
+ // GrowableObjectArray in new space.
+ instrs.set_object_pool(Array::MakeArray(object_pool));
+ }
}
return code.raw();
}
@@ -12226,10 +12227,11 @@
RawArray* Array::MakeArray(const GrowableObjectArray& growable_array) {
- if (growable_array.IsNull()) {
- return Array::null();
+ ASSERT(!growable_array.IsNull());
+ intptr_t used_len = growable_array.Length();
+ if (used_len == 0) {
+ return Object::empty_array().raw();
}
- intptr_t used_len = growable_array.Length();
intptr_t capacity_len = growable_array.Capacity();
Isolate* isolate = Isolate::Current();
const Array& array = Array::Handle(isolate, growable_array.data());
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698