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

Unified Diff: runtime/vm/class_table.cc

Issue 10540045: - Get handle vtable from a static table for predefined classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/object.h » ('j') | runtime/vm/object.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.cc
===================================================================
--- runtime/vm/class_table.cc (revision 8348)
+++ runtime/vm/class_table.cc (working copy)
@@ -47,6 +47,14 @@
ASSERT(table_[index] == 0);
ASSERT(index < capacity_);
table_[index] = cls.raw();
+ // Add the vtable for this predefined class into the static vtable registry
+ // if it has not been setup yet.
+ cpp_vtable cls_vtable = cls.handle_vtable();
+ cpp_vtable table_entry = Object::builtin_vtables_[index];
+ ASSERT((table_entry == 0) || (table_entry == cls_vtable));
+ if (table_entry == 0) {
+ Object::builtin_vtables_[index] = cls_vtable;
+ }
} else {
if (top_ == capacity_) {
// Grow the capacity of the class table.
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698