Fix 64 bit build
Buggy compiler.
(cherry picked from commit 7989d22642415e1e4d608e210284834951bd0a39)
Change-Id: Id16c83fc7963ca89fd7fae32dd15ae342cc7f064
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 0af8bd2..3513a6f 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -4711,8 +4711,7 @@
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 @@
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 @@
// 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 beb7ee0..c55835d 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -127,6 +127,10 @@
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) {