Revert "Mark lambda main methods as synthetic."
This reverts commit bd1ec4e2a3e43cd35a1564d2dbda91e11b959c44.
Bug: b/171599229
Change-Id: Ieb4f2f3658267dff36344618fa07df8f15bc41d2
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java b/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
index 9b8f930..c9e47c2 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
@@ -233,7 +233,7 @@
new DexEncodedMethod(
mainMethod,
MethodAccessFlags.fromSharedAccessFlags(
- Constants.ACC_PUBLIC | Constants.ACC_FINAL | Constants.ACC_SYNTHETIC, false),
+ Constants.ACC_PUBLIC | Constants.ACC_FINAL, false),
MethodTypeSignature.noSignature(),
DexAnnotationSet.empty(),
ParameterAnnotationsList.empty(),
diff --git a/src/test/java/com/android/tools/r8/debug/DebugTestBase.java b/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
index 44bcc80..13d59dc 100644
--- a/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
+++ b/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
@@ -2108,6 +2108,14 @@
}
return false;
}
+ if (isInLambdaClass(mirror, location)) {
+ // Lambda classes must be skipped since they are only wrappers around lambda code.
+ if (DEBUG_TESTS) {
+ System.out.println("Skipping lambda class wrapper method");
+ }
+ wrapper.enqueueCommandFirst(stepCommand);
+ return true;
+ }
if (isSyntheticMethod(mirror, location)) {
if (DEBUG_TESTS) {
System.out.println("Skipping synthetic method");
@@ -2152,6 +2160,11 @@
return false;
}
+ private static boolean isInLambdaClass(VmMirror mirror, Location location) {
+ String classSig = mirror.getClassSignature(location.classID);
+ return classSig.contains("$$Lambda$");
+ }
+
private static boolean isLambdaMethod(VmMirror mirror, Location location) {
String methodName = mirror.getMethodName(location.classID, location.methodID);
return methodName.startsWith("lambda$");