diff --git a/src/main/java/com/android/tools/r8/logging/Log.java b/src/main/java/com/android/tools/r8/logging/Log.java index 6cb91b474..3f1d164e7 100644 --- a/src/main/java/com/android/tools/r8/logging/Log.java +++ b/src/main/java/com/android/tools/r8/logging/Log.java @@ -5,7 +5,7 @@ package com.android.tools.r8.logging; public class Log { - static public final boolean ENABLED = false; + static public final boolean ENABLED = true; static private final boolean VERBOSE_ENABLED = false; static private final boolean INFO_ENABLED = true; diff --git a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java index 0761a713c..dbc9da2d7 100644 --- a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java +++ b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java @@ -436,7 +436,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register invokeVirtual `%s`.", method); + Log.debug(getClass(), "Register invokeVirtual `%s`.", method); } workList.add(Action.markReachableVirtual(method, keepReason)); return true; @@ -452,7 +452,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register invokeDirect `%s`.", method); + Log.debug(getClass(), "Register invokeDirect `%s`.", method); } handleInvokeOfDirectTarget(method, keepReason); return true; @@ -479,7 +479,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register invokeStatic `%s`.", method); + Log.debug(getClass(), "Register invokeStatic `%s`.", method); } handleInvokeOfStaticTarget(method, keepReason); return true; @@ -495,7 +495,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register invokeInterface `%s`.", method); + Log.debug(getClass(), "Register invokeInterface `%s`.", method); } workList.add(Action.markReachableInterface(method, keepReason)); return true; @@ -510,7 +510,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register invokeSuper `%s`.", actualTarget); + Log.debug(getClass(), "Register invokeSuper `%s`.", actualTarget); } workList.add(Action.markReachableSuper(method, currentMethod)); return true; @@ -522,7 +522,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register Iput `%s`.", field); + Log.debug(getClass(), "Register Iput `%s`.", field); } // TODO(herhut): We have to add this, but DCR should eliminate dead writes. workList.add(Action.markReachableField(field, KeepReason.fieldReferencedIn(currentMethod))); @@ -535,7 +535,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register Iget `%s`.", field); + Log.debug(getClass(), "Register Iget `%s`.", field); } workList.add(Action.markReachableField(field, KeepReason.fieldReferencedIn(currentMethod))); return true; @@ -557,7 +557,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register Sget `%s`.", field); + Log.debug(getClass(), "Register Sget `%s`.", field); } markStaticFieldAsLive(field, KeepReason.fieldReferencedIn(currentMethod)); return true; @@ -569,7 +569,7 @@ public class Enqueuer { return false; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register Sput `%s`.", field); + Log.debug(getClass(), "Register Sput `%s`.", field); } // TODO(herhut): We have to add this, but DCR should eliminate dead writes. markStaticFieldAsLive(field, KeepReason.fieldReferencedIn(currentMethod)); @@ -766,7 +766,7 @@ public class Enqueuer { } if (liveTypes.add(type)) { if (Log.ENABLED) { - Log.verbose(getClass(), "Type `%s` has become live.", type); + Log.debug(getClass(), "Type `%s` has become live.", type); } DexClass holder = appInfo.definitionFor(type); if (holder == null) { @@ -917,19 +917,19 @@ public class Enqueuer { private void reportMissingClass(DexType clazz) { if (Log.ENABLED && reportedMissing.add(clazz)) { - Log.verbose(Enqueuer.class, "Class `%s` is missing.", clazz); + Log.debug(Enqueuer.class, "Class `%s` is missing.", clazz); } } private void reportMissingMethod(DexMethod method) { if (Log.ENABLED && reportedMissing.add(method)) { - Log.verbose(Enqueuer.class, "Method `%s` is missing.", method); + Log.debug(Enqueuer.class, "Method `%s` is missing.", method); } } private void reportMissingField(DexField field) { if (Log.ENABLED && reportedMissing.add(field)) { - Log.verbose(Enqueuer.class, "Field `%s` is missing.", field); + Log.debug(Enqueuer.class, "Field `%s` is missing.", field); } } @@ -942,7 +942,7 @@ public class Enqueuer { processAnnotations(method.annotations.annotations); method.parameterAnnotationsList.forEachAnnotation(this::processAnnotation); if (Log.ENABLED) { - Log.verbose(getClass(), "Method `%s` is targeted.", method.method); + Log.debug(getClass(), "Method `%s` is targeted.", method.method); } if (forceProguardCompatibility) { // Keep targeted default methods in compatibility mode. The tree pruner will otherwise make @@ -965,7 +965,7 @@ public class Enqueuer { } collectProguardCompatibilityRule(reason); if (Log.ENABLED) { - Log.verbose(getClass(), "Class `%s` is instantiated, processing...", clazz); + Log.debug(getClass(), "Class `%s` is instantiated, processing...", clazz); } // This class becomes live, so it and all its supertypes become live types. markTypeAsLive(clazz.type); @@ -1103,11 +1103,11 @@ public class Enqueuer { if (encodedField.accessFlags.isStatic()) { if (Log.ENABLED) { - Log.verbose(getClass(), "Adding static field `%s` to live set.", encodedField.field); + Log.debug(getClass(), "Adding static field `%s` to live set.", encodedField.field); } } else { if (Log.ENABLED) { - Log.verbose(getClass(), "Adding instance field `%s` to live set (static context).", + Log.debug(getClass(), "Adding instance field `%s` to live set (static context).", encodedField.field); } } @@ -1122,7 +1122,7 @@ public class Enqueuer { markTypeAsLive(field.field.clazz); markTypeAsLive(field.field.type); if (Log.ENABLED) { - Log.verbose(getClass(), "Adding instance field `%s` to live set.", field.field); + Log.debug(getClass(), "Adding instance field `%s` to live set.", field.field); } liveFields.add(field, reason); collectProguardCompatibilityRule(reason); @@ -1140,7 +1140,7 @@ public class Enqueuer { return; } if (Log.ENABLED) { - Log.verbose(getClass(), "Register new instantiation of `%s`.", clazz); + Log.debug(getClass(), "Register new instantiation of `%s`.", clazz); } workList.add(Action.markInstantiated(clazz, keepReason)); } @@ -1180,7 +1180,7 @@ public class Enqueuer { if (!liveMethods.contains(encodedMethod)) { markTypeAsLive(encodedMethod.method.holder); if (Log.ENABLED) { - Log.verbose(getClass(), "Method `%s` has become live due to direct invoke", + Log.debug(getClass(), "Method `%s` has become live due to direct invoke", encodedMethod.method); } workList.add(Action.markMethodLive(encodedMethod, reason)); @@ -1195,7 +1195,7 @@ public class Enqueuer { || reason.isDueToReflectiveUse(); if (!liveMethods.contains(method)) { if (Log.ENABLED) { - Log.verbose(getClass(), "Adding virtual method `%s` to live set.", method.method); + Log.debug(getClass(), "Adding virtual method `%s` to live set.", method.method); } workList.add(Action.markMethodLive(method, reason)); } @@ -1208,7 +1208,7 @@ public class Enqueuer { private void markInstanceFieldAsReachable(DexField field, KeepReason reason) { if (Log.ENABLED) { - Log.verbose(getClass(), "Marking instance field `%s` as reachable.", field); + Log.debug(getClass(), "Marking instance field `%s` as reachable.", field); } DexEncodedField encodedField = appInfo.resolveFieldOn(field.clazz, field); if (encodedField == null) { @@ -1240,7 +1240,7 @@ public class Enqueuer { return; } if (Log.ENABLED) { - Log.verbose(getClass(), "Marking virtual method `%s` as reachable.", method); + Log.debug(getClass(), "Marking virtual method `%s` as reachable.", method); } if (method.holder.isArrayType()) { // This is an array type, so the actual class will be generated at runtime. We treat this @@ -1369,7 +1369,7 @@ public class Enqueuer { brokenSuperInvokes.add(method); } if (Log.ENABLED) { - Log.verbose(getClass(), "Adding super constraint from `%s` to `%s`", from.method, + Log.debug(getClass(), "Adding super constraint from `%s` to `%s`", from.method, target.method); } if (superInvokeDependencies.computeIfAbsent( @@ -1560,7 +1560,7 @@ public class Enqueuer { private void markAllLibraryVirtualMethodsReachable(DexClass clazz) { assert clazz.isLibraryClass(); if (Log.ENABLED) { - Log.verbose(getClass(), "Marking all methods of library class `%s` as reachable.", + Log.debug(getClass(), "Marking all methods of library class `%s` as reachable.", clazz.type); } for (DexEncodedMethod encodedMethod : clazz.virtualMethods()) { @@ -1583,7 +1583,7 @@ public class Enqueuer { if (superCallTargets != null) { for (DexEncodedMethod superCallTarget : superCallTargets) { if (Log.ENABLED) { - Log.verbose(getClass(), "Found super invoke constraint on `%s`.", + Log.debug(getClass(), "Found super invoke constraint on `%s`.", superCallTarget.method); } markMethodAsTargeted(superCallTarget, KeepReason.invokedViaSuperFrom(method)); diff --git a/src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java b/src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java index 2a8ce8f84..09701ec57 100644 --- a/src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java +++ b/src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java @@ -813,7 +813,7 @@ public class RootSetBuilder { for (ProguardMemberRule rule : rules) { if (rule.matches(method, appView, dexStringCache)) { if (Log.ENABLED) { - Log.verbose(getClass(), "Marking method `%s` due to `%s { %s }`.", method, context, + Log.debug(getClass(), "Marking method `%s` due to `%s { %s }`.", method, context, rule); } if (methodsMarked != null) { @@ -832,7 +832,7 @@ public class RootSetBuilder { for (ProguardMemberRule rule : rules) { if (rule.matches(field, appView, dexStringCache)) { if (Log.ENABLED) { - Log.verbose(getClass(), "Marking field `%s` due to `%s { %s }`.", field, context, + Log.debug(getClass(), "Marking field `%s` due to `%s { %s }`.", field, context, rule); } addItemToSets(field, context, rule, precondition); @@ -842,7 +842,7 @@ public class RootSetBuilder { private void markClass(DexClass clazz, ProguardConfigurationRule rule) { if (Log.ENABLED) { - Log.verbose(getClass(), "Marking class `%s` due to `%s`.", clazz.type, rule); + Log.debug(getClass(), "Marking class `%s` due to `%s`.", clazz.type, rule); } addItemToSets(clazz, rule, null, null); }