This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit 0e5a539
[vm/aot] Keep toString methods on exception classes in toString transformer
Flutter in google3 uses --delete-tostring-package-uri compiler option
to remove toString methods in package:flutter and dart:ui to reduce
size in release mode.
This has unfortunate effect of removing toString methods from exception
classes which may provide valuable information for investigating
problems seen in the wild.
This change adds a new @pragma('flutter:keep-to-string-in-subtypes')
on classes to keep toString methods on all subtypes of the annotated
classes. This pragma is now used on Exception and Error classes in
dart:core.
TEST=pkg/vm/test/transformations/to_string_transformer_test.dart
Issue: flutter/flutter#61562
Change-Id: Ib739c83cdf6b539208f705ba198e63b8bc54fa61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227920
Reviewed-by: Dan Field <[email protected]>
Reviewed-by: Slava Egorov <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>1 parent 442836b commit 0e5a539
File tree
7 files changed
+134
-4
lines changed- pkg/vm
- lib/transformations
- testcases/transformations/to_string_transformer
- lib
- runtime/docs
- sdk/lib/core
7 files changed
+134
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| |||
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
46 | | - | |
47 | | - | |
| 59 | + | |
48 | 60 | | |
49 | 61 | | |
50 | 62 | | |
| |||
61 | 73 | | |
62 | 74 | | |
63 | 75 | | |
64 | | - | |
| 76 | + | |
| 77 | + | |
65 | 78 | | |
66 | 79 | | |
67 | 80 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
29 | 47 | | |
30 | 48 | | |
31 | 49 | | |
32 | 50 | | |
33 | 51 | | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
42 | 79 | | |
| 80 | + | |
43 | 81 | | |
44 | 82 | | |
45 | 83 | | |
46 | 84 | | |
47 | 85 | | |
48 | 86 | | |
49 | 87 | | |
| 88 | + | |
| 89 | + | |
50 | 90 | | |
51 | 91 | | |
52 | 92 | | |
| |||
63 | 103 | | |
64 | 104 | | |
65 | 105 | | |
| 106 | + | |
| 107 | + | |
66 | 108 | | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
42 | 79 | | |
| 80 | + | |
43 | 81 | | |
44 | 82 | | |
45 | 83 | | |
46 | 84 | | |
47 | 85 | | |
48 | 86 | | |
49 | 87 | | |
| 88 | + | |
| 89 | + | |
50 | 90 | | |
51 | 91 | | |
52 | 92 | | |
| |||
63 | 103 | | |
64 | 104 | | |
65 | 105 | | |
| 106 | + | |
| 107 | + | |
66 | 108 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments