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

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

Issue 1011403003: cps-ir: Set runtime type information for new objects that require it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../dart2jslib.dart' as dart2js; 7 import '../dart2jslib.dart' as dart2js;
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 Statement visitTypeOperator(cps_ir.TypeOperator node) { 504 Statement visitTypeOperator(cps_ir.TypeOperator node) {
505 Expression receiver = getVariableUse(node.receiver); 505 Expression receiver = getVariableUse(node.receiver);
506 Expression concat = 506 Expression concat =
507 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest); 507 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest);
508 return continueWithExpression(node.continuation, concat); 508 return continueWithExpression(node.continuation, concat);
509 } 509 }
510 510
511 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { 511 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) {
512 List<Expression> arguments = translateArguments(node.arguments); 512 List<Expression> arguments = translateArguments(node.arguments);
513 Expression invoke = 513 List<Expression> typeArguments = translateArguments(node.typeArguments);
514 new InvokeConstructor(node.type, node.target, node.selector, arguments); 514 Expression invoke = new InvokeConstructor(
515 node.type,
516 node.target,
517 node.selector,
518 arguments,
519 typeArguments);
515 return continueWithExpression(node.continuation, invoke); 520 return continueWithExpression(node.continuation, invoke);
516 } 521 }
517 522
518 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) { 523 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) {
519 // Invocations of the return continuation are translated to returns. 524 // Invocations of the return continuation are translated to returns.
520 // Other continuation invocations are replaced with assignments of the 525 // Other continuation invocations are replaced with assignments of the
521 // arguments to formal parameter variables, followed by the body if 526 // arguments to formal parameter variables, followed by the body if
522 // the continuation is singly reference or a break if it is multiply 527 // the continuation is singly reference or a break if it is multiply
523 // referenced. 528 // referenced.
524 cps_ir.Continuation cont = node.continuation.definition; 529 cps_ir.Continuation cont = node.continuation.definition;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 return getVariableUse(node.value); 644 return getVariableUse(node.value);
640 } 645 }
641 646
642 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { 647 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
643 return new ReifyRuntimeType(getVariableUse(node.value)); 648 return new ReifyRuntimeType(getVariableUse(node.value));
644 } 649 }
645 650
646 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { 651 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
647 return new ReadTypeVariable(node.variable, getVariableUse(node.target)); 652 return new ReadTypeVariable(node.variable, getVariableUse(node.target));
648 } 653 }
654
655 @override
656 Node visitTypeExpression(cps_ir.TypeExpression node) {
657 return new TypeExpression(
658 node.dartType,
659 node.arguments.map(getVariableUse).toList());
660 }
649 } 661 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698