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

Unified Diff: vm/cha.cc

Issue 10873004: Use kInstanceCid instead of object_store()->object_class() when checking to see if the class is obj… (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 | « vm/cha.h ('k') | vm/cha_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/cha.cc
===================================================================
--- vm/cha.cc (revision 11121)
+++ vm/cha.cc (working copy)
@@ -13,10 +13,10 @@
namespace dart {
bool CHA::HasSubclasses(intptr_t cid) {
+ ASSERT(cid >= kInstanceCid);
const ClassTable& class_table = *Isolate::Current()->class_table();
const Class& cls = Class::Handle(class_table.At(cid));
ASSERT(!cls.IsNull());
- // TODO(regis): Add ASSERT(cid > kDartObjectCid).
if (cls.IsObjectClass()) {
// Class Object has subclasses, although we do not keep track of them.
return true;
@@ -60,11 +60,10 @@
ZoneGrowableArray<intptr_t>* CHA::GetSubclassIdsOf(intptr_t cid) {
+ ASSERT(cid > kInstanceCid);
const ClassTable& class_table = *Isolate::Current()->class_table();
const Class& cls = Class::Handle(class_table.At(cid));
ASSERT(!cls.IsNull());
- // TODO(regis): Replace assert below with ASSERT(cid > kDartObjectCid).
- ASSERT(!cls.IsObjectClass());
ZoneGrowableArray<intptr_t>* ids = new ZoneGrowableArray<intptr_t>();
CollectSubclassIds(ids, cls);
return ids;
@@ -81,9 +80,8 @@
Function& cls_function = Function::Handle();
for (intptr_t i = 0; i < cids.length(); i++) {
const intptr_t cid = cids[i];
+ ASSERT(cid > kInstanceCid);
cls = class_table.At(cid);
- // TODO(regis): Replace assert below with ASSERT(cid > kDartObjectCid).
- ASSERT(!cls.IsObjectClass());
cls_function = cls.LookupDynamicFunction(function_name);
if (!cls_function.IsNull()) {
functions->Add(&Function::ZoneHandle(cls_function.raw()));
« no previous file with comments | « vm/cha.h ('k') | vm/cha_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698