summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/class.cc
diff options
context:
space:
mode:
authorMingyao Yang <mingyao@google.com>2014-07-16 10:44:41 -0700
committerMingyao Yang <mingyao@google.com>2014-07-22 15:03:50 -0700
commit2cdbad7c62f126581ec5177104de961c4d71adaa (patch)
tree6283b87bc9b65249decac9b0e38fe396782b8d7e /runtime/mirror/class.cc
parentc62944adcd427dca55489d234428da47c43a0aab (diff)
downloadart-2cdbad7c62f126581ec5177104de961c4d71adaa.zip
art-2cdbad7c62f126581ec5177104de961c4d71adaa.tar.gz
art-2cdbad7c62f126581ec5177104de961c4d71adaa.tar.bz2
Set vtable in class object to null after linking.
This is follow-up work of embedding imt and vtable for faster interface/virtual call dispatching. Once vtable becomes embedded, the original vtable is nulled. Change-Id: I307696657d1e283654169dbecb8f7815c42bbabc
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r--runtime/mirror/class.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 189c537..a218b1c 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -827,10 +827,18 @@ void Class::PopulateEmbeddedImtAndVTable() SHARED_LOCKS_REQUIRED(Locks::mutator_
}
table = GetVTableDuringLinking();
- CHECK(table != nullptr);
+ CHECK(table != nullptr) << PrettyClass(this);
+ SetEmbeddedVTableLength(table->GetLength());
for (int32_t i = 0; i < table->GetLength(); i++) {
SetEmbeddedVTableEntry(i, table->Get(i));
}
+
+ SetImTable(nullptr);
+ // Keep java.lang.Object class's vtable around for since it's easier
+ // to be reused by array classes during their linking.
+ if (!IsObjectClass()) {
+ SetVTable(nullptr);
+ }
}
// The pre-fence visitor for Class::CopyOf().