Chromium Code Reviews
DescriptionAvoid inlining constants that are used via a deferred import.
In order to avoid values from a deferred library to leak into the source code, we create an intermediate constant and refer via that. This is also done for non-primitive constants, so that for a case like:
main.dart:
import "lib.dart" deferred as lib;
class C { const C(); }
main() {
print(const C());
print(lib.C1);
}
lib.dart:
import "main.dart" as main;
const C1 = const main.C();
The main output file will not reveal that we are printing the same constant twice.
This CL also changes the constant emitter to be split between a literal emitter and a reference emitter, instead of a initializer emitter and a reference emitter.
R=johnniwinther@google.com
Committed: https://code.google.com/p/dart/source/detail?r=36286
Patch Set 1 : #Patch Set 2 : Use intermediate constants. #
Total comments: 4
Patch Set 3 : #Patch Set 4 : Rebase #Messages
Total messages: 6 (0 generated)
|