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

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

Issue 917083003: Revert "dart2js: Refactoring, documentation, and a few bugfixes in Namer class." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 List<js.Expression> arguments = visitArguments(node.arguments); 270 List<js.Expression> arguments = visitArguments(node.arguments);
271 return buildStaticInvoke(selector, target, arguments); 271 return buildStaticInvoke(selector, target, arguments);
272 } 272 }
273 273
274 @override 274 @override
275 js.Expression visitInvokeMethodDirectly(tree_ir.InvokeMethodDirectly node) { 275 js.Expression visitInvokeMethodDirectly(tree_ir.InvokeMethodDirectly node) {
276 registry.registerDirectInvocation(node.target.declaration); 276 registry.registerDirectInvocation(node.target.declaration);
277 if (node.target is ConstructorBodyElement) { 277 if (node.target is ConstructorBodyElement) {
278 // A constructor body cannot be overriden or intercepted, so we can 278 // A constructor body cannot be overriden or intercepted, so we can
279 // use the short form for this invocation. 279 // use the short form for this invocation.
280 // TODO(asgerf): prevent name clash between constructor bodies.
280 return js.js('#.#(#)', 281 return js.js('#.#(#)',
281 [visitExpression(node.receiver), 282 [visitExpression(node.receiver),
282 glue.instanceMethodName(node.target), 283 glue.instanceMethodName(node.target),
283 visitArguments(node.arguments)]); 284 visitArguments(node.arguments)]);
284 } 285 }
285 return js.js('#.#.call(#, #)', 286 return js.js('#.#.call(#, #)',
286 [glue.prototypeAccess(node.target.enclosingClass), 287 [glue.prototypeAccess(node.target.enclosingClass),
287 glue.invocationName(node.selector), 288 glue.invocationName(node.selector),
288 visitExpression(node.receiver), 289 visitExpression(node.receiver),
289 visitArguments(node.arguments)]); 290 visitArguments(node.arguments)]);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 void visitSetField(tree_ir.SetField node) { 523 void visitSetField(tree_ir.SetField node) {
523 js.PropertyAccess field = 524 js.PropertyAccess field =
524 new js.PropertyAccess.field( 525 new js.PropertyAccess.field(
525 visitExpression(node.object), 526 visitExpression(node.object),
526 glue.instanceFieldPropertyName(node.field)); 527 glue.instanceFieldPropertyName(node.field));
527 js.Assignment asn = new js.Assignment(field, visitExpression(node.value)); 528 js.Assignment asn = new js.Assignment(field, visitExpression(node.value));
528 accumulator.add(new js.ExpressionStatement(asn)); 529 accumulator.add(new js.ExpressionStatement(asn));
529 visitStatement(node.next); 530 visitStatement(node.next);
530 } 531 }
531 } 532 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.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