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

Side by Side Diff: frog/leg/ssa/builder.dart

Issue 8513004: Throw and a small fix to If. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 9 years, 1 month 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 | « no previous file | frog/leg/ssa/codegen.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class SsaBuilderTask extends CompilerTask { 5 class SsaBuilderTask extends CompilerTask {
6 SsaBuilderTask(Compiler compiler) : super(compiler); 6 SsaBuilderTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA builder'; 7 String get name() => 'SSA builder';
8 8
9 HGraph build(Node tree, Map<Node, Element> elements) { 9 HGraph build(Node tree, Map<Node, Element> elements) {
10 return measure(() { 10 return measure(() {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } 316 }
317 visit(node.expression); 317 visit(node.expression);
318 var value = pop(); 318 var value = pop();
319 add(new HReturn(value)); 319 add(new HReturn(value));
320 block.addSuccessor(graph.exit); 320 block.addSuccessor(graph.exit);
321 // A return aborts the building of the current block. 321 // A return aborts the building of the current block.
322 block = null; 322 block = null;
323 } 323 }
324 324
325 visitThrow(Throw node) { 325 visitThrow(Throw node) {
326 compiler.unimplemented("SsaBuilder.visitThrow"); 326 if (node.expression === null) {
327 compiler.unimplemented("SsaBuilder: throw without expression");
328 }
329 visit(node.expression);
330 add(new HThrow(pop()));
331 // A throw aborts the building of the current block.
332 block = null;
327 } 333 }
328 334
329 visitTypeAnnotation(TypeAnnotation node) { 335 visitTypeAnnotation(TypeAnnotation node) {
330 // We currently ignore type annotations for generating code. 336 // We currently ignore type annotations for generating code.
331 } 337 }
332 338
333 HInstruction updateDefinition(SendSet node) { 339 HInstruction updateDefinition(SendSet node) {
334 if (node.receiver != null) { 340 if (node.receiver != null) {
335 compiler.unimplemented("SsaBuilder: property access"); 341 compiler.unimplemented("SsaBuilder: property access");
336 } 342 }
(...skipping 12 matching lines...) Expand all
349 if (definition is Identifier) { 355 if (definition is Identifier) {
350 compiler.unimplemented( 356 compiler.unimplemented(
351 "SsaBuilder.visitVariableDefinitions without initial value"); 357 "SsaBuilder.visitVariableDefinitions without initial value");
352 } else { 358 } else {
353 assert(definition is SendSet); 359 assert(definition is SendSet);
354 updateDefinition(definition); 360 updateDefinition(definition);
355 } 361 }
356 } 362 }
357 } 363 }
358 } 364 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698