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

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

Issue 862703002: Implement constructor bodies and initializers in CPS->JS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase again Created 5 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 | Annotate | Revision Log
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 void traceGraph(String title, var irObject) { 91 void traceGraph(String title, var irObject) {
92 if (tracer != null) { 92 if (tracer != null) {
93 tracer.traceGraph(title, irObject); 93 tracer.traceGraph(title, irObject);
94 } 94 }
95 } 95 }
96 96
97 cps.FunctionDefinition compileToCpsIR(AstElement element) { 97 cps.FunctionDefinition compileToCpsIR(AstElement element) {
98 // TODO(sigurdm): Support these constructs. 98 // TODO(sigurdm): Support these constructs.
99 if (element.isGenerativeConstructorBody || 99 if (element.isNative ||
100 element.isNative ||
101 element.isField) { 100 element.isField) {
102 giveUp('unsupported element kind: ${element.name}:${element.kind}'); 101 giveUp('unsupported element kind: ${element.name}:${element.kind}');
103 } 102 }
104 103
105 cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element); 104 cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element);
106 if (cpsNode == null) { 105 if (cpsNode == null) {
107 giveUp('unable to build cps definition of $element'); 106 giveUp('unable to build cps definition of $element');
108 } 107 }
109 traceGraph("IR Builder", cpsNode); 108 traceGraph("IR Builder", cpsNode);
110 new UnsugarVisitor(glue).rewrite(cpsNode); 109 new UnsugarVisitor(glue).rewrite(cpsNode);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 endSourcePosition = 225 endSourcePosition =
227 new TokenSourceFileLocation(sourceFile, endToken, name); 226 new TokenSourceFileLocation(sourceFile, endToken, name);
228 } 227 }
229 return node.withPosition(sourcePosition, endSourcePosition); 228 return node.withPosition(sourcePosition, endSourcePosition);
230 } 229 }
231 230
232 SourceFile sourceFileOfElement(Element element) { 231 SourceFile sourceFileOfElement(Element element) {
233 return element.implementation.compilationUnit.script.file; 232 return element.implementation.compilationUnit.script.file;
234 } 233 }
235 } 234 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/unsugar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698