From 62d6c772205b8859f0ebf7ad105402ec4c3e2e01 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Wed, 27 Feb 2013 08:32:07 -0800 Subject: Interpreter entries and instrumentation as a listener. Make the instrumentation responsible for whether we want method entry/exit stubs, and allow it to use interpreter entry stubs when instruction by instruction instrumentation is required. Improve deoptimization so more JDWP test cases are passing. Refactor exception debug posting, in particular improve reporting in the interpreter. Improve class linker exception throwing so that broken dex files are more likely to be reported. Fixes the performance issue Bug: 8410519. Fix some error reporting lock level errors for the large object space. Make fast object verification faster. Add some debug mode robustness to finding dex PCs in GC maps. Add printf attributes to JniAbortF and fix errors. Expand run-test 044 to test return behaviors and fix issues with not throwing appropriate exceptions for proxies. Ensure causes are reported with a class linker NoClassDefFoundError and JNI NoSuchFieldError. Remove unused debugMe and updateDebuggerFromCode. There's a minor sizing tweak to the arg array builder, and an extra reference array check in the interpreter. Some clean-up of trace code. Fix reg type cache destructor if it is called after the reg type cache is shutdown (as is the case in oatdump). Change-Id: I6519c7b35df77f978d011999354c864f4918e8ce --- src/compiler/driver/compiler_driver.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/compiler/driver/compiler_driver.cc') diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc index 700936c881..4e8ebbd4ef 100644 --- a/src/compiler/driver/compiler_driver.cc +++ b/src/compiler/driver/compiler_driver.cc @@ -1202,9 +1202,8 @@ static void VerifyClass(const ParallelCompilationManager* manager, size_t class_ manager->GetClassLinker()->FindClass(descriptor, soa.Decode(manager->GetClassLoader())); if (klass == NULL) { - Thread* self = Thread::Current(); - CHECK(self->IsExceptionPending()); - self->ClearException(); + CHECK(soa.Self()->IsExceptionPending()); + soa.Self()->ClearException(); /* * At compile time, we can still structurally verify the class even if FindClass fails. @@ -1230,13 +1229,13 @@ static void VerifyClass(const ParallelCompilationManager* manager, size_t class_ if (klass->IsErroneous()) { // ClassLinker::VerifyClass throws, which isn't useful in the compiler. - CHECK(Thread::Current()->IsExceptionPending()); - Thread::Current()->ClearException(); + CHECK(soa.Self()->IsExceptionPending()); + soa.Self()->ClearException(); } CHECK(klass->IsCompileTimeVerified() || klass->IsErroneous()) << PrettyDescriptor(klass) << ": state=" << klass->GetStatus(); - CHECK(!Thread::Current()->IsExceptionPending()) << PrettyTypeOf(Thread::Current()->GetException()); + soa.Self()->AssertNoPendingException(); } void CompilerDriver::VerifyDexFile(jobject class_loader, const DexFile& dex_file, @@ -1435,7 +1434,6 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl mirror::ClassLoader* class_loader = soa.Decode(manager->GetClassLoader()); const char* descriptor = manager->GetDexFile()->GetClassDescriptor(class_def); mirror::Class* klass = manager->GetClassLinker()->FindClass(descriptor, class_loader); - Thread* self = Thread::Current(); bool compiling_boot = Runtime::Current()->GetHeap()->GetSpaces().size() == 1; bool can_init_static_fields = compiling_boot && manager->GetCompiler()->IsImageClass(descriptor); @@ -1447,9 +1445,9 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl // its parents, whose locks are acquired. This leads to a parent-to-child and a child-to-parent // lock ordering and consequent potential deadlock. static Mutex lock1("Initializer lock", kMonitorLock); - MutexLock mu(self, lock1); + MutexLock mu(soa.Self(), lock1); // The lock required to initialize the class. - ObjectLock lock2(self, klass); + ObjectLock lock2(soa.Self(), klass); // Only try to initialize classes that were successfully verified. if (klass->IsVerified()) { manager->GetClassLinker()->EnsureInitialized(klass, false, can_init_static_fields); @@ -1473,7 +1471,7 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl } else { manager->GetClassLinker()->EnsureInitialized(klass, true, can_init_static_fields); } - CHECK(!self->IsExceptionPending()) << self->GetException()->Dump(); + soa.Self()->AssertNoPendingException(); } } } @@ -1494,7 +1492,7 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl } } // Clear any class not found or verification exceptions. - self->ClearException(); + soa.Self()->ClearException(); } void CompilerDriver::InitializeClasses(jobject jni_class_loader, const DexFile& dex_file, @@ -1651,7 +1649,7 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t if (self->IsExceptionPending()) { ScopedObjectAccess soa(self); LOG(FATAL) << "Unexpected exception compiling: " << PrettyMethod(method_idx, dex_file) << "\n" - << self->GetException()->Dump(); + << self->GetException(NULL)->Dump(); } } -- cgit v1.2.3-59-g8ed1b