-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P0A serious issue requiring immediate resolutionA serious issue requiring immediate resolutionarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.web-dev-compiler
Milestone
Description
Following on from issue #36535 there is still a problem of a code size explosion when a constant is embedded in another constant. Given the following dart code we will generate calls to the const list constructor every time a appears in b.
main() {
const a = [1];
const b = [a,a,a];
}
When we dump the dill file we can see that one constant are references the other. Is there a mechanism already built to help us recognize this in the backend and generate better code?
main = tes::main;
library from "file:///Users/nshahan/code/test_files/test_03.dart" as tes {
static method main() → dynamic {
const core::List<core::int> a = #C2;
const core::List<core::List<core::int>> b = #C3;
}
}
constants {
#C1 = 1
#C2 = <core::int>[#C1]
#C3 = <core::List<core::int>>[#C2, #C2, #C2]
}
Metadata
Metadata
Assignees
Labels
P0A serious issue requiring immediate resolutionA serious issue requiring immediate resolutionarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.web-dev-compiler