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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart

Issue 968843003: Implement type argument access and reification of runtime types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unbreak long line. Created 5 years, 9 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 part of tree_ir.optimization; 5 part of tree_ir.optimization;
6 6
7 /// Rewrites logical expressions to be more compact in the Tree IR. 7 /// Rewrites logical expressions to be more compact in the Tree IR.
8 /// 8 ///
9 /// In this class an expression is said to occur in "boolean context" if 9 /// In this class an expression is said to occur in "boolean context" if
10 /// its result is immediately applied to boolean conversion. 10 /// its result is immediately applied to boolean conversion.
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 Expression visitCreateBox(CreateBox node) { 336 Expression visitCreateBox(CreateBox node) {
337 return node; 337 return node;
338 } 338 }
339 339
340 Expression visitCreateInstance(CreateInstance node) { 340 Expression visitCreateInstance(CreateInstance node) {
341 _rewriteList(node.arguments); 341 _rewriteList(node.arguments);
342 return node; 342 return node;
343 } 343 }
344 344
345 Expression visitReifyRuntimeType(ReifyRuntimeType node) {
346 node.value = visitExpression(node.value);
347 return node;
348 }
349
350 Expression visitReadTypeVariable(ReadTypeVariable node) {
351 node.target = visitExpression(node.target);
352 return node;
353 }
354
345 /// True if the given expression is known to evaluate to a boolean. 355 /// True if the given expression is known to evaluate to a boolean.
346 /// This will not recursively traverse [Conditional] expressions, but if 356 /// This will not recursively traverse [Conditional] expressions, but if
347 /// applied to the result of [visitExpression] conditionals will have been 357 /// applied to the result of [visitExpression] conditionals will have been
348 /// rewritten anyway. 358 /// rewritten anyway.
349 bool isBooleanValued(Expression e) { 359 bool isBooleanValued(Expression e) {
350 return isTrue(e) || isFalse(e) || e is Not || e is LogicalOperator; 360 return isTrue(e) || isFalse(e) || e is Not || e is LogicalOperator;
351 } 361 }
352 362
353 /// Rewrite an expression that was originally processed in a non-boolean 363 /// Rewrite an expression that was originally processed in a non-boolean
354 /// context. 364 /// context.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 } 498 }
489 499
490 /// Destructively updates each entry of [l] with the result of visiting it. 500 /// Destructively updates each entry of [l] with the result of visiting it.
491 void _rewriteList(List<Expression> l) { 501 void _rewriteList(List<Expression> l) {
492 for (int i = 0; i < l.length; i++) { 502 for (int i = 0; i < l.length; i++) {
493 l[i] = visitExpression(l[i]); 503 l[i] = visitExpression(l[i]);
494 } 504 }
495 } 505 }
496 } 506 }
497 507
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698