| OLD | NEW |
| 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 library dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
| 8 import '../constants/values.dart' show PrimitiveConstantValue; | 8 import '../constants/values.dart' show PrimitiveConstantValue; |
| 9 import '../dart_backend/dart_backend.dart' show DartBackend; | |
| 10 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 11 import '../dart2jslib.dart'; | 10 import '../dart2jslib.dart'; |
| 12 import '../elements/elements.dart'; | 11 import '../elements/elements.dart'; |
| 13 import '../source_file.dart'; | 12 import '../source_file.dart'; |
| 14 import '../tree/tree.dart' as ast; | 13 import '../tree/tree.dart' as ast; |
| 15 import '../scanner/scannerlib.dart' show Token, isUserDefinableOperator; | 14 import '../scanner/scannerlib.dart' show Token, isUserDefinableOperator; |
| 16 import '../universe/universe.dart' show SelectorKind; | 15 import '../universe/universe.dart' show SelectorKind; |
| 17 import 'cps_ir_nodes.dart' as ir; | 16 import 'cps_ir_nodes.dart' as ir; |
| 18 | 17 |
| 19 part 'cps_ir_builder_visitor.dart'; | 18 part 'cps_ir_builder_visitor.dart'; |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 ir.Primitive buildStaticInvocation(Element element, | 687 ir.Primitive buildStaticInvocation(Element element, |
| 689 Selector selector, | 688 Selector selector, |
| 690 List<ir.Primitive> arguments) { | 689 List<ir.Primitive> arguments) { |
| 691 return _buildInvokeStatic(element, selector, arguments); | 690 return _buildInvokeStatic(element, selector, arguments); |
| 692 } | 691 } |
| 693 | 692 |
| 694 /// Create a static getter invocation of [element] where the getter name is | 693 /// Create a static getter invocation of [element] where the getter name is |
| 695 /// defined by [selector]. | 694 /// defined by [selector]. |
| 696 ir.Primitive buildStaticGet(Element element, Selector selector) { | 695 ir.Primitive buildStaticGet(Element element, Selector selector) { |
| 697 assert(selector.isGetter); | 696 assert(selector.isGetter); |
| 697 // TODO(karlklose,sigurdm): build different nodes for getters. |
| 698 return _buildInvokeStatic(element, selector, const <ir.Primitive>[]); | 698 return _buildInvokeStatic(element, selector, const <ir.Primitive>[]); |
| 699 } | 699 } |
| 700 | 700 |
| 701 /// Create a static setter invocation of [element] where the setter name and | 701 /// Create a static setter invocation of [element] where the setter name and |
| 702 /// argument are defined by [selector] and [value], respectively. | 702 /// argument are defined by [selector] and [value], respectively. |
| 703 ir.Primitive buildStaticSet(Element element, | 703 ir.Primitive buildStaticSet(Element element, |
| 704 Selector selector, | 704 Selector selector, |
| 705 ir.Primitive value) { | 705 ir.Primitive value) { |
| 706 assert(selector.isSetter); | 706 assert(selector.isSetter); |
| 707 // TODO(karlklose,sigurdm): build different nodes for setters. |
| 707 _buildInvokeStatic(element, selector, <ir.Primitive>[value]); | 708 _buildInvokeStatic(element, selector, <ir.Primitive>[value]); |
| 708 return value; | 709 return value; |
| 709 } | 710 } |
| 710 | 711 |
| 711 /// Create a constructor invocation of [element] on [type] where the | 712 /// Create a constructor invocation of [element] on [type] where the |
| 712 /// constructor name and argument structure are defined by [selector] and the | 713 /// constructor name and argument structure are defined by [selector] and the |
| 713 /// argument values are defined by [arguments]. | 714 /// argument values are defined by [arguments]. |
| 714 ir.Primitive buildConstructorInvocation(FunctionElement element, | 715 ir.Primitive buildConstructorInvocation(FunctionElement element, |
| 715 Selector selector, | 716 Selector selector, |
| 716 DartType type, | 717 DartType type, |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 index = 0; | 1516 index = 0; |
| 1516 for (int i = 0; i < environment.length; ++i) { | 1517 for (int i = 0; i < environment.length; ++i) { |
| 1517 if (common[i] == null) { | 1518 if (common[i] == null) { |
| 1518 environment.index2value[i] = parameters[index++]; | 1519 environment.index2value[i] = parameters[index++]; |
| 1519 } | 1520 } |
| 1520 } | 1521 } |
| 1521 | 1522 |
| 1522 return join; | 1523 return join; |
| 1523 } | 1524 } |
| 1524 } | 1525 } |
| OLD | NEW |