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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ir/ir_nodes.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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // IrNodes are kept in a separate library to have precise control over their 5 // IrNodes are kept in a separate library to have precise control over their
6 // dependencies on other parts of the system. 6 // dependencies on other parts of the system.
7 library dart2js.ir_nodes; 7 library dart2js.ir_nodes;
8 8
9 import '../dart2jslib.dart' as dart2js show Constant, ConstructedConstant; 9 import '../dart2jslib.dart' as dart2js show Constant, ConstructedConstant;
10 import '../elements/elements.dart' 10 import '../elements/elements.dart'
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 class Constant extends Primitive { 300 class Constant extends Primitive {
301 final dart2js.Constant value; 301 final dart2js.Constant value;
302 302
303 Constant(this.value); 303 Constant(this.value);
304 304
305 dart2js.Constant get constant => value; 305 dart2js.Constant get constant => value;
306 306
307 accept(Visitor visitor) => visitor.visitConstant(this); 307 accept(Visitor visitor) => visitor.visitConstant(this);
308 } 308 }
309 309
310 class This extends Primitive {
311 This();
312
313 accept(Visitor visitor) => visitor.visitThis(this);
314 }
315
310 class LiteralList extends Primitive { 316 class LiteralList extends Primitive {
311 /// The List type being created; this is not the type argument. 317 /// The List type being created; this is not the type argument.
312 final GenericType type; 318 final GenericType type;
313 final List<Reference> values; 319 final List<Reference> values;
314 320
315 /// Set to null if this is not a const literal list. 321 /// Set to null if this is not a const literal list.
316 final dart2js.Constant constant; 322 final dart2js.Constant constant;
317 323
318 LiteralList(this.type, List<Primitive> values, [this.constant]) 324 LiteralList(this.type, List<Primitive> values, [this.constant])
319 : this.values = _referenceList(values); 325 : this.values = _referenceList(values);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 T visitInvokeContinuation(InvokeContinuation node) => visitExpression(node); 405 T visitInvokeContinuation(InvokeContinuation node) => visitExpression(node);
400 T visitInvokeMethod(InvokeMethod node) => visitExpression(node); 406 T visitInvokeMethod(InvokeMethod node) => visitExpression(node);
401 T visitInvokeConstructor(InvokeConstructor node) => visitExpression(node); 407 T visitInvokeConstructor(InvokeConstructor node) => visitExpression(node);
402 T visitConcatenateStrings(ConcatenateStrings node) => visitExpression(node); 408 T visitConcatenateStrings(ConcatenateStrings node) => visitExpression(node);
403 T visitBranch(Branch node) => visitExpression(node); 409 T visitBranch(Branch node) => visitExpression(node);
404 410
405 // Definitions. 411 // Definitions.
406 T visitLiteralList(LiteralList node) => visitPrimitive(node); 412 T visitLiteralList(LiteralList node) => visitPrimitive(node);
407 T visitLiteralMap(LiteralMap node) => visitPrimitive(node); 413 T visitLiteralMap(LiteralMap node) => visitPrimitive(node);
408 T visitConstant(Constant node) => visitPrimitive(node); 414 T visitConstant(Constant node) => visitPrimitive(node);
415 T visitThis(This node) => visitPrimitive(node);
409 T visitInvokeConstConstructor(InvokeConstConstructor node) => visitPrimitive(n ode); 416 T visitInvokeConstConstructor(InvokeConstConstructor node) => visitPrimitive(n ode);
410 T visitParameter(Parameter node) => visitPrimitive(node); 417 T visitParameter(Parameter node) => visitPrimitive(node);
411 T visitContinuation(Continuation node) => visitDefinition(node); 418 T visitContinuation(Continuation node) => visitDefinition(node);
412 419
413 // Conditions. 420 // Conditions.
414 T visitIsTrue(IsTrue node) => visitCondition(node); 421 T visitIsTrue(IsTrue node) => visitCondition(node);
415 } 422 }
416 423
417 /// Generate a Lisp-like S-expression representation of an IR node as a string. 424 /// Generate a Lisp-like S-expression representation of an IR node as a string.
418 /// The representation is not pretty-printed, but it can easily be quoted and 425 /// The representation is not pretty-printed, but it can easily be quoted and
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 for (int i = node.parameters.length - 1; i >= 0; --i) { 681 for (int i = node.parameters.length - 1; i >= 0; --i) {
675 release(node.parameters[i]); 682 release(node.parameters[i]);
676 } 683 }
677 } 684 }
678 685
679 void visitIsTrue(IsTrue node) { 686 void visitIsTrue(IsTrue node) {
680 visitReference(node.value); 687 visitReference(node.value);
681 } 688 }
682 689
683 } 690 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698