diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 634d3bc9c0..b17df4e443 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -671,7 +671,7 @@ void CompilerDriver::LoadImageClasses(base::TimingLogger& timings) if (klass.get() == NULL) { image_classes_->erase(it++); VLOG(compiler) << "Failed to find class " << descriptor; - Thread::Current()->ClearException(); + self->ClearException(); } else { ++it; } @@ -1472,7 +1472,7 @@ static void ResolveClassFieldsAndMethods(const ParallelCompilationManager* manag // Class couldn't be resolved, for example, super-class is in a different dex file. Don't // attempt to resolve methods and fields when there is no declaring class. CHECK(soa.Self()->IsExceptionPending()); - Thread::Current()->ClearException(); + soa.Self()->ClearException(); resolve_fields_and_methods = false; } else { resolve_fields_and_methods = manager->GetCompiler()->IsImage(); @@ -1547,7 +1547,14 @@ static void ResolveType(const ParallelCompilationManager* manager, size_t type_i if (klass == NULL) { CHECK(soa.Self()->IsExceptionPending()); - Thread::Current()->ClearException(); + mirror::Throwable* exception = soa.Self()->GetException(NULL); + VLOG(compiler) << "Exception during type resolution: " << exception->Dump(); + if (strcmp(ClassHelper(exception->GetClass()).GetDescriptor(), + "Ljava/lang/OutOfMemoryError;") == 0) { + // There's little point continuing compilation if the heap is exhausted. + LOG(FATAL) << "Out of memory during type resolution for compilation"; + } + soa.Self()->ClearException(); } } @@ -1700,12 +1707,13 @@ static const char* class_initializer_black_list[] = { "Landroid/net/NetworkInfo;", // Calls java.util.EnumMap.<init> -> java.lang.Enum.getSharedConstants -> System.identityHashCode. "Landroid/net/Proxy;", // Calls regex.Pattern.compile -..-> regex.Pattern.compileImpl. "Landroid/net/SSLCertificateSocketFactory;", // Requires javax.net.ssl.HttpsURLConnection. - "Landroid/net/Uri;", // Calls Class.getSimpleName -> Class.isAnonymousClass -> Class.getDex. "Landroid/net/Uri$AbstractHierarchicalUri;", // Requires Uri. "Landroid/net/Uri$HierarchicalUri;", // Requires Uri. "Landroid/net/Uri$OpaqueUri;", // Requires Uri. "Landroid/net/Uri$StringUri;", // Requires Uri. + "Landroid/net/Uri;", // Calls Class.getSimpleName -> Class.isAnonymousClass -> Class.getDex. "Landroid/net/WebAddress;", // Calls regex.Pattern.compile -..-> regex.Pattern.compileImpl. + "Landroid/net/wifi/WifiNative;", // Calls new LocalLog -> new Time -> TimeZone -> Pattern.compile. "Landroid/nfc/NdefRecord;", // Calls String.getBytes -> java.nio.charset.Charset. "Landroid/opengl/EGL14;", // Calls android.opengl.EGL14._nativeClassInit. "Landroid/opengl/GLES10;", // Calls android.opengl.GLES10._nativeClassInit. |