summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-05-15 12:39:19 -0700
committer Mathieu Chartier <mathieuc@google.com> 2014-05-22 10:47:44 -0700
commite09ae0920be57760fb390b6944bce420fa0b5582 (patch)
treeacc40266093df4289ffb6728c979cafd6b5114d2 /runtime/class_linker_test.cc
parentb8033db2a8dc6f7c7e29b1552177542964f56e44 (diff)
Fix an outstanding compaction bug in interpreter.
Fixed a bug in DoFieldPut where the FieldHelper GetType could cause thread suspension which would result in a stale obj. Added more handles in the class linker to facilitate moving fiels and methods in the future. Removed un-necessarly passing handle references since these are value types and don't need to be passed by reference. Added a special NullHandle type which allows null handles without a handle scope. Change-Id: I1b51723920a2e4f4f8b2907066f578a3e879fd5b
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index d04f02ba3a..c11aeccee4 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -108,7 +108,7 @@ class ClassLinkerTest : public CommonRuntimeTest {
AssertArrayClass(array_descriptor, array);
}
- void AssertArrayClass(const std::string& array_descriptor, const Handle<mirror::Class>& array)
+ void AssertArrayClass(const std::string& array_descriptor, Handle<mirror::Class> array)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
ASSERT_TRUE(array.Get() != NULL);
ASSERT_TRUE(array->GetClass() != NULL);
@@ -178,7 +178,7 @@ class ClassLinkerTest : public CommonRuntimeTest {
EXPECT_TRUE(fh.GetType() != NULL);
}
- void AssertClass(const std::string& descriptor, const Handle<mirror::Class>& klass)
+ void AssertClass(const std::string& descriptor, Handle<mirror::Class> klass)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
EXPECT_STREQ(descriptor.c_str(), klass->GetDescriptor().c_str());
if (descriptor == "Ljava/lang/Object;") {
@@ -846,8 +846,7 @@ TEST_F(ClassLinkerTest, ValidateBoxedTypes) {
// Validate that the "value" field is always the 0th field in each of java.lang's box classes.
// This lets UnboxPrimitive avoid searching for the field by name at runtime.
ScopedObjectAccess soa(Thread::Current());
- StackHandleScope<1> hs(soa.Self());
- auto class_loader(hs.NewHandle<mirror::ClassLoader>(nullptr));
+ NullHandle<mirror::ClassLoader> class_loader;
mirror::Class* c;
c = class_linker_->FindClass(soa.Self(), "Ljava/lang/Boolean;", class_loader);
FieldHelper fh(c->GetIFields()->Get(0));