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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/task.dart

Issue 1408783004: dart2js cps: Support --trust-primitives and --trust-type-annotations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 2 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/compiler/lib/src/cps_ir/type_propagation.dart ('k') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 4
5 /// Generate code using the cps-based IR pipeline. 5 /// Generate code using the cps-based IR pipeline.
6 library code_generator_task; 6 library code_generator_task;
7 7
8 import 'glue.dart'; 8 import 'glue.dart';
9 import 'codegen.dart'; 9 import 'codegen.dart';
10 import 'unsugar.dart'; 10 import 'unsugar.dart';
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 void applyCpsPass(cps_opt.Pass pass, cps.FunctionDefinition cpsFunction) { 127 void applyCpsPass(cps_opt.Pass pass, cps.FunctionDefinition cpsFunction) {
128 cpsOptimizationTask.measureSubtask(pass.passName, () { 128 cpsOptimizationTask.measureSubtask(pass.passName, () {
129 pass.rewrite(cpsFunction); 129 pass.rewrite(cpsFunction);
130 }); 130 });
131 traceGraph(pass.passName, cpsFunction); 131 traceGraph(pass.passName, cpsFunction);
132 dumpTypedIr(pass.passName, cpsFunction); 132 dumpTypedIr(pass.passName, cpsFunction);
133 assert(checkCpsIntegrity(cpsFunction, pass.passName)); 133 assert(checkCpsIntegrity(cpsFunction, pass.passName));
134 } 134 }
135 135
136 cps.FunctionDefinition compileToCpsIr(AstElement element) { 136 cps.FunctionDefinition compileToCpsIr(AstElement element) {
137 cps.FunctionDefinition cpsFunction = cpsBuilderTask.buildNode(element); 137 cps.FunctionDefinition cpsFunction =
138 cpsBuilderTask.buildNode(element, typeSystem);
138 if (cpsFunction == null) { 139 if (cpsFunction == null) {
139 if (cpsBuilderTask.bailoutMessage == null) { 140 if (cpsBuilderTask.bailoutMessage == null) {
140 giveUp('unable to build cps definition of $element'); 141 giveUp('unable to build cps definition of $element');
141 } else { 142 } else {
142 giveUp(cpsBuilderTask.bailoutMessage); 143 giveUp(cpsBuilderTask.bailoutMessage);
143 } 144 }
144 } 145 }
145 ParentVisitor.setParents(cpsFunction); 146 ParentVisitor.setParents(cpsFunction);
146 traceGraph('IR Builder', cpsFunction); 147 traceGraph('IR Builder', cpsFunction);
147 dumpTypedIr('IR Builder', cpsFunction); 148 dumpTypedIr('IR Builder', cpsFunction);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 treeOptimizationTask] 279 treeOptimizationTask]
279 ..addAll(fallbackCompiler.tasks); 280 ..addAll(fallbackCompiler.tasks);
280 } 281 }
281 282
282 js.Node attachPosition(js.Node node, AstElement element) { 283 js.Node attachPosition(js.Node node, AstElement element) {
283 return node.withSourceInformation( 284 return node.withSourceInformation(
284 sourceInformationFactory.createBuilderForContext(element) 285 sourceInformationFactory.createBuilderForContext(element)
285 .buildDeclaration(element)); 286 .buildDeclaration(element));
286 } 287 }
287 } 288 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698