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

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

Issue 1130813002: dart2js cps: Handle error cases. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Whitelist unused API due to semantic visitor being WIP Created 5 years, 7 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 js.Expression typeArguments = new js.ArrayInitializer( 582 js.Expression typeArguments = new js.ArrayInitializer(
583 typeInformation.map(visitExpression).toList()); 583 typeInformation.map(visitExpression).toList());
584 return buildStaticHelperInvocation(helper, 584 return buildStaticHelperInvocation(helper,
585 <js.Expression>[instance, typeArguments]); 585 <js.Expression>[instance, typeArguments]);
586 } else { 586 } else {
587 return instance; 587 return instance;
588 } 588 }
589 } 589 }
590 590
591 @override 591 @override
592 js.Expression visitCreateInvocationMirror(
593 tree_ir.CreateInvocationMirror node) {
594 js.Expression name = js.string(node.selector.name);
595 js.Expression internalName = js.string(glue.invocationName(node.selector));
596 js.Expression kind = js.number(node.selector.invocationMirrorKind);
597 js.Expression arguments = new js.ArrayInitializer(
598 node.arguments.map(visitExpression).toList());
599 js.Expression argumentNames = new js.ArrayInitializer(
600 node.selector.namedArguments.map(js.string).toList());
601 return buildStaticHelperInvocation(glue.createInvocationMirrorMethod,
602 [name, internalName, kind, arguments, argumentNames]);
603 }
604
605 @override
592 js.Expression visitGetField(tree_ir.GetField node) { 606 js.Expression visitGetField(tree_ir.GetField node) {
593 return new js.PropertyAccess.field( 607 return new js.PropertyAccess.field(
594 visitExpression(node.object), 608 visitExpression(node.object),
595 glue.instanceFieldPropertyName(node.field)); 609 glue.instanceFieldPropertyName(node.field));
596 } 610 }
597 611
598 @override 612 @override
599 js.Assignment visitSetField(tree_ir.SetField node) { 613 js.Assignment visitSetField(tree_ir.SetField node) {
600 js.PropertyAccess field = 614 js.PropertyAccess field =
601 new js.PropertyAccess.field( 615 new js.PropertyAccess.field(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 676
663 @override 677 @override
664 visitVariableDeclaration(tree_ir.VariableDeclaration node) { 678 visitVariableDeclaration(tree_ir.VariableDeclaration node) {
665 return errorUnsupportedNode(node); 679 return errorUnsupportedNode(node);
666 } 680 }
667 681
668 errorUnsupportedNode(tree_ir.DartSpecificNode node) { 682 errorUnsupportedNode(tree_ir.DartSpecificNode node) {
669 throw "Unsupported node in JS backend: $node"; 683 throw "Unsupported node in JS backend: $node";
670 } 684 }
671 } 685 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698