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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart

Issue 329983002: Implement references to "this" in the new IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.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 dart_codegen; 5 library dart_codegen;
6 6
7 import 'dart_tree.dart' as tree; 7 import 'dart_tree.dart' as tree;
8 import 'dart_printer.dart'; 8 import 'dart_printer.dart';
9 import 'dart_tree_printer.dart' show TreePrinter; 9 import 'dart_tree_printer.dart' show TreePrinter;
10 import '../tree/tree.dart' as frontend; 10 import '../tree/tree.dart' as frontend;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 statementBuffer = savedBuffer; 326 statementBuffer = savedBuffer;
327 fallthrough = savedFallthrough; 327 fallthrough = savedFallthrough;
328 328
329 visitStatement(stmt.next); 329 visitStatement(stmt.next);
330 } 330 }
331 331
332 Expression visitConstant(tree.Constant exp) { 332 Expression visitConstant(tree.Constant exp) {
333 return emitConstant(exp.value); 333 return emitConstant(exp.value);
334 } 334 }
335 335
336 Expression visitThis(tree.This exp) {
337 return new This();
338 }
339
336 Expression visitLiteralList(tree.LiteralList exp) { 340 Expression visitLiteralList(tree.LiteralList exp) {
337 return new LiteralList( 341 return new LiteralList(
338 exp.values.map(visitExpression).toList(growable: false), 342 exp.values.map(visitExpression).toList(growable: false),
339 isConst: exp.constant != null, 343 isConst: exp.constant != null,
340 typeArgument: emitOptionalType(exp.type.typeArguments.single)); 344 typeArgument: emitOptionalType(exp.type.typeArguments.single));
341 } 345 }
342 346
343 Expression visitLiteralMap(tree.LiteralMap exp) { 347 Expression visitLiteralMap(tree.LiteralMap exp) {
344 List<LiteralMapEntry> entries = new List<LiteralMapEntry>.generate( 348 List<LiteralMapEntry> entries = new List<LiteralMapEntry>.generate(
345 exp.values.length, 349 exp.values.length,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 } else if (constant is dart2js.TypeConstant) { 515 } else if (constant is dart2js.TypeConstant) {
512 GenericType type = constant.representedType; 516 GenericType type = constant.representedType;
513 return new Identifier(type.name) 517 return new Identifier(type.name)
514 ..element = type.element; 518 ..element = type.element;
515 } else { 519 } else {
516 throw "Unsupported constant: $constant"; 520 throw "Unsupported constant: $constant";
517 } 521 }
518 } 522 }
519 } 523 }
520 524
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698