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

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

Issue 1345983007: dart2js CPS: Clean up the S-Expression builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Cleanup. Created 5 years, 3 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 void dumpTypedIR(cps.FunctionDefinition cpsNode, 146 void dumpTypedIR(cps.FunctionDefinition cpsNode,
147 TypePropagator typePropagator) { 147 TypePropagator typePropagator) {
148 if (PRINT_TYPED_IR_FILTER != null && 148 if (PRINT_TYPED_IR_FILTER != null &&
149 PRINT_TYPED_IR_FILTER.matchAsPrefix(cpsNode.element.name) != null) { 149 PRINT_TYPED_IR_FILTER.matchAsPrefix(cpsNode.element.name) != null) {
150 String printType(nodeOrRef, String s) { 150 String printType(nodeOrRef, String s) {
151 cps.Node node = nodeOrRef is cps.Reference 151 cps.Node node = nodeOrRef is cps.Reference
152 ? nodeOrRef.definition 152 ? nodeOrRef.definition
153 : nodeOrRef; 153 : nodeOrRef;
154 var type = typePropagator.getType(node); 154 return node is cps.Variable && node.type != null
155 return type == null ? s : "$s:${formatTypeMask(type.type)}"; 155 ? '$s:${formatTypeMask(node.type)}'
156 : s;
156 } 157 }
157 DEBUG_MODE = true; 158 DEBUG_MODE = true;
158 print(new SExpressionStringifier(printType).visit(cpsNode)); 159 print(new SExpressionStringifier(printType).visit(cpsNode));
159 } 160 }
160 } 161 }
161 162
162 static bool checkCpsIntegrity(cps.FunctionDefinition node) { 163 static bool checkCpsIntegrity(cps.FunctionDefinition node) {
163 new CheckCpsIntegrity().check(node); 164 new CheckCpsIntegrity().check(node);
164 return true; // So this can be used from assert(). 165 return true; // So this can be used from assert().
165 } 166 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // TODO(sigurdm): Make a better list of tasks. 243 // TODO(sigurdm): Make a better list of tasks.
243 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 244 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
244 } 245 }
245 246
246 js.Node attachPosition(js.Node node, AstElement element) { 247 js.Node attachPosition(js.Node node, AstElement element) {
247 return node.withSourceInformation( 248 return node.withSourceInformation(
248 sourceInformationFactory.createBuilderForContext(element) 249 sourceInformationFactory.createBuilderForContext(element)
249 .buildDeclaration(element)); 250 .buildDeclaration(element));
250 } 251 }
251 } 252 }
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