| OLD | NEW |
| 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 code_generator; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
| 10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; | 10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 <js.Expression>[name, internalName, kind, arguments, argumentNames]); | 638 <js.Expression>[name, internalName, kind, arguments, argumentNames]); |
| 639 } | 639 } |
| 640 | 640 |
| 641 @override | 641 @override |
| 642 js.Expression visitInterceptor(tree_ir.Interceptor node) { | 642 js.Expression visitInterceptor(tree_ir.Interceptor node) { |
| 643 glue.registerUseInterceptorInCodegen(); | 643 glue.registerUseInterceptorInCodegen(); |
| 644 registry.registerSpecializedGetInterceptor(node.interceptedClasses); | 644 registry.registerSpecializedGetInterceptor(node.interceptedClasses); |
| 645 js.Name helperName = glue.getInterceptorName(node.interceptedClasses); | 645 js.Name helperName = glue.getInterceptorName(node.interceptedClasses); |
| 646 js.Expression globalHolder = glue.getInterceptorLibrary(); | 646 js.Expression globalHolder = glue.getInterceptorLibrary(); |
| 647 return js.js('#.#(#)', | 647 return js.js('#.#(#)', |
| 648 [globalHolder, helperName, visitExpression(node.input)]); | 648 [globalHolder, helperName, visitExpression(node.input)]) |
| 649 .withSourceInformation(node.sourceInformation); |
| 649 } | 650 } |
| 650 | 651 |
| 651 @override | 652 @override |
| 652 js.Expression visitGetField(tree_ir.GetField node) { | 653 js.Expression visitGetField(tree_ir.GetField node) { |
| 653 registry.registerFieldGetter(node.field); | 654 registry.registerFieldGetter(node.field); |
| 654 return new js.PropertyAccess( | 655 return new js.PropertyAccess( |
| 655 visitExpression(node.object), | 656 visitExpression(node.object), |
| 656 glue.instanceFieldPropertyName(node.field)); | 657 glue.instanceFieldPropertyName(node.field)); |
| 657 } | 658 } |
| 658 | 659 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 return js.js("typeof # === 'number' && Math.floor(#) === #", args); | 826 return js.js("typeof # === 'number' && Math.floor(#) === #", args); |
| 826 } | 827 } |
| 827 } | 828 } |
| 828 | 829 |
| 829 visitFunctionExpression(tree_ir.FunctionExpression node) { | 830 visitFunctionExpression(tree_ir.FunctionExpression node) { |
| 830 // FunctionExpressions are currently unused. | 831 // FunctionExpressions are currently unused. |
| 831 // We might need them if we want to emit raw JS nested functions. | 832 // We might need them if we want to emit raw JS nested functions. |
| 832 throw 'FunctionExpressions should not be used'; | 833 throw 'FunctionExpressions should not be used'; |
| 833 } | 834 } |
| 834 } | 835 } |
| OLD | NEW |