diff options
author | Mingyao Yang <mingyao@google.com> | 2014-07-16 10:44:41 -0700 |
---|---|---|
committer | Mingyao Yang <mingyao@google.com> | 2014-07-22 15:03:50 -0700 |
commit | 2cdbad7c62f126581ec5177104de961c4d71adaa (patch) | |
tree | 6283b87bc9b65249decac9b0e38fe396782b8d7e /runtime/class_linker_test.cc | |
parent | c62944adcd427dca55489d234428da47c43a0aab (diff) | |
download | art-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/class_linker_test.cc')
-rw-r--r-- | runtime/class_linker_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 21fe006..8e16d9b 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -91,7 +91,7 @@ class ClassLinkerTest : public CommonRuntimeTest { EXPECT_EQ(0U, primitive->NumInstanceFields()); EXPECT_EQ(0U, primitive->NumStaticFields()); EXPECT_EQ(0U, primitive->NumDirectInterfaces()); - EXPECT_TRUE(primitive->GetVTable() == NULL); + EXPECT_FALSE(primitive->HasVTable()); EXPECT_EQ(0, primitive->GetIfTableCount()); EXPECT_TRUE(primitive->GetIfTable() == NULL); EXPECT_EQ(kAccPublic | kAccFinal | kAccAbstract, primitive->GetAccessFlags()); @@ -143,7 +143,7 @@ class ClassLinkerTest : public CommonRuntimeTest { EXPECT_EQ(0U, array->NumInstanceFields()); EXPECT_EQ(0U, array->NumStaticFields()); EXPECT_EQ(2U, array->NumDirectInterfaces()); - EXPECT_TRUE(array->GetVTable() != NULL); + EXPECT_TRUE(array->ShouldHaveEmbeddedImtAndVTable()); EXPECT_EQ(2, array->GetIfTableCount()); ASSERT_TRUE(array->GetIfTable() != NULL); mirror::Class* direct_interface0 = mirror::Class::GetDirectInterface(self, array, 0); @@ -216,7 +216,7 @@ class ClassLinkerTest : public CommonRuntimeTest { EXPECT_NE(0U, klass->NumDirectMethods()); } } - EXPECT_EQ(klass->IsInterface(), klass->GetVTable() == NULL); + EXPECT_EQ(klass->IsInterface(), !klass->HasVTable()); mirror::IfTable* iftable = klass->GetIfTable(); for (int i = 0; i < klass->GetIfTableCount(); i++) { mirror::Class* interface = iftable->GetInterface(i); |