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

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

Issue 1070023002: Propagate bailout messages from the CPS IR backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add another giveup method. Created 5 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 cps.FunctionDefinition compileToCpsIR(AstElement element) { 102 cps.FunctionDefinition compileToCpsIR(AstElement element) {
103 // TODO(sigurdm): Support these constructs. 103 // TODO(sigurdm): Support these constructs.
104 if (element.isNative || 104 if (element.isNative ||
105 element.isField) { 105 element.isField) {
106 giveUp('unsupported element kind: ${element.name}:${element.kind}'); 106 giveUp('unsupported element kind: ${element.name}:${element.kind}');
107 } 107 }
108 108
109 cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element); 109 cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element);
110 if (cpsNode == null) { 110 if (cpsNode == null) {
111 giveUp('unable to build cps definition of $element'); 111 if (irBuilderTask.bailoutMessage == null) {
112 giveUp('unable to build cps definition of $element');
113 } else {
114 giveUp(irBuilderTask.bailoutMessage);
115 }
112 } 116 }
113 if (element.isInstanceMember && !element.isGenerativeConstructorBody) { 117 if (element.isInstanceMember && !element.isGenerativeConstructorBody) {
114 Selector selector = new Selector.fromElement(cpsNode.element); 118 Selector selector = new Selector.fromElement(cpsNode.element);
115 if (glue.isInterceptedSelector(selector)) { 119 if (glue.isInterceptedSelector(selector)) {
116 giveUp('cannot compile methods that need interceptor calling ' 120 giveUp('cannot compile methods that need interceptor calling '
117 'convention.'); 121 'convention.');
118 } 122 }
119 } 123 }
120 traceGraph("IR Builder", cpsNode); 124 traceGraph("IR Builder", cpsNode);
121 new UnsugarVisitor(glue).rewrite(cpsNode); 125 new UnsugarVisitor(glue).rewrite(cpsNode);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 Iterable<CompilerTask> get tasks { 226 Iterable<CompilerTask> get tasks {
223 // TODO(sigurdm): Make a better list of tasks. 227 // TODO(sigurdm): Make a better list of tasks.
224 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 228 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
225 } 229 }
226 230
227 js.Node attachPosition(js.Node node, AstElement element) { 231 js.Node attachPosition(js.Node node, AstElement element) {
228 return node.withSourceInformation( 232 return node.withSourceInformation(
229 StartEndSourceInformation.computeSourceInformation(element)); 233 StartEndSourceInformation.computeSourceInformation(element));
230 } 234 }
231 } 235 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698