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

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

Issue 779593002: Move elementAccess() from namer to emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 6 years 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 js.Expression compileConstant(ParameterElement parameter) { 165 js.Expression compileConstant(ParameterElement parameter) {
166 return buildConstant(glue.getConstantForVariable(parameter).value); 166 return buildConstant(glue.getConstantForVariable(parameter).value);
167 } 167 }
168 168
169 js.Expression buildStaticInvoke(Selector selector, 169 js.Expression buildStaticInvoke(Selector selector,
170 Element target, 170 Element target,
171 List<js.Expression> arguments) { 171 List<js.Expression> arguments) {
172 registry.registerStaticInvocation(target.declaration); 172 registry.registerStaticInvocation(target.declaration);
173 173
174 js.Expression elementAccess = glue.elementAccess(target); 174 js.Expression elementAccess = glue.staticFunctionAccess(target);
175 List<js.Expression> compiledArguments = 175 List<js.Expression> compiledArguments =
176 selector.makeArgumentsList(target.implementation, 176 selector.makeArgumentsList(target.implementation,
177 arguments, 177 arguments,
178 compileConstant); 178 compileConstant);
179 return new js.Call(elementAccess, compiledArguments); 179 return new js.Call(elementAccess, compiledArguments);
180 } 180 }
181 181
182 @override 182 @override
183 js.Expression visitInvokeConstructor(tree_ir.InvokeConstructor node) { 183 js.Expression visitInvokeConstructor(tree_ir.InvokeConstructor node) {
184 if (node.constant != null) return giveup(node); 184 if (node.constant != null) return giveup(node);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 accumulator.add( 410 accumulator.add(
411 buildWhile(new js.LiteralBool(true), node.body, node.label, node)); 411 buildWhile(new js.LiteralBool(true), node.body, node.label, node));
412 } 412 }
413 413
414 @override 414 @override
415 void visitReturn(tree_ir.Return node) { 415 void visitReturn(tree_ir.Return node) {
416 accumulator.add(new js.Return(visitExpression(node.value))); 416 accumulator.add(new js.Return(visitExpression(node.value)));
417 } 417 }
418 418
419 } 419 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/checked_mode_helpers.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