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

Side by Side Diff: pkg/kernel/lib/target/vm.dart

Issue 2664033003: Only tree-shake if there's a main program. (Closed)
Patch Set: Rebased on 9bae50bf47ad22ba9c6e2096fffd7fa4a2633ebb (master). Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.target.vm; 4 library kernel.target.vm;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../core_types.dart'; 7 import '../core_types.dart';
8 import '../transformations/continuation.dart' as cont; 8 import '../transformations/continuation.dart' as cont;
9 import '../transformations/erasure.dart'; 9 import '../transformations/erasure.dart';
10 import '../transformations/insert_covariance_checks.dart'; 10 import '../transformations/insert_covariance_checks.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 var hierarchy = mixins.hierarchy; 61 var hierarchy = mixins.hierarchy;
62 var coreTypes = new CoreTypes(program); 62 var coreTypes = new CoreTypes(program);
63 63
64 if (strongMode) { 64 if (strongMode) {
65 new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes) 65 new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes)
66 .transformProgram(program); 66 .transformProgram(program);
67 new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes) 67 new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes)
68 .transformProgram(program); 68 .transformProgram(program);
69 } 69 }
70 70
71 new TreeShaker(program, 71 if (program.mainMethod != null) {
72 hierarchy: hierarchy, coreTypes: coreTypes, strongMode: strongMode) 72 new TreeShaker(program,
73 .transform(program); 73 hierarchy: hierarchy, coreTypes: coreTypes,
74 strongMode: strongMode)
75 .transform(program);
76 }
74 77
75 cont.transformProgram(program); 78 cont.transformProgram(program);
76 79
77 // Repair `_getMainClosure()` function in dart:_builtin. 80 // Repair `_getMainClosure()` function in dart:_builtin.
78 setup_builtin_library.transformProgram(program); 81 setup_builtin_library.transformProgram(program);
79 82
80 if (strongMode) { 83 if (strongMode) {
81 new Erasure().transform(program); 84 new Erasure().transform(program);
82 } 85 }
83 86
84 new SanitizeForVM().transform(program); 87 new SanitizeForVM().transform(program);
85 } 88 }
86 } 89 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698