Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 12095034: dart2js: Don't emit static const fields since they are inlined where they are used (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index 3f1313affdcb2f339dd10161ca8c06aee99abab0..691cbac7af90626a3cefc568083922309a361414 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -229,7 +229,9 @@ class ConstantHandler extends CompilerTask {
return initialVariableValues.keys.where((element) {
return element.kind == ElementKind.FIELD
&& !element.isInstanceMember()
- && !element.modifiers.isFinal();
+ && !element.modifiers.isFinal()
+ // The const fields are all either emitted elsewhere or inlined.
+ && !element.modifiers.isConst();
});
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/emit_const_fields_test.dart » ('j') | tests/compiler/dart2js/emit_const_fields_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698