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

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

Issue 722163002: Add support for static calls to the cps pipeline code generator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test Created 6 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.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) 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 @override 103 @override
104 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) { 104 js.Expression visitInvokeMethod(tree_ir.InvokeMethod node) {
105 return giveup(node); 105 return giveup(node);
106 // TODO: implement visitInvokeMethod 106 // TODO: implement visitInvokeMethod
107 } 107 }
108 108
109 @override 109 @override
110 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) { 110 js.Expression visitInvokeStatic(tree_ir.InvokeStatic node) {
111 return giveup(node); 111 Element element = node.target;
112 // TODO: implement visitInvokeStatic 112
113 registry.registerStaticInvocation(element);
114
115 js.Expression elementAccess = glue.elementAccess(node.target);
116 return new js.Call(elementAccess, visitArguments(node.arguments));
113 } 117 }
114 118
115 @override 119 @override
116 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) { 120 js.Expression visitInvokeSuperMethod(tree_ir.InvokeSuperMethod node) {
117 return giveup(node); 121 return giveup(node);
118 // TODO: implement visitInvokeSuperMethod 122 // TODO: implement visitInvokeSuperMethod
119 } 123 }
120 124
121 @override 125 @override
122 js.Expression visitLiteralList(tree_ir.LiteralList node) { 126 js.Expression visitLiteralList(tree_ir.LiteralList node) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // TODO: implement visitWhileTrue 225 // TODO: implement visitWhileTrue
222 } 226 }
223 227
224 @override 228 @override
225 void visitReturn(tree_ir.Return node) { 229 void visitReturn(tree_ir.Return node) {
226 if (node.value != null) { 230 if (node.value != null) {
227 accumulator.add(new js.Return(visitExpression(node.value))); 231 accumulator.add(new js.Return(visitExpression(node.value)));
228 } 232 }
229 } 233 }
230 } 234 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.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