diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-10-27 17:30:20 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-10-27 17:50:08 -0700 |
commit | d035c2d0523f29cb3c4fcc14a80d2a8ceadec3ba (patch) | |
tree | 114f11c3c89d915bfd7b7d1cede4704cfacff6d1 | |
parent | 2d2621a1463d2f3f03fa73503fa42e43657cdcfc (diff) | |
download | android_art-d035c2d0523f29cb3c4fcc14a80d2a8ceadec3ba.tar.gz android_art-d035c2d0523f29cb3c4fcc14a80d2a8ceadec3ba.tar.bz2 android_art-d035c2d0523f29cb3c4fcc14a80d2a8ceadec3ba.zip |
Fix 64 bit build
Buggy compiler.
(cherry picked from commit 7989d22642415e1e4d608e210284834951bd0a39)
Change-Id: Id16c83fc7963ca89fd7fae32dd15ae342cc7f064
-rw-r--r-- | runtime/class_linker.cc | 15 | ||||
-rw-r--r-- | runtime/handle_scope.h | 4 |
2 files changed, 7 insertions, 12 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 0af8bd2129..3513a6f7d0 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4711,8 +4711,7 @@ bool ClassLinker::LinkVirtualMethods(Thread* self, Handle<mirror::Class> klass) bool ClassLinker::LinkInterfaceMethods(Thread* self, Handle<mirror::Class> klass, Handle<mirror::ObjectArray<mirror::Class>> interfaces, StackHandleScope<mirror::Class::kImtSize>* out_imt) { - static constexpr size_t kInterfaceCacheSize = 8; - StackHandleScope<3 + kInterfaceCacheSize> hs(self); + StackHandleScope<3> hs(self); Runtime* const runtime = Runtime::Current(); const bool has_superclass = klass->HasSuperClass(); const size_t super_ifcount = has_superclass ? klass->GetSuperClass()->GetIfTableCount() : 0U; @@ -4746,9 +4745,6 @@ bool ClassLinker::LinkInterfaceMethods(Thread* self, Handle<mirror::Class> klass mirror::Class* interface = have_interfaces ? interfaces->GetWithoutChecks(i) : mirror::Class::GetDirectInterface(self, klass, i); DCHECK(interface != nullptr); - if (i < kInterfaceCacheSize) { - hs.NewHandle(interface); - } if (UNLIKELY(!interface->IsInterface())) { std::string temp; ThrowIncompatibleClassChangeError(klass.Get(), "Class %s implements non-interface class %s", @@ -4774,13 +4770,8 @@ bool ClassLinker::LinkInterfaceMethods(Thread* self, Handle<mirror::Class> klass // Flatten the interface inheritance hierarchy. size_t idx = super_ifcount; for (size_t i = 0; i < num_interfaces; i++) { - mirror::Class* interface; - if (i < kInterfaceCacheSize) { - interface = hs.GetReference(i)->AsClass(); - } else { - interface = have_interfaces ? interfaces->Get(i) : - mirror::Class::GetDirectInterface(self, klass, i); - } + mirror::Class* interface = have_interfaces ? interfaces->Get(i) : + mirror::Class::GetDirectInterface(self, klass, i); // Check if interface is already in iftable bool duplicate = false; for (size_t j = 0; j < idx; j++) { diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h index beb7ee08b8..c55835dd00 100644 --- a/runtime/handle_scope.h +++ b/runtime/handle_scope.h @@ -127,6 +127,10 @@ class PACKED(4) HandleScope { return reinterpret_cast<StackReference<mirror::Object>*>(address); } + explicit HandleScope(size_t number_of_references) : + link_(nullptr), number_of_references_(number_of_references) { + } + // Semi-hidden constructor. Construction expected by generated code and StackHandleScope. explicit HandleScope(HandleScope* link, uint32_t num_references) : link_(link), number_of_references_(num_references) { |