summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-10-28 00:50:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-10-28 00:50:45 +0000
commit79027f6204f77db4ba3bd3ceab1f07240fbbfdb3 (patch)
tree611eecf5e1bc87ac72b10ae394bd49570587a710
parente74b720d752469d3883f3589de863e8fc82c6338 (diff)
parentd035c2d0523f29cb3c4fcc14a80d2a8ceadec3ba (diff)
downloadart-79027f6204f77db4ba3bd3ceab1f07240fbbfdb3.zip
art-79027f6204f77db4ba3bd3ceab1f07240fbbfdb3.tar.gz
art-79027f6204f77db4ba3bd3ceab1f07240fbbfdb3.tar.bz2
Merge "Fix 64 bit build"
-rw-r--r--runtime/class_linker.cc15
-rw-r--r--runtime/handle_scope.h4
2 files changed, 7 insertions, 12 deletions
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::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 beb7ee0..c55835d 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) {