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

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

Issue 2644543004: Revert "Improvements to the kernel tree shaker." (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/core_types.dart ('k') | pkg/kernel/lib/transformations/treeshaker.dart » ('j') | 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';
11 import '../transformations/insert_type_checks.dart'; 11 import '../transformations/insert_type_checks.dart';
12 import '../transformations/mixin_full_resolution.dart' as mix; 12 import '../transformations/mixin_full_resolution.dart' as mix;
13 import '../transformations/sanitize_for_vm.dart'; 13 import '../transformations/sanitize_for_vm.dart';
14 import '../transformations/setup_builtin_library.dart' as setup_builtin_library; 14 import '../transformations/setup_builtin_library.dart' as setup_builtin_library;
15 import '../transformations/treeshaker.dart';
16 import 'targets.dart'; 15 import 'targets.dart';
17 16
18 /// Specializes the kernel IR to the Dart VM. 17 /// Specializes the kernel IR to the Dart VM.
19 class VmTarget extends Target { 18 class VmTarget extends Target {
20 final TargetFlags flags; 19 final TargetFlags flags;
21 20
22 VmTarget(this.flags); 21 VmTarget(this.flags);
23 22
24 bool get strongMode => flags.strongMode; 23 bool get strongMode => flags.strongMode;
25 24
(...skipping 25 matching lines...) Expand all
51 'dart:_vmservice', 50 'dart:_vmservice',
52 'dart:_builtin', 51 'dart:_builtin',
53 'dart:nativewrappers', 52 'dart:nativewrappers',
54 'dart:io', 53 'dart:io',
55 ]; 54 ];
56 55
57 void transformProgram(Program program) { 56 void transformProgram(Program program) {
58 var mixins = new mix.MixinFullResolution(); 57 var mixins = new mix.MixinFullResolution();
59 mixins.transform(program); 58 mixins.transform(program);
60 59
61 var hierarchy = mixins.hierarchy;
62 var coreTypes = new CoreTypes(program);
63
64 if (strongMode) { 60 if (strongMode) {
61 var hierarchy = mixins.hierarchy;
62 var coreTypes = new CoreTypes(program);
65 new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes) 63 new InsertTypeChecks(hierarchy: hierarchy, coreTypes: coreTypes)
66 .transformProgram(program); 64 .transformProgram(program);
67 new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes) 65 new InsertCovarianceChecks(hierarchy: hierarchy, coreTypes: coreTypes)
68 .transformProgram(program); 66 .transformProgram(program);
69 } 67 }
70 68
71 new TreeShaker(program,
72 hierarchy: hierarchy, coreTypes: coreTypes, strongMode: strongMode)
73 .transform(program);
74
75 cont.transformProgram(program); 69 cont.transformProgram(program);
76 70
77 // Repair `_getMainClosure()` function in dart:_builtin. 71 // Repair `_getMainClosure()` function in dart:_builtin.
78 setup_builtin_library.transformProgram(program); 72 setup_builtin_library.transformProgram(program);
79 73
80 if (strongMode) { 74 if (strongMode) {
81 new Erasure().transform(program); 75 new Erasure().transform(program);
82 } 76 }
83 77
84 new SanitizeForVM().transform(program); 78 new SanitizeForVM().transform(program);
85 } 79 }
86 } 80 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/core_types.dart ('k') | pkg/kernel/lib/transformations/treeshaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698