Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Const finder fixes #15880

Merged
merged 8 commits into from
Jan 22, 2020
Merged

Const finder fixes #15880

merged 8 commits into from
Jan 22, 2020

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Jan 22, 2020

  • Hit all libraries, not just the main one. Found this necessary when testing this on the gallery.
  • Make sure we ignore consts we don't care about (return if it doesn't match, don't just continue).

final PrimitiveConstant<dynamic> value = kvp.value as PrimitiveConstant<dynamic>;
instance[kvp.key.canonicalName.name] = value.value;
}
constantInstances.add(instance);
if (_visitedInstnaces.add(instance.toString())) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cheating a little, but it's simpler than creating a class that can properly hash and equality compare a dynamic map.

It's good enough to dedup things when all the parameters are in order.

Comment on lines -46 to -49
..addOption('main-library-uri',
help: 'The package: URI to treat as the main entrypoint library '
'(the same package used to create the kernel-file).',
valueHelp: 'package:hello_world/main.dart')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just doesn't work. Gallery, for example, uses multiple libraries to define icons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you add any tests to cover this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're making me sad. I'll update the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -53,15 +51,22 @@ class _ConstVisitor extends RecursiveVisitor<void> {

@override
void visitInstanceConstantReference(InstanceConstant node) {
node.fieldValues.values.whereType<InstanceConstant>().forEach(visitInstanceConstantReference);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important if the const is defined inline somewhere - it never gets visited by this method otherwise.

It has to be up here before we check for matches because it could either be in the class we care about or in some other class.

@dnfield dnfield merged commit 80bc855 into flutter:master Jan 22, 2020
@dnfield dnfield deleted the const_finder_fixes branch January 22, 2020 20:00
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 24, 2020
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jan 24, 2020
flutter/engine@46e58b9...439a218

git log 46e58b9..439a218 --first-parent --oneline
2020-01-23 [email protected] Fixes labelPrefix memory leak in FlutterEngine (flutter/engine#14674)
2020-01-23 [email protected] Release TextureView surface within FlutterTextureView when disconnected. (#48535) (flutter/engine#15899)
2020-01-23 [email protected] [fuchsia] Timeline events in profile mode to observatory (flutter/engine#15900)
2020-01-23 [email protected] Roll fuchsia/sdk/core/linux-amd64 from N502w... to Wc7e4... (flutter/engine#15935)
2020-01-23 [email protected] Add script to force build LUCI builders for a specified commit (flutter/engine#15938)
2020-01-23 [email protected] Roll src/third_party/dart 6aa7407d6309..e84bea25df23 (6 commits) (flutter/engine#15934)
2020-01-23 [email protected] Roll src/third_party/skia f9aea7f7e502..e4ddb8a7cddc (35 commits) (flutter/engine#15931)
2020-01-23 [email protected] Roll fuchsia/sdk/core/mac-amd64 from LGwl3... to LAOYs... (flutter/engine#15930)
2020-01-23 [email protected] Roll src/third_party/dart 582727a4ec3b..6aa7407d6309 (4 commits) (flutter/engine#15923)
2020-01-23 [email protected] Revert "Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118)" (flutter/engine#15903)
2020-01-23 [email protected] Roll src/third_party/dart a9ea9365ad8a..582727a4ec3b (33 commits) (flutter/engine#15906)
2020-01-22 [email protected] Implement new SkCanvas virtuals in testing canvases (flutter/engine#15893)
2020-01-22 [email protected] Const finder fixes (flutter/engine#15880)
2020-01-22 [email protected] Roll fuchsia/sdk/core/linux-amd64 from v-OJE... to N502w... (flutter/engine#15892)
2020-01-22 [email protected] errant log (flutter/engine#15891)
2020-01-22 [email protected] Roll src/third_party/skia d59053987a27..f9aea7f7e502 (10 commits) (flutter/engine#15890)
2020-01-22 [email protected] [libtxt] Assign a unique ID to each glyph cluster within a line (flutter/engine#15742)
2020-01-22 [email protected] Roll src/third_party/dart 439cabaec02f..a9ea9365ad8a (4 commits) (flutter/engine#15886)
2020-01-22 [email protected] Roll fuchsia/sdk/core/mac-amd64 from jAkm1... to LGwl3... (flutter/engine#15884)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
NoamDev pushed a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
NoamDev added a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants