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

Unified Diff: vm/object.cc

Issue 9630003: Use GrowableObjectArray in ic-data. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « 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 5109)
+++ vm/object.cc (working copy)
@@ -5654,16 +5654,17 @@
void Code::ExtractIcDataArraysAtCalls(
GrowableArray<intptr_t>* node_ids,
- GrowableArray<const ICData*>* ic_data_objs) const {
+ const GrowableObjectArray& ic_data_objs) const {
ASSERT(node_ids != NULL);
- ASSERT(ic_data_objs != NULL);
+ ASSERT(!ic_data_objs.IsNull());
const PcDescriptors& descriptors =
PcDescriptors::Handle(this->pc_descriptors());
+ ICData& ic_data_obj = ICData::Handle();
for (intptr_t i = 0; i < descriptors.Length(); i++) {
if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) {
node_ids->Add(descriptors.NodeId(i));
- ic_data_objs->Add(&ICData::ZoneHandle(
- CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i))));
+ ic_data_obj = CodePatcher::GetInstanceCallIcDataAt(descriptors.PC(i));
+ ic_data_objs.Add(ic_data_obj);
}
}
}
@@ -8729,10 +8730,13 @@
void ICData::GetOneClassCheckAt(
int index, Class* cls, Function* target) const {
+ ASSERT(cls != NULL);
+ ASSERT(target != NULL);
ASSERT(num_args_tested() == 1);
- GrowableArray<const Class*> classes;
- GetCheckAt(index, &classes, target);
- *cls = classes[0]->raw();
+ const Array& data = Array::Handle(ic_data());
+ intptr_t data_pos = index * TestEntryLength();
+ *cls ^= data.At(data_pos);
+ *target ^= data.At(data_pos + 1);
}
@@ -8758,7 +8762,7 @@
// Number of array elements in one test entry (num_args_tested + 1)
intptr_t len = result.TestEntryLength();
// IC data array must be null terminated (sentinel entry).
- Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
+ const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
result.set_ic_data(ic_data);
return result.raw();
}
« 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